harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r648211 [3/4] - in /harmony/enhanced/drlvm/trunk: make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/include/ vm/include/open/ vm/interpreter/src/ vm/jitrino/src/jet/ vm/jitrino/src/translator/java/ vm/jitrino/src/vm/ vm/vmcore/build/ vm/vmcore/i...
Date Tue, 15 Apr 2008 11:29:54 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp Tue Apr 15 04:29:41 2008
@@ -28,6 +28,7 @@
 #include "open/gc.h"
 #include "open/hythread_ext.h"
 #include "open/jthread.h"   // this is for jthread_self()
+#include "open/vm_class_manipulation.h"
 
 #include "init.h"
 #include "classloader.h"
@@ -149,12 +150,6 @@
         
     } else if (strcmp(func_name,"class_is_support_fast_instanceof") == 0) {
         return (void*)class_get_fast_instanceof_flag;
-    } else if (strcmp(func_name,"class_is_final") == 0) {
-        return (void*)class_is_final;
-    } else if (strcmp(func_name,"class_is_throwable") == 0) {
-        return (void*)class_hint_is_exceptiontype;
-    } else if (strcmp(func_name,"class_is_abstract") == 0) {
-        return (void*)class_is_abstract;
     } else if (strcmp(func_name,"vector_get_first_element_offset") == 0) {
         return (void*)vector_first_element_offset_class_handle;
     } else if (strcmp(func_name,"vector_get_length_offset") == 0) {
@@ -169,12 +164,6 @@
         return (void*)hythread_uses_fast_tls;
     } else if (strcmp(func_name,"vm_get_tls_offset_in_segment") == 0) {
         return (void*)hythread_get_hythread_offset_in_tls;
-    } else if (strcmp(func_name,"vm_get_system_object_class") == 0) {
-        return (void*)get_system_object_class;
-    } else if (strcmp(func_name,"vm_get_system_class_class") == 0) {
-        return (void*)get_system_class_class;
-    } else if (strcmp(func_name,"vm_get_system_string_class") == 0) {
-        return (void*)get_system_string_class;
     } else if (strcmp(func_name,"vm_get_heap_base_address") == 0) {
         return (void*)vm_heap_base_address;
     } else if (strcmp(func_name,"vm_get_heap_ceiling_address") == 0) {
@@ -910,18 +899,18 @@
     // Now the thread is attached to VM and it is valid to disable it.
     hythread_suspend_disable();
 
-    // Create java.lang.Object.    
+    // Create java.lang.Object.
     vm_env->java_lang_Object = oh_allocate_global_handle();
     vm_env->java_lang_Object->object =
-        class_alloc_new_object(vm_env->JavaLangObject_Class);    
+        class_alloc_new_object(vm_env->JavaLangObject_Class);
     // Create java.lang.OutOfMemoryError.
     class_initialize(vm_env->java_lang_OutOfMemoryError_Class);
     vm_env->java_lang_OutOfMemoryError = oh_allocate_global_handle();
-    vm_env->java_lang_OutOfMemoryError->object = 
+    vm_env->java_lang_OutOfMemoryError->object =
         class_alloc_new_object(vm_env->java_lang_OutOfMemoryError_Class);
     // Create java.lang.ThreadDeath.
     vm_env->java_lang_ThreadDeath = oh_allocate_global_handle();
-    vm_env->java_lang_ThreadDeath->object = 
+    vm_env->java_lang_ThreadDeath->object =
         class_alloc_new_object(vm_env->java_lang_ThreadDeath_Class);
 
     // Create pop frame exception.

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Tue Apr 15 04:29:41 2008
@@ -22,8 +22,10 @@
 #include "cxxlog.h"
 #include "vm_log.h"
 
+#include "open/gc.h"
 #include "open/vm_type_access.h"
 #include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 
 #include "apr_strings.h"
 #include "lock_manager.h"
@@ -42,7 +44,6 @@
 #include "jvmti_internal.h"
 #include "jvmti_break_intf.h"
 #include "cci.h"
-#include "open/gc.h"
 
 #include "vm_stats.h"
 #include "dump.h"
@@ -125,22 +126,20 @@
 
 void CodeChunkInfo::print_name() const
 {
-    Method *meth = get_method();
-    assert(meth);
-    const char* c = class_get_name(method_get_class(meth));
-    const char* m = method_get_name(meth);
-    const char* d = method_get_descriptor(meth); 
+    assert(_method);
+    const char* c = _method->get_class()->get_name()->bytes;
+    const char* m = _method->get_name()->bytes;
+    const char* d = _method->get_descriptor()->bytes;
     printf("%d:%d:%s.%s%s", get_jit_index(), get_id(), c, m, d);
 } //CodeChunkInfo::print_name
 
 
 void CodeChunkInfo::print_name(FILE *file) const
 {
-    Method *meth = get_method();
-    assert(meth);
-    const char* c = class_get_name(method_get_class(meth));
-    const char* m = method_get_name(meth);
-    const char* d = method_get_descriptor(meth); 
+    assert(_method);
+    const char* c = _method->get_class()->get_name()->bytes;
+    const char* m = _method->get_name()->bytes;
+    const char* d = _method->get_descriptor()->bytes; 
     fprintf(file, "%d:%d:%s.%s%s", get_jit_index(), get_id(), c, m, d);
 } //CodeChunkInfo::print_name
 
@@ -208,11 +207,11 @@
 NativeCodePtr compile_create_lil_jni_stub(Method_Handle method, void* func, NativeStubOverride nso)
 {
     ASSERT_NO_INTERPRETER;
-    const Class_Handle clss = method_get_class(method);
-    bool is_static = (method_is_static(method) ? true : false);
-    bool is_synchronised = (method_is_synchronized(method) ? true : false);
+    const Class_Handle clss = method->get_class();
+    bool is_static = method->is_static();
+    bool is_synchronised = method->is_synchronized();
     Method_Signature_Handle msh = method_get_signature(method);
-    unsigned num_args = method_args_get_number(msh);
+    unsigned num_args = method->get_num_args();
     Type_Info_Handle ret_tih = method_ret_type_get_type_info(msh);
     VM_Data_Type ret_type = type_info_get_type(ret_tih);
     unsigned i;
@@ -519,7 +518,8 @@
 
 #ifndef NDEBUG
     char buf[100];
-    apr_snprintf(buf, sizeof(buf)-1, "jni_stub.%s::%s", class_get_name(clss), method_get_name(method));
+    apr_snprintf(buf, sizeof(buf)-1, "jni_stub.%s::%s", clss->get_name()->bytes,
+        method->get_name()->bytes);
     DUMP_STUB(addr, buf, lil_cs_get_code_size(cs));
 #endif
 
@@ -588,7 +588,7 @@
 
 static JIT_Result compile_prepare_native_method(Method* method)
 {
-    TRACE("compile_prepare_native_method(" << method_get_name(method) << ")");
+    TRACE("compile_prepare_native_method (" << method->get_name()->bytes << ")");
 #ifdef VM_STATS
     VM_Statistics::get_vm_stats().num_native_methods++;
 #endif
@@ -736,7 +736,7 @@
     ASSERT_RAISE_AREA;
     assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
-    class_initialize_ex(method->get_class());
+    class_initialize(method->get_class());
     tmn_suspend_enable();
    
     method->lock();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Tue Apr 15 04:29:41 2008
@@ -14,16 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Intel, Evgueni Brevnov, Ivan Volosyuk
- * @version $Revision: 1.1.2.5.4.4 $
- */
-
 
 #define LOG_DOMAIN "vm.helpers"
 #include "cxxlog.h"
 
-
 #include <assert.h>
 #include <float.h>
 
@@ -36,11 +30,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "open/gc.h"
+#include "open/types.h"
+#include "open/bytecodes.h"
+#include "open/vm_class_manipulation.h"
+
 #include "Class.h"
 #include "environment.h"
 #include "exceptions.h"
 #include "exceptions_jit.h"
-#include "open/gc.h"
 #include "ini.h"
 #include "jit_runtime_support.h"
 #include "jit_runtime_support_common.h"
@@ -53,9 +51,6 @@
 #include "vm_arrays.h"
 #include "vm_strings.h"
 #include "vm_threads.h"
-#include "open/types.h"
-#include "open/bytecodes.h"
-#include "open/vm_util.h"
 
 #include "jvmti_interface.h"
 #include "compile.h"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/native_overrides.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/native_overrides.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/native_overrides.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/native_overrides.cpp Tue Apr 15 04:29:41 2008
@@ -339,7 +339,7 @@
         VM_Global_State::loader_env->managed_null,
         VM_Global_State::loader_env->managed_null,
         (POINTER_SIZE_INT)object_get_vtable_offset(),
-        class_get_vtable(env->ArrayOfChar_Class),
+        env->ArrayOfChar_Class->get_vtable(),
         (POINTER_SIZE_INT)object_get_vtable_offset(),
         length_offset, length_offset);
     assert(cs);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp Tue Apr 15 04:29:41 2008
@@ -17,12 +17,15 @@
 
 #define LOG_DOMAIN "vm.helpers"
 #include "cxxlog.h"
+
+#include <map>
+
+#include "open/vm_class_manipulation.h"
 #include "jit_runtime_support.h"
 #include "Class.h"
 #include "environment.h"
 #include "exceptions.h"
 #include "init.h"
-#include <map>
 
 #ifndef _WIN32
     #define strcmpi strcasecmp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp Tue Apr 15 04:29:41 2008
@@ -14,19 +14,15 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Intel, Gregory Shimansky
- * @version $Revision: 1.1.2.1.4.3 $
- */  
-
 
 #define LOG_DOMAIN "jni"
 #include "cxxlog.h"
 
+#include "open/vm_class_manipulation.h"
 #include "Class.h"
 #include "environment.h"
 #include "object_handles.h"
-#include "open/vm_util.h"
+//#include "open/vm_util.h"
 #include "vm_threads.h"
 
 #include "ini.h"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp Tue Apr 15 04:29:41 2008
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Gregory Shimansky
- * @version $Revision: 1.1.2.1.4.4 $
- */  
 /*
  * JVMTI API for working with breakpoints
  */
@@ -46,7 +42,7 @@
     assert(bp);
 
     TRACE2("jvmti.break", "Process breakpoint: "
-            << bp->method << " :" << bp->location << " :" << bp->addr );
+        << bp->method << " :" << bp->location << " :" << bp->addr );
 
     DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
     if (ti->getPhase() != JVMTI_PHASE_LIVE)
@@ -123,8 +119,8 @@
                    jmethodID method,
                    jlocation location)
 {
-    TRACE2("jvmti.break", "SetBreakpoint is called for method: " << method
-        << " :" << location);
+    TRACE2("jvmti.break", "SetBreakpoint is called for method: "
+        << method << " :" << location);
     SuspendEnabledChecker sec;
 
     jvmtiError errorCode;
@@ -195,8 +191,8 @@
                      jmethodID method,
                      jlocation location)
 {
-    TRACE2("jvmti.break", "ClearBreakpoint is called for method: " << method
-        << " :" << location);
+    TRACE2("jvmti.break", "ClearBreakpoint is called for method: "
+        << method << " :" << location);
     SuspendEnabledChecker sec;
     jvmtiError errorCode;
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp Tue Apr 15 04:29:41 2008
@@ -14,10 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Ilya Berezhniuk, Gregory Shimansky
- * @version $Revision$
- */  
+
 /**
  * @file jvmti_break_intf.cpp
  * @brief JVMTI native breakpoints API implementation
@@ -150,9 +147,9 @@
         return false;
     } else if( bp->method ) {
         TRACE2("jvmti.break", "Try to insert breakpoint: "
-            << class_get_name(method_get_class((Method*)bp->method)) << "."
-            << method_get_name((Method*)bp->method)
-            << method_get_descriptor((Method*)bp->method)
+            << bp->method->get_class()->get_name()->bytes << "."
+            << bp->method->get_name()->bytes
+            << bp->method->get_descriptor()->bytes
             << " :" << bp->location << " :" << bp->addr);
 
         VMBreakPoint* another = find_breakpoint(bp->method, bp->location);
@@ -162,10 +159,10 @@
 
         TRACE2("jvmti.break", "Before inserting found another breakpoint: "
             << (another->method
-                ? class_get_name(method_get_class((Method*)another->method)): "(nil)")
+                ? another->method->get_class()->get_name()->bytes : "(nil)")
             << "."
-            << (another->method ? method_get_name((Method*)another->method) : "(nil)")
-            << (another->method ? method_get_descriptor((Method*)another->method) : "")
+            << (another->method ? another->method->get_name()->bytes : "(nil)")
+            << (another->method ? another->method->get_descriptor()->bytes : "")
             << " :" << another->location << " :" << another->addr);
 
         if( bp->addr == another->addr) {
@@ -182,10 +179,10 @@
 
         TRACE2("jvmti.break", "Before inserting found another breakpoint: "
             << (another->method
-                ? class_get_name(method_get_class((Method*)another->method)) :"(nil)")
+                ? another->method->get_class()->get_name()->bytes :"(nil)")
             << "."
-            << (another->method ? method_get_name((Method*)another->method) :"(nil)")
-            << (another->method ? method_get_descriptor((Method*)another->method) :"")
+            << (another->method ? another->method->get_name()->bytes :"(nil)")
+            << (another->method ? another->method->get_descriptor()->bytes :"")
             << " :" << another->location << " :" << another->addr);
 
         if(another->method) {
@@ -203,10 +200,10 @@
 {
     TRACE2("jvmti.break", "Insert breakpoint: "
         << (bp->method
-            ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)")
+            ? bp->method->get_class()->get_name()->bytes : "(nil)")
         << "."
-        << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-        << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
+        << (bp->method ? bp->method->get_name()->bytes : "(nil)")
+        << (bp->method ? bp->method->get_descriptor()->bytes : "")
         << " :" << bp->location << " :" << bp->addr);
 
     // add breakpoint to the top of list
@@ -235,9 +232,9 @@
         {
             assert(bp->addr == NULL);
             TRACE2("jvmti.break.intf", "Skipping setting breakpoint in method "
-                << class_get_name(method_get_class(m)) << "."
-                << method_get_name(m)
-                << method_get_descriptor(m)
+                << m->get_class()->get_name()->bytes << "."
+                << m->get_name()->bytes
+                << m->get_descriptor()->bytes
                 << " because it is not compiled yet");
             m->insert_pending_breakpoint();
         }
@@ -270,10 +267,10 @@
 VMBreakPoints::remove_breakpoint(VMBreakPoint* bp)
 {
     TRACE2("jvmti.break.intf", "Remove breakpoint: "
-        << (bp->method ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)" )
+        << (bp->method ? bp->method->get_class()->get_name()->bytes : "(nil)" )
         << "."
-        << (bp->method ? method_get_name((Method*)bp->method) : "(nil)" )
-        << (bp->method ? method_get_descriptor((Method*)bp->method) : "" )
+        << (bp->method ? bp->method->get_name()->bytes : "(nil)" )
+        << (bp->method ? bp->method->get_descriptor()->bytes : "" )
         << " :" << bp->location << " :" << bp->addr);
 
     // remove breakpoint from list
@@ -294,10 +291,10 @@
             TRACE2("jvmti.break", "Remove local thread breakpoint: "
                 << local << ", bp: "
                 << (bp->method
-                    ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)")
+                    ? bp->method->get_class()->get_name()->bytes : "(nil)")
                 << "."
-                << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-                << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
+                << (bp->method ? bp->method->get_name()->bytes : "(nil)")
+                << (bp->method ? bp->method->get_descriptor()->bytes : "")
                 << " :" << bp->location << " :" << bp->addr);
 
             local->bp = NULL;
@@ -306,10 +303,10 @@
             TRACE2("jvmti.break", "Set local thread next breakpoint: "
                 << local << ", next: "
                 << (bp->method
-                    ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)")
+                    ? bp->method->get_class()->get_name()->bytes : "(nil)")
                 << "."
-                << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-                << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
+                << (bp->method ? bp->method->get_name()->bytes : "(nil)")
+                << (bp->method ? bp->method->get_descriptor()->bytes : "")
                 << " :" << bp->location << " :" << bp->addr);
             local->bp_next = bp->next;
         }
@@ -622,12 +619,11 @@
     }
     assert(bp->addr == addr);
     TRACE2("jvmti.break", "Process native breakpoint: "
-        << (bp->method
-            ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)")
+        << (bp->method ? bp->method->get_class()->get_name()->bytes : "(nil)")
         << "."
-        << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-        << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
-        << " :" << bp->location << " :" << bp->addr);
+        << (bp->method ? bp->method->get_name()->bytes : "(nil)")
+        << (bp->method ? bp->method->get_descriptor()->bytes : "")
+        << " : " << bp->location << " : " << bp->addr);
 
     // Save registers in TLS - mainly for single stepping in virtual methods
     vm_set_jvmti_saved_exception_registers(vm_thread, regs);
@@ -687,10 +683,10 @@
                     TRACE2("jvmti.break",
                         "Calling native breakpoint callback function: "
                         << (method
-                            ? class_get_name(method_get_class(method)) : "(nil)")
+                            ? method->get_class()->get_name()->bytes : "(nil)")
                         << "."
-                        << (method ? method_get_name(method) : "(nil)")
-                        << (method ? method_get_descriptor(method) : "")
+                        << (method ? method->get_name()->bytes : "(nil)")
+                        << (method ? method->get_descriptor()->bytes : "")
                         << " :" << location << " :" << addr);
 
                     set_thread_local_break(&local);
@@ -705,10 +701,10 @@
                     TRACE2("jvmti.break",
                         "Finished native breakpoint callback function: "
                         << (method
-                            ? class_get_name(method_get_class(method)) : "(nil)")
+                            ? method->get_class()->get_name()->bytes : "(nil)")
                         << "."
-                        << (method ? method_get_name(method) : "(nil)")
-                        << (method ? method_get_descriptor(method) : "")
+                        << (method ? method->get_name()->bytes : "(nil)")
+                        << (method ? method->get_descriptor()->bytes : "")
                         << " :" << location << " :" << addr);
 
                     if( !local.bp ) {
@@ -847,10 +843,10 @@
 VMBreakPoints::process_interpreter_breakpoint(jmethodID method, jlocation location)
 {
     TRACE2("jvmti.break.intf", "Interpreter breakpoint occured: "
-        << class_get_name(method_get_class((Method*)method)) << "."
-        << method_get_name((Method*)method)
-        << method_get_descriptor((Method*)method)
-        << " :" << location );
+        << method->get_class()->get_name()->bytes << "."
+        << method->get_name()->bytes
+        << method->get_descriptor()->bytes
+        << " : " << location );
 
     assert(interpreter_enabled());
 
@@ -864,9 +860,9 @@
     assert(bp->method == method);
     assert(bp->location == location);
     TRACE2("jvmti.break", "Process interpreter breakpoint: "
-        << class_get_name(method_get_class((Method*)method)) << "."
-        << method_get_name((Method*)method)
-        << method_get_descriptor((Method*)method)
+        << method->get_class()->get_name()->bytes << "."
+        << method->get_name()->bytes
+        << method->get_descriptor()->bytes
         << " :" << location );
 
     jbyte orig_byte = bp->saved_byte;
@@ -905,9 +901,9 @@
 
                     TRACE2("jvmti.break.intf",
                         "Calling interpreter breakpoint callback function: "
-                        << class_get_name(method_get_class((Method*)method)) << "."
-                        << method_get_name((Method*)method)
-                        << method_get_descriptor((Method*)method)
+                        << method->get_class()->get_name()->bytes << "."
+                        << method->get_name()->bytes
+                        << method->get_descriptor()->bytes
                         << " :" << location );
 
                     set_thread_local_break(&local);
@@ -921,9 +917,9 @@
 
                     TRACE2("jvmti.break",
                         "Finished interpreter breakpoint callback function: "
-                        << class_get_name(method_get_class((Method*)method)) << "."
-                        << method_get_name((Method*)method)
-                        << method_get_descriptor((Method*)method)
+                        << method->get_class()->get_name()->bytes << "."
+                        << method->get_name()->bytes
+                        << method->get_descriptor()->bytes
                         << " :" << location );
 
                     if( !local.bp ) {
@@ -1003,10 +999,10 @@
 
     TRACE2("jvmti.break.intf", "Added ref on breakpoint: "
         << (bp->method
-            ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)" )
+            ? bp->method->get_class()->get_name()->bytes : "(nil)" )
         << "."
-        << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-        << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
+        << (bp->method ? bp->method->get_name()->bytes : "(nil)")
+        << (bp->method ? bp->method->get_descriptor()->bytes : "")
         << " :" << bp->location << " :" << bp->addr << ", data: " << data);
 
     return bp_ref;
@@ -1135,10 +1131,10 @@
 
     TRACE2("jvmti.break.intf", "Remove reference on breakpoint: "
         << (bp_ref->bp->method
-            ? class_get_name(method_get_class((Method*)bp_ref->bp->method)) : "(nil)")
+            ? bp_ref->bp->method->get_class()->get_name()->bytes : "(nil)")
         << "."
-        << (bp_ref->bp->method ? method_get_name((Method*)bp_ref->bp->method) : "(nil)")
-        << (bp_ref->bp->method ? method_get_descriptor((Method*)bp_ref->bp->method) : "")
+        << (bp_ref->bp->method ? bp_ref->bp->method->get_name()->bytes : "(nil)")
+        << (bp_ref->bp->method ? bp_ref->bp->method->get_descriptor()->bytes : "")
         << " :" << bp_ref->bp->location << " :" << bp_ref->bp->addr
         << ", data: " << bp_ref->data );
 
@@ -1264,9 +1260,9 @@
     }
 
     TRACE2("jvmti.break.intf", "Set JIT breakpoint: "
-        << class_get_name(method_get_class((Method*)bp->method)) << "."
-        << method_get_name((Method*)bp->method)
-        << method_get_descriptor((Method*)bp->method)
+        << bp->method->get_class()->get_name()->bytes << "."
+        << bp->method->get_name()->bytes
+        << bp->method->get_descriptor()->bytes
         << " :" << bp->location << " :" << bp->addr);
 
     return set_native_breakpoint(bp);
@@ -1279,10 +1275,10 @@
     assert(bp->addr);
 
     TRACE2("jvmti.break.intf", "Instrumenting native: "
-        << (bp->method ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)" )
+        << (bp->method ? bp->method->get_class()->get_name()->bytes : "(nil)" )
         << "."
-        << (bp->method ? method_get_name((Method*)bp->method) : "(nil)" )
-        << (bp->method ? method_get_descriptor((Method*)bp->method) : "" )
+        << (bp->method ? bp->method->get_name()->bytes : "(nil)" )
+        << (bp->method ? bp->method->get_descriptor()->bytes : "" )
         << " :" << bp->location << " :" << bp->addr);
 
     VMBreakPoints* vm_brpt = VM_Global_State::loader_env->TI->vm_brpt;
@@ -1324,10 +1320,10 @@
     if (!vm_brpt->find_breakpoint(bp->addr))
     {
         TRACE2("jvmti.break.intf", "Deinstrumentation native: "
-            << (bp->method ? class_get_name(method_get_class((Method*)bp->method)) : "" )
+            << (bp->method ? bp->method->get_class()->get_name()->bytes : "" )
             << "."
-            << (bp->method ? method_get_name((Method*)bp->method) : "" )
-            << (bp->method ? method_get_descriptor((Method*)bp->method) : "" )
+            << (bp->method ? bp->method->get_name()->bytes : "" )
+            << (bp->method ? bp->method->get_descriptor()->bytes : "" )
             << " :" << bp->location << " :" << bp->addr);
 
         if (port_clear_breakpoint(bp->addr, bp->saved_byte) != 0)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp Tue Apr 15 04:29:41 2008
@@ -412,9 +412,9 @@
 
     *status_ptr = 0;
 
-    if( cl->is_primitive() ) {
+    if(cl->is_primitive()) {
         *status_ptr = JVMTI_CLASS_STATUS_PRIMITIVE;
-    } else if( cl->is_array() ) {
+    } else if(cl->is_array()) {
         *status_ptr = JVMTI_CLASS_STATUS_ARRAY;
     } else {
         switch(cl->get_state())

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Tue Apr 15 04:29:41 2008
@@ -1187,14 +1187,14 @@
         JNIEnv *jni_env = p_TLS_vmthread->jni_env;
         jvmtiEnv *jvmti_env = (jvmtiEnv*) ti_env;
 
-        TRACE2("jvmti.break.ss", "Calling SingleStep callback for env " << jvmti_env << ": " <<
-            method << " :" << location);
+        TRACE2("jvmti.break.ss", "Calling SingleStep callback for env " << jvmti_env << ": "
+            << method << " :" << location);
 
         if (NULL != ti_env->event_table.SingleStep)
             ti_env->event_table.SingleStep(jvmti_env, jni_env, thread, method, location);
 
-        TRACE2("jvmti.break.ss", "Finished SingleStep callback for env " << jvmti_env << ": " <<
-            method << " :" << location);
+        TRACE2("jvmti.break.ss", "Finished SingleStep callback for env " << jvmti_env << ": "
+            << method << " :" << location);
         ti_env = next_env;
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.h Tue Apr 15 04:29:41 2008
@@ -103,7 +103,7 @@
 inline jint ti_get_object_size(TIEnv *ti_env, Managed_Object_Handle obj)
 {
     Class* clss = ((ManagedObject*)obj)->vt()->clss;
-    if (class_is_array(clss)) {
+    if (clss->is_array()) {
         return vm_vector_size(clss, get_vector_length(obj));
     } else {
         return class_get_boxed_data_size(clss);
@@ -141,8 +141,7 @@
     bool r = false;
     if (is_object_valid(jobj->object)) {
         Class* cls = ((ManagedObject*)jobj->object)->vt()->clss;
-        r = class_is_instanceof(cls,
-            VM_Global_State::loader_env->JavaLangClass_Class);
+        r = cls->is_instanceof(VM_Global_State::loader_env->JavaLangClass_Class);
     }
     hythread_suspend_enable();
     return r;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp Tue Apr 15 04:29:41 2008
@@ -25,9 +25,9 @@
 #include <string.h>
 #include "open/vm_method_access.h"
 #include "Class.h"
+#include "class_member.h"
 #include "vm_strings.h"
 #include "jvmti_direct.h"
-#include "Class.h"
 #include "object_handles.h"
 #include "jvmti_utils.h"
 #include "cxxlog.h"
@@ -681,28 +681,22 @@
 void jvmti_method_enter_callback(Method_Handle method)
 {
     BEGIN_RAISE_AREA;
-
     TRACE2("jvmti.event.method.entry", "MethodEntry: " << method);
     jvmti_process_method_entry_event(reinterpret_cast<jmethodID>(method));
-
     END_RAISE_AREA;
 }
 
 void jvmti_method_exit_callback(Method_Handle method, jvalue* return_value)
 {
     BEGIN_RAISE_AREA;
-
     TRACE2("jvmti.event.method.exit", "MethodExit: " << method);
 
-    Method *m = reinterpret_cast<Method *>(method);
-    jmethodID mid = reinterpret_cast<jmethodID>(method);
-
-    if (m->get_return_java_type() != JAVA_TYPE_VOID)
-        jvmti_process_method_exit_event(mid, JNI_FALSE, *return_value);
+    if (method->get_return_java_type() != JAVA_TYPE_VOID)
+        jvmti_process_method_exit_event((jmethodID)method, JNI_FALSE, *return_value);
     else
     {
         jvalue jv = { 0 };
-        jvmti_process_method_exit_event(mid, JNI_FALSE, jv);
+        jvmti_process_method_exit_event((jmethodID)method, JNI_FALSE, jv);
     }
 
     END_RAISE_AREA;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp Tue Apr 15 04:29:41 2008
@@ -97,11 +97,12 @@
     // go to 2-d frame & check it's managed
     si_goto_previous(si);
     assert(! si_is_native(si));
+    Method* UNREF pop_method = si_get_code_chunk_info(si)->get_method();
     TRACE(("PopFrame is called for method %s.%s%s :%p",
-        class_get_name(method_get_class(si_get_code_chunk_info(si)->get_method())),
-        method_get_name(si_get_code_chunk_info(si)->get_method()),
-        method_get_descriptor(si_get_code_chunk_info(si)->get_method()),
-        si_get_ip(si) ));
+        pop_method->get_class()->get_name()->bytes,
+        pop_method->get_name()->bytes,
+        pop_method->get_descriptor()->bytes,
+        si_get_ip(si)));
 
     // go to 3-d frame & check its type
     si_goto_previous(si);
@@ -156,13 +157,14 @@
 
     // save information about java method
     assert(cci);
-    Method *method = cci->get_method();
+    Method* method = cci->get_method();
     Class* method_class = method->get_class();
     bool is_method_static = method->is_static();
     TRACE(("PopFrame method %s.%s%s, stop IP: %p",
-        class_get_name(method_get_class(cci->get_method())),
-        method_get_name(cci->get_method()),
-        method_get_descriptor(cci->get_method()), si_get_ip(si) ));
+        method->get_class()->get_name()->bytes,
+        method->get_name()->bytes,
+        method->get_descriptor()->bytes,
+        si_get_ip(si)));
 
     // free lock of synchronized method
     /*
@@ -185,9 +187,9 @@
     JIT *jit = cci->get_jit();
 
     TRACE(("PopFrame method %s.%s%s, set IP begin: %p",
-        class_get_name(method_get_class(si_get_code_chunk_info(si)->get_method())),
-        method_get_name(si_get_code_chunk_info(si)->get_method()),
-        method_get_descriptor(si_get_code_chunk_info(si)->get_method()), ip ));
+        method->get_class()->get_name()->bytes,
+        method->get_name()->bytes,
+        method->get_descriptor()->bytes, ip));
 
     uint16 bcOffset;
     NativeCodePtr bcip;
@@ -196,10 +198,12 @@
     jit->get_native_location_for_bc(method, bcOffset, &bcip);
     si_set_ip(si, bcip, false);
 
+    method = si_get_code_chunk_info(si)->get_method();
+
     TRACE(("PopFrame method %s.%s%s, set IP end: %p",
-        class_get_name(method_get_class(si_get_code_chunk_info(si)->get_method())),
-        method_get_name(si_get_code_chunk_info(si)->get_method()),
-        method_get_descriptor(si_get_code_chunk_info(si)->get_method()), ip ));
+        method->get_class()->get_name()->bytes,
+        method->get_name()->bytes,
+        method->get_descriptor()->bytes, ip ));
 }
 
 void jvmti_jit_prepare_pop_frame() {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Tue Apr 15 04:29:41 2008
@@ -25,6 +25,8 @@
 #define LOG_DOMAIN "jvmti.stack"
 
 #include "open/vm_method_access.h"
+#include "open/jthread.h"
+
 #include "jvmti_direct.h"
 #include "jvmti_utils.h"
 #include "interpreter_exports.h"
@@ -33,7 +35,6 @@
 #include "Class.h"
 #include "cxxlog.h"
 #include "thread_generic.h"
-#include "open/jthread.h"
 #include "suspend_checker.h"
 #include "stack_trace.h"
 #include "stack_iterator.h"
@@ -71,13 +72,14 @@
         }
 
         // hide vm specific stack tail
-        if (0 == strcmp("runImpl", method_get_name(method))) {
-            const char* class_name = class_get_name(method_get_class(method));
+        if (0 == strcmp("runImpl", method->get_name()->bytes)) {
+            const char* class_name = method->get_class()->get_name()->bytes;
 
-            if (0 == strcmp("java/lang/VMStart$MainThread", class_name) ||
-                0 == strcmp("java/lang/Thread", class_name)) {
-                    past_end = true;
-                    return;
+            if (0 == strcmp("java/lang/VMStart$MainThread", class_name)
+                || 0 == strcmp("java/lang/Thread", class_name))
+            {
+                past_end = true;
+                return;
             }
         }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp Tue Apr 15 04:29:41 2008
@@ -443,6 +443,7 @@
 
     for( unsigned index = 0; index < *count; index++ ) {
         TRACE2( "jvmti.break.ss", "Step: " << method
+            << " :" << bytecode_index << "\n      -> "
             << ((*next_step)[index].method)
             << " :" << (*next_step)[index].location << " :"
             << (*next_step)[index].native_location << ", event: "
@@ -628,7 +629,7 @@
     assert(bp);
 
     TRACE2("jvmti.break.ss", "SingleStep occured: "
-        << ((Method*)bp->method)
+        << bp->method
         << " :" << bp->location << " :" << bp->addr);
 
     DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
@@ -710,6 +711,7 @@
                     TRACE2("jvmti.break.ss",
                         "Calling JIT local SingleStep breakpoint callback: "
                         << method << " :" << location << " :" << addr);
+
                     found = true;
 
                     func((jvmtiEnv*)env, jni_env,
@@ -717,8 +719,7 @@
 
                     TRACE2("jvmti.break.ss",
                         "Finished JIT local SingleStep breakpoint callback: "
-                        << ((Method*)method)
-                        << " :" << location << " :" << addr);
+                        << method << " :" << location << " :" << addr);
                 }
             }
 
@@ -909,8 +910,7 @@
                 if (NULL == call_ip)
                 {
                     TRACE2("jvmti.break.ss", "SingleStep IP shifted in prediction to: "
-                        << func
-                        << " :" << next_location << " :" << ip2);
+                        << func << " :" << next_location << " :" << ip2);
                     bc = next_location;
                     ip = ip2;
                 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.cpp Tue Apr 15 04:29:41 2008
@@ -18,13 +18,13 @@
 #include <algorithm>
 
 // global
+#include "cxxlog.h"
 #include "open/gc.h"
 #include "open/vm_gc.h"
-#include "cxxlog.h"
 
 // VM-internal
 #include "environment.h"    // Global_Env
-#include "open/vm_util.h"   // VM_Global_State
+//#include "open/vm_util.h"   // VM_Global_State
 #include "jvmti_direct.h"   // TIEnv
 #include "vm_arrays.h"      // vm_array_size
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp Tue Apr 15 04:29:41 2008
@@ -23,6 +23,7 @@
 
 #include "open/gc.h"
 #include "open/vm_field_access.h"
+#include "open/vm_class_manipulation.h"
 #include "slot.h"
 
 // VM internal headers
@@ -81,7 +82,7 @@
     state->bytes += ti_get_object_size(ti_env, referrer);
     TRACE2("ti.trace", "tracing object " << (void*)referrer);
     Class* ch = ((ManagedObject*)referrer)->vt()->clss;
-    if (class_is_array(ch)) { 
+    if (ch->is_array()) { 
         if (class_is_non_ref_array(ch)) return;
 
         // trace reference array

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp Tue Apr 15 04:29:41 2008
@@ -29,6 +29,7 @@
 #define LOG_DOMAIN "vm.core.classes"
 #include "cxxlog.h"
 
+#include "open/vm_class_manipulation.h"
 #include "Package.h"
 #include "classloader.h"
 #include "jni_utils.h"
@@ -108,12 +109,12 @@
     if (NULL == name) {
         return NULL;
     } 
-    
+
     const char* buf = GetStringUTFChars(jenv, name, NULL);
     ClassLoaderHandle loader = class_loader_lookup(cl);
     Class_Handle clss = class_find_loaded(loader, buf);
     ReleaseStringUTFChars(jenv, name, buf);
-    
+
     return clss ? jni_class_from_handle(jenv, clss) : NULL; 
 }
 
@@ -423,7 +424,7 @@
   (JNIEnv *jenv, jclass, jclass clazz)
 {
     Class_Handle ch = jni_get_class_handle(jenv, clazz);
-    return (jboolean)(class_is_array(ch) ? JNI_TRUE : JNI_FALSE);
+    return (jboolean)(ch->is_array() ? JNI_TRUE : JNI_FALSE);
 }
 
 /*
@@ -450,7 +451,7 @@
     Class_Handle ch = jni_get_class_handle(jenv, fromClazz);
 
     // if primitive class
-    if (class_is_primitive(ch))
+    if (ch->is_primitive())
         return (jboolean)(IsSameObject(jenv, clazz, fromClazz) ? JNI_TRUE : JNI_FALSE);
 
     // if non primitive
@@ -480,7 +481,7 @@
   (JNIEnv *jenv, jclass, jclass clazz)
 {
     Class_Handle ch = jni_get_class_handle(jenv, clazz);
-    return (jboolean)(class_is_primitive(ch) ? JNI_TRUE : JNI_FALSE);
+    return (jboolean)(ch->is_primitive() ? JNI_TRUE : JNI_FALSE);
 }
 
 /*

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp Tue Apr 15 04:29:41 2008
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Alexey V. Varlamov
- * @version $Revision: 1.1.2.3.4.5 $
- */  
 
 /**
  * @file java_lang_reflect_VMReflection.cpp
@@ -33,6 +29,7 @@
 #include "reflection.h"
 #include "open/vm_field_access.h"
 #include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 #include "environment.h"
 #include "exceptions.h"
 #include "vm_strings.h"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp Tue Apr 15 04:29:41 2008
@@ -28,7 +28,8 @@
 
 #include <vector>
 
-#include "open/vm_method_access.h"
+//#include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 #include "open/jthread.h"
 #include "stack_trace.h"
 #include "jni_direct.h"
@@ -65,7 +66,7 @@
 
     // obtain and return class of the frame
     assert(hythread_is_suspend_enabled());
-    return struct_Class_to_jclass((Class*)method_get_class(frame.method));
+    return struct_Class_to_jclass(frame.method->get_class());
 }
 
 inline static bool isReflectionFrame(Method* method, Global_Env* genv) {
@@ -163,7 +164,7 @@
             continue;
 
         // obtain frame class
-        jclass clz = struct_Class_to_java_lang_Class_Handle(method_get_class(method));
+        jclass clz = struct_Class_to_java_lang_Class_Handle(method->get_class());
 
         jenv->SetObjectArrayElement(arr, i, clz);
 
@@ -546,7 +547,7 @@
     Method_Handle method = frames[size-1].method;
     assert(method);
     // skip only for main application thread
-    if (!strcmp(method_get_name(method), "runImpl")
+    if (!strcmp(method->get_name()->bytes, "runImpl")
         && method->get_class()->get_name() == starter_String) {
 
         size --;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp Tue Apr 15 04:29:41 2008
@@ -215,7 +215,7 @@
     // FIXME this behaviour should be evaluated against JSR-175 spec
     Class* enum_type = field_descriptor_to_type(jenv, value.enum_const.type, clss);
     if (enum_type) {
-        if (class_is_enum(enum_type)) {
+        if (enum_type->is_enum()) {
             jobject enum_value = reflection_get_enum_value(jenv, enum_type, value.enum_const.name);
             if (enum_value) {
                 return enum_value;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp Tue Apr 15 04:29:41 2008
@@ -160,17 +160,16 @@
 {
     Class_Handle clss = jni_get_class_handle(jenv, clazz);
     assert(clss);
-    TRACE("get class fields : " << class_get_name(clss));
+    TRACE("get class fields : " << clss->get_name()->bytes);
 
-    unsigned num_fields = class_number_fields(clss);
+    unsigned num_fields = clss->get_number_of_fields();
     unsigned num_res_fields = 0;
 
     unsigned i;
     // Determine the number of elements in the result.
     for (i = 0; i < num_fields; i++) {
-        Field_Handle fh = class_get_field(clss, i);
-        if (field_is_injected(fh)) continue;
-        //if (class_is_array(clss) && 0 == strcmp("length", field_get_name(fh))) continue;
+        Field_Handle fh = clss->get_field(i);
+        if (fh->is_injected()) continue;
         num_res_fields++;
     }
 
@@ -204,16 +203,16 @@
 jobjectArray reflection_get_class_constructors(JNIEnv* jenv, jclass clazz)
 {
     Class_Handle clss = jni_get_class_handle(jenv, clazz);
-    unsigned num_methods = class_get_number_methods(clss);
+    unsigned num_methods = clss->get_number_of_methods();
     unsigned n_consts = 0;
-    TRACE("get class constructors : " << class_get_name(clss));
+    TRACE("get class constructors : " << clss->get_name()->bytes);
 
     unsigned i;
     // Determine the number of elements in the result. Note that fake methods never have the name "<init>".
     for (i = 0; i < num_methods; i++) {
-        Method_Handle mh = class_get_method(clss, i);
-        if (strcmp(method_get_name(mh), "<init>") == 0)
-            n_consts++;             
+        Method_Handle mh = clss->get_method(i);
+        if (strcmp(mh->get_name()->bytes, "<init>") == 0)
+            n_consts++;
     }
 
     // Create result array
@@ -225,8 +224,8 @@
 
     // Fill in the array
     for (i = 0, n_consts = 0; i < num_methods; i++) {
-        Method_Handle mh = class_get_method(clss, i);
-        if (strcmp(method_get_name(mh), "<init>") != 0) continue;
+        Method_Handle mh = clss->get_method(i);
+        if (strcmp(mh->get_name()->bytes, "<init>") != 0) continue;
 
         jobject jconst = reflection_reflect_constructor(jenv, mh);
         if (!jconst){
@@ -243,20 +242,23 @@
 jobjectArray reflection_get_class_methods(JNIEnv* jenv, jclass clazz)
 {
     Class_Handle clss = jni_get_class_handle(jenv, clazz);
-    unsigned num_methods = class_get_number_methods(clss);
+    unsigned num_methods = clss->get_number_of_methods();
     unsigned num_res_methods = 0;
-    TRACE("get class methods : " << class_get_name(clss));
+    TRACE("get class methods : " << clss->get_name()->bytes);
 
     unsigned i;
-    // Determine the number of elements in the result. Note that fake methods never have the name "<init>".
+    // Determine the number of elements in the result.
+    // Note that fake methods never have the name "<init>".
     for (i = 0; i < num_methods; i++) {
-        Method_Handle mh = class_get_method(clss, i);
-        if (strcmp(method_get_name(mh), "<init>") == 0 ||
-                strcmp(method_get_name(mh), "<clinit>") == 0 ||
-                mh->is_fake_method())
+        Method_Handle mh = clss->get_method(i);
+        if (strcmp(mh->get_name()->bytes, "<init>") == 0
+            || strcmp(mh->get_name()->bytes, "<clinit>") == 0
+            || mh->is_fake_method())
+        {
             continue;
+        }
 
-        num_res_methods++;             
+        num_res_methods++;
     }
 
     // Create result array
@@ -268,11 +270,13 @@
     // Fill in the array
     unsigned member_i = 0;
     for (i = 0; i < num_methods; i++) {
-        Method_Handle mh = class_get_method(clss, i);
-        if (strcmp(method_get_name(mh), "<init>") == 0 ||
-                strcmp(method_get_name(mh), "<clinit>") == 0 ||
-                mh->is_fake_method())
+        Method_Handle mh = clss->get_method(i);
+        if (strcmp(mh->get_name()->bytes, "<init>") == 0
+            || strcmp(mh->get_name()->bytes, "<clinit>") == 0
+            || mh->is_fake_method())
+        {
             continue;
+        }
 
         jobject member = reflection_reflect_method(jenv, mh);
         if (!member){
@@ -337,7 +341,7 @@
 
 jobject reflection_get_enum_value(JNIEnv *jenv, Class* enum_type, String* name) 
 {
-    ASSERT(class_is_enum(enum_type), "Requested Class is not ENUM: " 
+    ASSERT(enum_type->is_enum(), "Requested Class is not ENUM: "
         << enum_type->get_name()->bytes);
 
     for (unsigned i=0; i<enum_type->get_number_of_fields(); i++) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp Tue Apr 15 04:29:41 2008
@@ -241,9 +241,9 @@
 
 void st_print_frame(ExpandableMemBlock* buf, StackTraceFrame* stf)
 {
-    const char* cname = class_get_name(method_get_class(stf->method));
-    const char* mname = method_get_name(stf->method);
-    const char* dname = method_get_descriptor(stf->method);
+    const char* cname = stf->method->get_class()->get_name()->bytes;
+    const char* mname = stf->method->get_name()->bytes;
+    const char* dname = stf->method->get_descriptor()->bytes;
     buf->AppendFormatBlock("\tat %s.%s%s", cname, mname, dname);
     const char *file;
     int line;
@@ -321,13 +321,14 @@
                 if (inlined_depth) {
                     for (uint32 i = inlined_depth; i > 0; i--) {
                         Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, i);
-                        fprintf(f, "%s.%s%s\n", class_get_name(method_get_class(real_method)), 
-                                method_get_name(real_method), method_get_descriptor(real_method));
+                        fprintf(f, "%s.%s%s\n", real_method->get_class()->get_name()->bytes, 
+                            real_method->get_name()->bytes, real_method->get_descriptor()->bytes);
                         depth++;
                     }
                 }
             }
-            fprintf(f, "%s.%s%s\n", class_get_name(method_get_class(m)), method_get_name(m), method_get_descriptor(m));
+            fprintf(f, "%s.%s%s\n", m->get_class()->get_name()->bytes,
+                m->get_name()->bytes, m->get_descriptor()->bytes);
         }
         depth++;
         si_goto_previous(si);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp Tue Apr 15 04:29:41 2008
@@ -328,11 +328,10 @@
     stub = jump(stub, (char *)compile_get_compile_me_generic());
     assert(stub - (char *)addr <= STUB_SIZE);
 
-
     char * name;
-    const char * c = class_get_name(method_get_class(method));
-    const char * m = method_get_name(method);
-    const char * d = method_get_descriptor(method);
+    const char* c = method->get_class()->get_name()->bytes;
+    const char* m = method->get_name()->bytes;
+    const char* d = method->get_descriptor()->bytes;
     size_t sz = strlen(c)+strlen(m)+strlen(d)+12;
     name = (char *)STD_MALLOC(sz);
     sprintf(name, "compileme.%s.%s%s", c, m, d);
@@ -347,9 +346,9 @@
     // dump first 10 compileme stubs
     if (dump_stubs && ++done <= 10) {
         char * buf;
-        const char * c = class_get_name(method_get_class(method));
-        const char * m = method_get_name(method);
-        const char * d = method_get_descriptor(method);
+        const char* c = method->get_class()->get_name()->bytes;
+        const char* m = method->get_name()->bytes;
+        const char* d = method->get_descriptor()->bytes;
         size_t sz = strlen(c)+strlen(m)+strlen(d)+12;
         buf = (char *)STD_MALLOC(sz);
         sprintf(buf, "compileme.%s.%s%s", c, m, d);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp Tue Apr 15 04:29:41 2008
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Intel, Evgueni Brevnov
- * @version $Revision: 1.1.2.2.4.4 $
- */  
 
 #define LOG_DOMAIN "vm.helpers"
 #include "cxxlog.h"
@@ -237,12 +233,12 @@
     stub = jump(stub, (char *)compile_get_compile_me_generic());
     assert(stub - (char *)addr <= STUB_SIZE);
 
-    char * name;
-    const char * c = class_get_name(method_get_class(method));
-    const char * m = method_get_name(method);
-    const char * d = method_get_descriptor(method);
-    size_t sz = strlen(c)+strlen(m)+strlen(d)+12;
-    name = (char *)STD_MALLOC(sz);
+    char* name;
+    const char * c = method->get_class()->get_name()->bytes;
+    const char * m = method->get_name()->bytes;
+    const char * d = method->get_descriptor()->bytes;
+    size_t sz = strlen(c) + strlen(m) + strlen(d) + 12;
+    name = (char*)STD_MALLOC(sz);
     sprintf(name, "compileme.%s.%s%s", c, m, d);
     compile_add_dynamic_generated_code_chunk(name, true, addr, STUB_SIZE);
 
@@ -255,9 +251,9 @@
     // dump first 10 compileme stubs
     if (dump_stubs && ++done <= 10) {
         char * buf;
-        const char * c = class_get_name(method_get_class(method));
-        const char * m = method_get_name(method);
-        const char * d = method_get_descriptor(method);
+        const char * c = method->get_class()->get_name()->bytes;
+        const char * m = method->get_name()->bytes;
+        const char * d = method->get_descriptor()->bytes;
         size_t sz = strlen(c)+strlen(m)+strlen(d)+12;
         buf = (char *)STD_MALLOC(sz);
         sprintf(buf, "compileme.%s.%s%s", c, m, d);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp Tue Apr 15 04:29:41 2008
@@ -29,7 +29,7 @@
 
 #include "open/types.h"
 #include "open/gc.h"
-#include "open/vm_util.h"
+#include "open/vm_class_manipulation.h"
 
 #include "environment.h"
 #include "Class.h"
@@ -1099,8 +1099,7 @@
 
 /* ? 03/07/30: temporary interface change!!! */
 void *vm_helper_get_addr_optimized(VM_RT_SUPPORT f, Class_Handle c) {
-    Class *clss = (Class*) c;
-    if (clss == NULL)
+    if (c == NULL)
     {
         return vm_helper_get_addr(f);
     }
@@ -1113,7 +1112,7 @@
             return vm_helper_get_addr(f);
         // break;// remark #111: statement is unreachable
     case VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE:
-        if (class_is_finalizable(c))
+        if (c->has_finalizer())
             return getaddress__vm_alloc_java_object_resolved_using_vtable_and_size_naked();
         else
             return vm_helper_get_addr(f);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp Tue Apr 15 04:29:41 2008
@@ -322,7 +322,7 @@
 
     // Test whether the first object is of type [C.
     s = mov(s,  ebx_opnd,  M_Base_Opnd(esi_reg, object_get_vtable_offset())) ;     // mov ebx, [esi] ; src->vt
-    s = alu(s, cmp_opc,  ebx_opnd,  Imm_Opnd((int)class_get_vtable(env->ArrayOfChar_Class))); // cmp ebx, vtable_of_char_array
+    s = alu(s, cmp_opc,  ebx_opnd,  Imm_Opnd((int)(env->ArrayOfChar_Class->get_vtable()))); // cmp ebx, vtable_of_char_array
     s = branch32(s, Condition_NZ,  Imm_Opnd(0x0));
     patch[p_c++] =  s - 4 ;
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.cpp Tue Apr 15 04:29:41 2008
@@ -18,6 +18,8 @@
  * @author Mikhail Loenko, Vladimir Molotkov
  */  
 
+#include "open/vm_class_loading.h"
+
 #include "verifier.h"
 #include "context_base.h"
 namespace CPVerifier {
@@ -340,11 +342,12 @@
         if( !class_constraints ) return;
 
         vf_ClassLoaderData_t *cl_data;
-        classloader_handler currentClassLoader = class_get_class_loader(k_class);
+        ClassLoaderHandle currentClassLoader = class_get_class_loader(k_class);
 
         // lock data modification
-        cl_acquire_lock( currentClassLoader );
-        cl_data = (vf_ClassLoaderData_t*)cl_get_verify_data_ptr( currentClassLoader );
+        class_loader_lock( currentClassLoader );
+        cl_data =
+            (vf_ClassLoaderData_t*)class_loader_get_verifier_data_ptr( currentClassLoader );
 
         // create class loader data
         if( cl_data == NULL ) {
@@ -379,8 +382,8 @@
         }
 
         // unlock data modification
-        cl_set_verify_data_ptr( currentClassLoader, cl_data );
-        cl_release_lock( currentClassLoader );
+        class_loader_set_verifier_data_ptr( currentClassLoader, cl_data );
+        class_loader_unlock( currentClassLoader );
         return;
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h Tue Apr 15 04:29:41 2008
@@ -23,6 +23,10 @@
 
 #include <assert.h>
 #include <string.h>
+
+#include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
+
 #include "verifier.h"
 #include "memory.h"
 #include "instr_props.h"
@@ -33,7 +37,7 @@
 
     class SharedClasswideData {
     public:
-        SharedClasswideData(class_handler _klass) :
+        SharedClasswideData(Class_Handle _klass) :
           class_constraints(0),
               k_class(_klass),
               k_major(class_get_version(_klass)),
@@ -53,7 +57,7 @@
           Memory constraintPool;
 
           //class handler for the current class
-          class_handler  k_class;
+          Class_Handle k_class;
 
           //major version of current class
           unsigned short  k_major;
@@ -97,16 +101,16 @@
         friend class vf_TypePool;
 
         //class handler for the current class
-        class_handler  k_class;
+        Class_Handle k_class;
 
         //major version of current class
         unsigned short  k_major;
 
         //method handler for the method being verified
-        method_handler m_method;
+        Method_Handle m_method;
 
         //method's bytecode
-        unsigned char  *m_bytecode;
+        Byte*         m_bytecode;
 
         //legth of the code in the method being verified
         unsigned       m_code_length;
@@ -176,15 +180,15 @@
         }
 
         //init method-wide data
-        void init(method_handler _m_method) {
+        void init(Method_Handle _m_method) {
             //store method's parameters
             //TODO: it might be mot slower not to store them
             m_method = _m_method;
-            m_max_locals = method_get_max_local( m_method );
-            m_max_stack = method_get_max_stack( m_method );
-            m_code_length = method_get_bytecode_length( m_method );
-            m_handlecount = method_get_exc_handler_number( m_method );
-            m_bytecode = method_get_bytecode( m_method );
+            m_max_locals = method_get_max_locals(m_method);
+            m_max_stack = method_get_max_stack(m_method);
+            m_code_length = method_get_bytecode_length(m_method);
+            m_handlecount = method_get_exc_handler_number(m_method);
+            m_bytecode = const_cast<Byte*>(method_get_bytecode(m_method));
 
             m_is_constructor = !strcmp(method_get_name(m_method), "<init>") 
                 && class_get_super_class(k_class);
@@ -279,8 +283,7 @@
 
 
     //check conatraints stored in the classloader data. force loading if necessary
-    vf_Result
-        vf_force_check_constraint(class_handler klass,
+    vf_Result vf_force_check_constraint(Class_Handle klass,
         vf_TypeConstraint *constraint);
 
 } // namespace CPVerifier

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp Tue Apr 15 04:29:41 2008
@@ -16,15 +16,20 @@
  */
 /** 
  * @author Mikhail Loenko, Vladimir Molotkov
- */  
+ */
 
 #include <assert.h>
+
+#include "open/vm_field_access.h"
+#include "open/vm_method_access.h"
+#include "class_interface.h"
+
 #include "tpool.h"
 #include "context_base.h"
 
 namespace CPVerifier {
 
-    vf_TypePool::vf_TypePool(SharedClasswideData *_classwide, class_handler _klass, unsigned table_incr)
+    vf_TypePool::vf_TypePool(SharedClasswideData *_classwide, Class_Handle _klass, unsigned table_incr)
         : classwide(_classwide), tableIncr(table_incr),
         validTypesTableMax(0), validTypesTableSz(1), validTypes(0)
     {
@@ -34,7 +39,7 @@
             const_arrayref_of_object = const_this = SM_NONE;
 
         k_class = _klass;
-        k_cp_length = class_get_cp_size( k_class );
+        k_cp_length = class_cp_get_size( k_class );
     }
 
     /*
@@ -233,7 +238,7 @@
 
             if( to_type->cls && to_type->cls != CLASS_NOT_LOADED ) {
                 //if to is loaded and it is an interface, treat it as an object
-                if( class_is_interface_( to_type->cls ) ) {
+                if(class_is_interface(to_type->cls)) {
                     return true;
                 }
             } else {
@@ -260,7 +265,7 @@
     int vf_TypePool::checkSuperAndPackage(SmConstant expected_ref) {
         //check that expected ref is a super of 'this'
         vf_ValidType *expected_type = getVaildType(expected_ref.getReferenceIdx());
-        class_handler &referred = expected_type->cls;
+        Class_Handle& referred = expected_type->cls;
 
         if( !referred ) {
             //try to get class
@@ -273,7 +278,7 @@
 
         if( referred == CLASS_NOT_LOADED ) {
             //referred class can't be resolved ==> still might be a super class
-            class_handler k = class_is_extending_class(k_class, expected_type->name);
+            Class_Handle k = class_get_extended_class(k_class, expected_type->name);
 
             if( k ) {
                 referred = k;
@@ -294,7 +299,7 @@
 
         //check further
         //check that they are in different packages and method is protected
-        method_handler method = class_resolve_method(k_class, method_idx);
+        Method_Handle method = class_resolve_method(k_class, method_idx);
 
         if (!method || method_is_static(method)) {
             //it's not a VerifyError
@@ -314,7 +319,7 @@
 
         //check further
         //check that they are in different packages and method is protected
-        field_handler field = class_resolve_nonstatic_field(k_class, field_idx);
+        Field_Handle field = class_resolve_nonstatic_field(k_class, field_idx);
 
         if (!field) {
             //it's not a VerifyError
@@ -352,7 +357,7 @@
     SmConstant vf_TypePool::cpool_get_ldcarg(unsigned short cp_idx) {
         if( cp_idx >= k_cp_length || !cp_idx ) return SM_BOGUS;
 
-        switch (class_get_cp_tag( k_class, cp_idx ) ) {
+        switch (class_cp_get_tag( k_class, cp_idx ) ) {
         case _CONSTANT_String: 
             return sm_get_const_string();
 
@@ -375,7 +380,7 @@
     SmConstant vf_TypePool::cpool_get_ldc2arg(unsigned short cp_idx) {
         if( cp_idx >= k_cp_length || !cp_idx ) return SM_BOGUS;
 
-        switch (class_get_cp_tag( k_class, cp_idx ) ) {
+        switch (class_cp_get_tag( k_class, cp_idx ) ) {
         case _CONSTANT_Double: 
             return SM_DOUBLE;
 
@@ -389,17 +394,17 @@
 
 
     int vf_TypePool::cpool_is_reftype(unsigned short cp_idx) {
-        return cp_idx && cp_idx < k_cp_length && class_get_cp_tag( k_class, cp_idx ) == _CONSTANT_Class;
+        return cp_idx && cp_idx < k_cp_length && class_cp_get_tag( k_class, cp_idx ) == _CONSTANT_Class;
     }
 
 
     int vf_TypePool::cpool_get_class(unsigned short cp_idx, SmConstant *ref, int expected_dim) {
         if( !cpool_is_reftype(cp_idx) ) return false;
 
-        unsigned short name_idx = class_get_cp_class_name_index(k_class, cp_idx);
+        unsigned short name_idx = class_cp_get_class_name_index(k_class, cp_idx);
         if( name_idx >= k_cp_length ) return false;
 
-        const char* name = class_get_cp_utf8_bytes( k_class, name_idx );
+        const char* name = class_cp_get_utf8_bytes( k_class, name_idx );
 
         //validate dimensions
         int ptr = 0;
@@ -425,10 +430,10 @@
         assert(ref);
         if( !cpool_is_reftype(cp_idx) ) return false;
 
-        unsigned short name_idx = class_get_cp_class_name_index(k_class, cp_idx);
+        unsigned short name_idx = class_cp_get_class_name_index(k_class, cp_idx);
         if( name_idx >= k_cp_length ) return false;
 
-        const char* name = class_get_cp_utf8_bytes( k_class, name_idx );
+        const char* name = class_cp_get_utf8_bytes( k_class, name_idx );
         int len = (int)strlen(name);
 
 
@@ -463,25 +468,25 @@
 
     int vf_TypePool::cpool_get_field(unsigned short cp_idx, SmConstant *ref, SmConstant *value) {
         //check it is a field
-        if( !cp_idx || cp_idx >= k_cp_length || class_get_cp_tag( k_class, cp_idx ) != _CONSTANT_Fieldref ) {
+        if( !cp_idx || cp_idx >= k_cp_length || class_cp_get_tag( k_class, cp_idx ) != _CONSTANT_Fieldref ) {
             return false;
         }
 
-        unsigned short class_idx = class_get_cp_ref_class_index( k_class, cp_idx );
+        unsigned short class_idx = class_cp_get_ref_class_index( k_class, cp_idx );
         if( !cpool_get_class(class_idx, ref) ) return false;
 
-        unsigned short name_and_type_idx = class_get_cp_ref_name_and_type_index( k_class, cp_idx );
-        if( !name_and_type_idx || name_and_type_idx >= k_cp_length || class_get_cp_tag( k_class, name_and_type_idx ) != _CONSTANT_NameAndType ) return false;
+        unsigned short name_and_type_idx = class_cp_get_ref_name_and_type_index( k_class, cp_idx );
+        if( !name_and_type_idx || name_and_type_idx >= k_cp_length || class_cp_get_tag( k_class, name_and_type_idx ) != _CONSTANT_NameAndType ) return false;
 
         //TODO: do we need this check?
         //unsigned short name_idx = class_get_cp_name_index( k_class, name_and_type_idx );
-        //if( !name_idx || name_idx >= k_cp_length || class_get_cp_tag( k_class, name_idx ) != _CONSTANT_Utf8 ) return false;
+        //if( !name_idx || name_idx >= k_cp_length || class_cp_get_tag( k_class, name_idx ) != _CONSTANT_Utf8 ) return false;
 
         //get filed type
-        unsigned short type_idx = class_get_cp_descriptor_index( k_class, name_and_type_idx );
-        if( !type_idx || type_idx >= k_cp_length || class_get_cp_tag( k_class, type_idx ) != _CONSTANT_Utf8 ) return false;
+        unsigned short type_idx = class_cp_get_descriptor_index( k_class, name_and_type_idx );
+        if( !type_idx || type_idx >= k_cp_length || class_cp_get_tag( k_class, type_idx ) != _CONSTANT_Utf8 ) return false;
 
-        const char *type = class_get_cp_utf8_bytes( k_class, type_idx );
+        const char *type = class_cp_get_utf8_bytes( k_class, type_idx );
         *value = get_type(type);
 
         return true;
@@ -493,11 +498,11 @@
             ClassConstantPoolTags expected_tag = opcode == OP_INVOKEINTERFACE ? _CONSTANT_InterfaceMethodref : _CONSTANT_Methodref;
 
             //check it is a method
-            if( !cp_idx || cp_idx >= k_cp_length || class_get_cp_tag( k_class, cp_idx ) != expected_tag ) {
+            if( !cp_idx || cp_idx >= k_cp_length || class_cp_get_tag( k_class, cp_idx ) != expected_tag ) {
                 return false;
             }
 
-            unsigned short class_idx = class_get_cp_ref_class_index( k_class, cp_idx );
+            unsigned short class_idx = class_cp_get_ref_class_index( k_class, cp_idx );
             if( opcode == OP_INVOKEVIRTUAL || opcode == OP_INVOKESPECIAL ) {
                 if( !cpool_get_class(class_idx, objectref) ) return false;
             } else {
@@ -505,18 +510,18 @@
                 (*objectref) = sm_get_const_object();
             }
 
-            unsigned short name_and_type_idx = class_get_cp_ref_name_and_type_index( k_class, cp_idx );
-            if( !name_and_type_idx || name_and_type_idx >= k_cp_length || class_get_cp_tag( k_class, name_and_type_idx ) != _CONSTANT_NameAndType ) return false;
+            unsigned short name_and_type_idx = class_cp_get_ref_name_and_type_index( k_class, cp_idx );
+            if( !name_and_type_idx || name_and_type_idx >= k_cp_length || class_cp_get_tag( k_class, name_and_type_idx ) != _CONSTANT_NameAndType ) return false;
 
-            *name_idx = class_get_cp_name_index( k_class, name_and_type_idx );
+            *name_idx = class_cp_get_name_index( k_class, name_and_type_idx );
             //TODO: do we need this check?
-            if( !(*name_idx) || *name_idx >= k_cp_length || class_get_cp_tag( k_class, *name_idx ) != _CONSTANT_Utf8 ) return false;
+            if( !(*name_idx) || *name_idx >= k_cp_length || class_cp_get_tag( k_class, *name_idx ) != _CONSTANT_Utf8 ) return false;
 
             //get filed type or function args & rettype
-            unsigned short type_idx = class_get_cp_descriptor_index( k_class, name_and_type_idx );
-            if( !type_idx || type_idx >= k_cp_length || class_get_cp_tag( k_class, type_idx ) != _CONSTANT_Utf8 ) return false;
+            unsigned short type_idx = class_cp_get_descriptor_index( k_class, name_and_type_idx );
+            if( !type_idx || type_idx >= k_cp_length || class_cp_get_tag( k_class, type_idx ) != _CONSTANT_Utf8 ) return false;
 
-            (*state) = class_get_cp_utf8_bytes( k_class, type_idx );
+            (*state) = class_cp_get_utf8_bytes( k_class, type_idx );
             return true;
         }
 
@@ -579,7 +584,7 @@
         }
 
         int vf_TypePool::cpool_method_is_constructor_call(unsigned short name_idx) {
-            return !strcmp(class_get_cp_utf8_bytes( k_class, name_idx ), "<init>");
+            return !strcmp(class_cp_get_utf8_bytes( k_class, name_idx ), "<init>");
         }
 
 } // namespace CPVerifier

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.h Tue Apr 15 04:29:41 2008
@@ -21,6 +21,7 @@
 #ifndef __TPOOL_H_
 #define __TPOOL_H_
 
+#include "open/vm_class_manipulation.h"
 
 #include "verifier.h"
 #include "stackmap.h"
@@ -48,11 +49,11 @@
 
 
     struct vf_ValidType {
-        class_handler cls;      //class handler
-        const char*   name;     //name of the class
+        Class_Handle cls;      //class handler
+        const char*  name;     //name of the class
     };
 
-#define CLASS_NOT_LOADED ((class_handler)-1)
+#define CLASS_NOT_LOADED ((Class_Handle)-1)
 
     class SharedClasswideData;
 
@@ -64,7 +65,7 @@
     class vf_TypePool {
 
     public:
-        vf_TypePool(SharedClasswideData *_classwide, class_handler _klass, unsigned table_incr);
+        vf_TypePool(SharedClasswideData *_classwide, Class_Handle _klass, unsigned table_incr);
 
         ~vf_TypePool() {
             if( validTypes ) tc_free(validTypes);
@@ -107,7 +108,7 @@
             return validTypes + index;
         }
 
-        class_handler sm_get_handler(SmConstant type) {
+        Class_Handle sm_get_handler(SmConstant type) {
             unsigned index = type.getReferenceIdx();
             return getVaildType(index)->cls;
         }
@@ -245,7 +246,7 @@
         SharedClasswideData *classwide;
 
         //class handler of the class being verified
-        class_handler k_class;
+        Class_Handle k_class;
 
         //constantpool length
         unsigned k_cp_length;
@@ -281,8 +282,8 @@
 
     };
 
-    class_handler vf_resolve_class( class_handler k_class, const char *name, bool need_load);
-    int vf_is_extending(class_handler from, class_handler to);
+    Class_Handle vf_resolve_class(Class_Handle k_class, const char* name, bool need_load);
+    int vf_is_extending(Class_Handle from, Class_Handle to);
 
 } // namespace CPVerifier
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp Tue Apr 15 04:29:41 2008
@@ -29,6 +29,10 @@
 #include "../java6/context_6.h"
 #include "time.h"
 
+#include "open/vm_class_manipulation.h"
+#include "open/vm_method_access.h"
+#include "open/vm_class_loading.h"
+
 using namespace CPVerifier;
 using namespace CPVerifier_5;
 using namespace CPVerifier_6;
@@ -44,7 +48,7 @@
 * "class A must be assignable to class B" is recorded into the classloader's data
 */
 vf_Result
-vf_verify5_class( class_handler klass, unsigned verifyAll, char **error )
+vf_verify5_class(Class_Handle klass, unsigned verifyAll, char** error)
 {
     int index;
     vf_Result result = VF_OK;
@@ -59,9 +63,9 @@
 
         if (result != VF_OK) {
             *error = &(err_message[0]);
-            method_handler method = class_get_method( klass, index );
-            sprintf(*error, "%s/%s%s, pass: %d, instr: %d, reason: %s", class_get_name( klass ), method_get_name( method ), 
-                method_get_descriptor( method ), context.pass, context.processed_instruction, context.error_message );
+            Method_Handle method = class_get_method(klass, index);
+            sprintf(*error, "%s/%s%s, pass: %d, instr: %d, reason: %s", class_get_name(klass), method_get_name(method),
+                method_get_descriptor(method), context.pass, context.processed_instruction, context.error_message);
             break;
         }
     }
@@ -83,7 +87,7 @@
 * "class A must be assignable to class B" is recorded into the classloader's data
 */
 vf_Result
-vf_verify6_class( class_handler klass, unsigned verifyAll, char **error )
+vf_verify6_class(Class_Handle klass, unsigned verifyAll, char **error )
 {
     int index;
     vf_Result result = VF_OK;
@@ -97,7 +101,7 @@
 
     // Verify method
     for( index = 0; index < class_get_method_number( klass ); index++ ) {
-        method_handler method = class_get_method( klass, index );
+        Method_Handle method = class_get_method( klass, index );
 
         //try Java6 verifying (using StackMapTable attribute)
         if( !skip_java6_verification_attempt || method_get_stackmaptable(method) ) {
@@ -146,7 +150,7 @@
 * "class A must be assignable to class B" is recorded into the classloader's data
 */
 vf_Result
-vf_verify_class( class_handler klass, unsigned verifyAll, char **error ) {
+vf_verify_class( Class_Handle klass, unsigned verifyAll, char **error ) {
     return class_get_version(klass) >= 50 ? vf_verify6_class(klass, verifyAll, error) : vf_verify5_class(klass, verifyAll, error);
 }
 
@@ -156,15 +160,15 @@
 * If some class is not loaded yet -- load it now
 */
 vf_Result
-vf_verify_class_constraints( class_handler klass, unsigned verifyAll, char **error )
+vf_verify_class_constraints(Class_Handle klass, unsigned verifyAll, char** error)
 {
 
     // get class loader of current class
-    classloader_handler class_loader = class_get_class_loader( klass );
+    ClassLoaderHandle class_loader = class_get_class_loader(klass);
 
     // get class loader verify data
     vf_ClassLoaderData_t *cl_data =
-        (vf_ClassLoaderData_t*)cl_get_verify_data_ptr( class_loader );
+        (vf_ClassLoaderData_t*)class_loader_get_verifier_data_ptr(class_loader);
 
     // check class loader data
     if( cl_data == NULL ) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/vf_resolve.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/vf_resolve.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/vf_resolve.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/vf_resolve.cpp Tue Apr 15 04:29:41 2008
@@ -16,7 +16,10 @@
  */
 /** 
  * @author Mikhail Loenko, Vladimir Molotkov
- */  
+ */
+
+#include "open/vm_class_manipulation.h"
+#include "open/vm_class_loading.h"
 
 #include "verifier.h"
 #include "context_base.h"
@@ -28,24 +31,23 @@
     * Function checkes constraint for given class.
     * Function loads classes if it's needed.
     */
-    vf_Result
-        vf_force_check_constraint( class_handler klass, 
-        vf_TypeConstraint *constraint )    // class constraint
+    vf_Result vf_force_check_constraint(Class_Handle klass,
+        vf_TypeConstraint* constraint)    // class constraint
     {
         // get target class
-        class_handler target = vf_resolve_class( klass, constraint->target, true );
+        Class_Handle target = vf_resolve_class( klass, constraint->target, true );
         if( !target ) {
             return VF_ErrorLoadClass;
         }
 
         //no need to load the source
-        if( class_is_interface_(target) ){
+        if(class_is_interface(target)){
             return VF_OK;
         }
 
 
         // get stack reference class
-        class_handler source = vf_resolve_class( klass, constraint->source, true );
+        Class_Handle source = vf_resolve_class( klass, constraint->source, true );
         if( !source ) {
             return VF_ErrorLoadClass;
         }
@@ -61,7 +63,7 @@
     /**
     * Returns true if 'from' is (not necessarily directly) extending 'to'
     */
-    int vf_is_extending(class_handler from, class_handler to) {
+    int vf_is_extending(Class_Handle from, Class_Handle to) {
         while (from) {
             if( from == to ) return true;
             from = class_get_super_class(from);
@@ -72,17 +74,19 @@
     /**
     * Function receives class by given class name, loads it if it's needed.
     */
-    class_handler
-        vf_resolve_class( class_handler k_class,    // current class
+    Class_Handle
+        vf_resolve_class( Class_Handle k_class,    // current class
         const char *name,         // resolved class name
         bool need_load)      // load flag
     {
-        class_handler result;
+        Class_Handle result;
 
         // get class loader
-        classloader_handler class_loader = class_get_class_loader( k_class );
+        ClassLoaderHandle class_loader = class_get_class_loader( k_class );
 
-        result = need_load ? cl_load_class( class_loader, name ) : cl_get_class( class_loader, name );
+        result = need_load ?
+            class_loader_load_class( class_loader, name )
+            : class_loader_lookup_class( class_loader, name );
 
         //we assume that this pre-defined constant is not a valid class-handler
         assert(CLASS_NOT_LOADED != result);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp Tue Apr 15 04:29:41 2008
@@ -18,6 +18,8 @@
  * @author Mikhail Loenko, Vladimir Molotkov
  */  
 
+#include "open/vm_method_access.h"
+
 #include "verifier.h"
 #include "context_5.h"
 namespace CPVerifier_5 {
@@ -404,7 +406,7 @@
         return error(VF_ErrorCodeEnd, "control went out of method bounds");
     }
 
-    vf_Result vf_Context_5::verify_method(method_handler method) {
+    vf_Result vf_Context_5::verify_method(Method_Handle method) {
         vf_Result tcr;
 
         //nothing to verify

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h Tue Apr 15 04:29:41 2008
@@ -43,7 +43,7 @@
               stackmapattr_calculation = false;
           }
 
-          vf_Result verify_method(method_handler method);
+          vf_Result verify_method(Method_Handle method);
     protected:
         // various flags for all the method's bytecode instructions
         InstrProps props;
@@ -63,7 +63,7 @@
         static const short MARK_SUBROUTINE_DONE = -1;
 
         //init method-wide data
-        void init(method_handler _m_method) {
+        void init(Method_Handle _m_method) {
             vf_Context_x<vf_Context_5, WorkmapElement, _WorkmapElement, StackmapElement>::init(_m_method);
             stack.init();
             props.init(mem, m_code_length);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp Tue Apr 15 04:29:41 2008
@@ -18,13 +18,16 @@
  * @author Mikhail Loenko, Vladimir Molotkov
  */  
 
+#include "open/vm_method_access.h"
+
 #include "context_6.h"
+
 namespace CPVerifier_6 {
 
     /*
     * Do Java6 verification of a method
     */
-    vf_Result vf_Context_6::verify_method(method_handler method) {
+    vf_Result vf_Context_6::verify_method(Method_Handle method) {
         vf_Result tcr;
 
         //nothing to verify

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h Tue Apr 15 04:29:41 2008
@@ -40,13 +40,13 @@
         vf_Context_6(SharedClasswideData &classwide) :
           vf_Context_x<vf_Context_6, WorkmapElement, _WorkmapElement, StackmapElement>(classwide) {}
 
-          vf_Result verify_method(method_handler method);
+          vf_Result verify_method(Method_Handle method);
     protected:
         // stackmaps for instructions
         InstrPropsBase props;
 
         //init method-wide data
-        void init(method_handler _m_method) {
+        void init(Method_Handle _m_method) {
             vf_Context_x<vf_Context_6, WorkmapElement, _WorkmapElement, StackmapElement>::init(_m_method);
             props.init(mem, m_code_length);
         }



Mime
View raw message