harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r648211 [1/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
Author: mcfirst
Date: Tue Apr 15 04:29:41 2008
New Revision: 648211

URL: http://svn.apache.org/viewvc?rev=648211&view=rev
Log:
Moving verifier to common VM external interface, HARMONY-5649

Modified:
    harmony/enhanced/drlvm/trunk/make/vm/verifier.xml
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp
    harmony/enhanced/drlvm/trunk/vm/include/jit_import.h
    harmony/enhanced/drlvm/trunk/vm/include/jni_types.h
    harmony/enhanced/drlvm/trunk/vm/include/open/gc.h
    harmony/enhanced/drlvm/trunk/vm/include/open/types.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_info.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_loading.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_manipulation.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_field_access.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_utils.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/verifier.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/native_overrides.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_tags.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/vf_resolve.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/recompute.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/write_attr.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_class_interface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/x_verifier/x_verifier.h

Modified: harmony/enhanced/drlvm/trunk/make/vm/verifier.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/make/vm/verifier.xml?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/make/vm/verifier.xml (original)
+++ harmony/enhanced/drlvm/trunk/make/vm/verifier.xml Tue Apr 15 04:29:41 2008
@@ -35,6 +35,7 @@
                     <include name="verifier-3363/java5/*.cpp" />
                     <include name="verifier-3363/java6/*.cpp" />
                 </fileset>
+	            <defineset define="BUILDING_VM" />
             </compiler>
         </make-native>
     </target>

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Tue Apr 15 04:29:41 2008
@@ -29,6 +29,7 @@
 #include "em_intf.h"
 #include "open/vm.h"
 #include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 #include "ini.h"
 #include "cxxlog.h"
 

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp Tue Apr 15 04:29:41 2008
@@ -29,7 +29,7 @@
 
 #include <sstream>
 #include "open/vm_method_access.h"
-#include "open/vm.h"
+#include "open/vm_class_manipulation.h"
 #include "jit_intf.h"
 #include "port_mutex.h"
 

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp Tue Apr 15 04:29:41 2008
@@ -28,7 +28,7 @@
 #include <assert.h>
 #include <sstream>
 #include "open/vm_method_access.h"
-#include "open/vm.h"
+#include "open/vm_class_manipulation.h"
 #include "jit_intf.h"
 #include "port_mutex.h"
 

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/MTable.cpp Tue Apr 15 04:29:41 2008
@@ -23,7 +23,8 @@
 #include <assert.h>
 #include <algorithm>
 #include "open/vm_method_access.h"
-#include "jit_import.h"
+#include "open/vm_class_manipulation.h"
+//#include "jit_import.h"
 
 MTable::~MTable() {
     for (FiltersQueue::const_iterator it = methodFilters.begin(), end = methodFilters.end(); it!=end; ++it) {

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp Tue Apr 15 04:29:41 2008
@@ -31,7 +31,8 @@
 
 #include "port_threadunsafe.h"
 #include "port_atomic.h"
-#include "open/vm.h"
+#include "open/vm_class_manipulation.h"
+#include "open/vm.h" // for vtable_get_class
 
 #define LOG_DOMAIN "em"
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp Tue Apr 15 04:29:41 2008
@@ -21,6 +21,7 @@
 
 #include "gc_common.h"
 #include "open/vm_field_access.h"
+#include "open/vm_class_manipulation.h"
 #include "../finalizer_weakref/finalizer_weakref.h"
 
 /* Setter functions for the gc class property field. */
@@ -78,7 +79,7 @@
 
 #ifndef BUILD_IN_REFERENT
   if (is_reference != NOT_REFERENCE) {
-    int offset = class_get_referent_offset(ch);
+    unsigned int offset = class_get_referent_offset(ch);
     unsigned int gc_referent_offset = get_gc_referent_offset();
     if (gc_referent_offset == 0) {
       set_gc_referent_offset(offset);
@@ -158,7 +159,7 @@
     Class_Handle array_element_class = class_get_array_element_class(ch);
     gc_set_prop_array(gcvt);
     
-    gcvt->array_elem_size = class_element_size(ch);
+    gcvt->array_elem_size = class_get_array_element_size(ch);
     unsigned int the_offset = vector_first_element_offset_unboxed(array_element_class);
     gcvt->array_first_elem_offset = the_offset;
   

Modified: harmony/enhanced/drlvm/trunk/vm/include/jit_import.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jit_import.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jit_import.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jit_import.h Tue Apr 15 04:29:41 2008
@@ -173,14 +173,6 @@
 resolve_static_field(Compile_Handle h, Class_Handle ch, unsigned idx, unsigned putfield);
 
 /**
- * Resolve a method.
- * The <code>idx</code> parameter is interpreted as a constant pool index for JVM.
- */ 
-VMEXPORT Method_Handle 
-resolve_method(Compile_Handle h, Class_Handle ch, unsigned idx);
-
-
-/**
  * Resolve a method. Same as resolve_method() but the VM checks 
  * that the method can be used for a virtual dispatch.
  * The <code>idx</code> parameter is interpreted as a constant pool index for JVM.

Modified: harmony/enhanced/drlvm/trunk/vm/include/jni_types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jni_types.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jni_types.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jni_types.h Tue Apr 15 04:29:41 2008
@@ -297,7 +297,6 @@
     jobject  l;
 } jvalue;
 
-struct _jfieldID;
 /**
  * Type which describes an identfier of a field inside of class
  *
@@ -305,7 +304,7 @@
  * field inside of the class described by #jclass.
  */
 typedef struct _jfieldID* jfieldID;
-struct _jmethodID;
+
 /**
  * Type which describes an identfier of a method inside of class
  *

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/gc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/gc.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/gc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/gc.h Tue Apr 15 04:29:41 2008
@@ -938,7 +938,7 @@
  * \section gc_finalization_and_weak_refs_requirements Adopted Requirements
  *
  * Current implementation of weak references places the following requirements
- * \li All reference objects must have exactly one non-regulur object reference,
+ * \li All reference objects must have exactly one non-regular object reference,
  *     and this reference must be at the same offset for references of all types.
  *     GC calls <code>class_is_reference()</code> to find out whether the class represents
  *     weak reference and finds out the referent offset by calling VM function 

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/types.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/types.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/types.h Tue Apr 15 04:29:41 2008
@@ -55,6 +55,13 @@
     VM_DATA_TYPE_END     = ')'         // For the iterator
 } VM_Data_Type; //VM_Data_Type
 
+typedef
+enum WeakReferenceType {
+    NOT_REFERENCE = 0,
+    WEAK_REFERENCE,
+    SOFT_REFERENCE,
+    PHANTOM_REFERENCE
+} WeakReferenceType;
 
 /**
  * Handles for Various VM Structures.

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Tue Apr 15 04:29:41 2008
@@ -72,98 +72,25 @@
  * Begin class-related functions.
  */
 
-/** 
- * @return A handle for the <code>Object</code> class. For Java applications, it's
- *         <code>java.lang.Object</code>.
- */ 
-VMEXPORT Class_Handle get_system_object_class();
-
-/** 
- * @return  A handle for the <code>Class</code> class. For Java applications, it's
- *          <code>java.lang.Class</code>.
- */
-VMEXPORT Class_Handle get_system_class_class();
-
-/** 
- * @return  A handle for the string class. For Java applications, it's
- *          java.lang.String.
- */
- 
-VMEXPORT Class_Handle get_system_string_class();
-
-/** 
- * Find already loaded class of a given name. 
- *
- * @return <code>NULL</code> if a class is not loaded.
- */
-VMEXPORT Class_Handle
-class_lookup_class_by_name_using_bootstrap_class_loader(const char *name);
-
-/** 
- * The following three functions will be eventually renamed to
- * \arg <code>class_is_final</code>
- * \arg <code>class_is_abstract</code>
- * \arg <code>class_is_interface</code>
- * but right now that would conflict 
- * with the names of some internal macros.
- */
-
-VMEXPORT Boolean class_is_final(Class_Handle ch);
-VMEXPORT Boolean class_is_abstract(Class_Handle ch);
-VMEXPORT BOOLEAN class_is_interface(Class_Handle ch);
-
-/**
- * @return <code>TRUE</code> if the class is likely to be used as an exception object.
- *         This is a hint only. If the result is <code>FALSE</code>, the class may still
- *         be used for exceptions but it is less likely.
- */
-VMEXPORT Boolean class_hint_is_exceptiontype(Class_Handle ch);
-
 /**
  * @return <code>TRUE</code> if the class is a value type.
  */
  VMEXPORT Boolean class_is_valuetype(Class_Handle ch);
 
 /**
- * @return <code>TRUE</code> if the class represents an enum. 
- *         For Java 1.4 always returns <code>FALSE</code>.
- */
-VMEXPORT Boolean class_is_enum(Class_Handle ch);
-
-/**
  * This function can only be called if (<code>class_is_enum(ch)</code> == <code>TRUE</code>)
  * The returned value is the type of the underlying int type.
  */
 VMEXPORT VM_Data_Type class_get_enum_int_type(Class_Handle ch);
 
 /**
- * @return <code>TRUE</code> if the class represents a primitive type (int, float, etc.)
- */
- VMEXPORT Boolean class_is_primitive(Class_Handle ch);
-
-/**
- * @return The name of the class.
- */
- VMEXPORT const char *class_get_name(Class_Handle ch);
-
-/**
- * @return The name of the package containing the class.
- */
- VMEXPORT const char *class_get_package_name(Class_Handle ch);
-
-/**
  * The super class of the current class. 
  * @return <code>NULL</code> for the system object class, i.e.
- *         <code>class_get_super_class</code>(get_system_object_class()) == NULL
+ *         <code>class_get_super_class</code>(vm_get_system_object_class()) == NULL
  */
 VMEXPORT Class_Handle class_get_super_class(Class_Handle ch);
 
 /**
- * @return The vtable handle of the given class.
- */
- VMEXPORT VTable_Handle class_get_vtable(Class_Handle ch);
-
-/**
  * @return The allocation handle to be used for the object allocation
  *         routines, given a class handle.
  */
@@ -175,63 +102,6 @@
 VMEXPORT Class_Handle allocation_handle_get_class(Allocation_Handle ah);
 
 /**
- * @return An <code>VM_Data_Type</code> value for a given class.
- */
- VMEXPORT VM_Data_Type class_get_primitive_type_of_class(Class_Handle ch);
-
-/**
- * @return A class corresponding to a primitive type. For all primitive types t
- *         t == <code>class_get_primitive_type_of_class(class_get_class_of_primitive_type(t))</code>
- */
- VMEXPORT Class_Handle class_get_class_of_primitive_type(VM_Data_Type typ);
-
-/** 
- * @return <code>TRUE</code> is the class is an array.
- */
-VMEXPORT Boolean class_is_array(Class_Handle ch);
-
-/** 
- * @return <code>TRUE</code> if class <code>s</code> is assignment 
- * compatible with class <code>t</code>.
- */ 
-VMEXPORT Boolean class_is_instanceof(Class_Handle s, Class_Handle t);
-
-/**
- * Given a class handle <code>cl</code> construct a class handle of the type
- * representing array of <code>cl</code>. If class cl is value type, assume
- * that the element is a reference to a boxed instance of that type.
- */
- VMEXPORT Class_Handle class_get_array_of_class(Class_Handle ch);
-
-/**
- * Given a class handle <code>cl</code> construct a class handle of the type
- * representing array of <code>cl</code>. Class <code>cl</code> is assumed to be a
- * value type. 
- * 
- * @return <code>NULL</code> if cl is not a value type.
- */
- VMEXPORT Class_Handle class_get_array_of_unboxed(Class_Handle ch);
-
-/**
- * @return For a class that is an array return the type info for the elements
- *         of the array.
- */
- VMEXPORT Type_Info_Handle class_get_element_type_info(Class_Handle ch);
-
- /**
-  * @return <code>TRUE</code> if the class is already fully initialized.
-  */
-  VMEXPORT Boolean class_is_initialized(Class_Handle ch);
-
-/**
- * @return <code>TRUE</code> if the class is neither initialized nor in the process
- *         of being initialized. The intention is that the JIT will emit a call
- *         to <code>VM_RT_INITIALIZE_CLASS</code> before every access to a static 
- *         field in Java.
- */
- VMEXPORT Boolean class_needs_initialization(Class_Handle ch);
-
-/**
  * For Java returns <code>FALSE</code>.
  */
  VMEXPORT Boolean class_is_before_field_init(Class_Handle ch);
@@ -279,31 +149,11 @@
 VMEXPORT Boolean class_get_fast_instanceof_flag(Class_Handle cl);
 
 /**
- * Get handle for a method declared in class.
- */
- VMEXPORT Method_Handle class_get_method(Class_Handle ch, unsigned index);
-
-/**
- * @return <code>TRUE</code> if all instances of this class are pinned.
- */
- VMEXPORT Boolean class_is_pinned(Class_Handle ch);
-
-/**
  * @return <code>TRUE</code> if all instances of this class are pinned.
  */
  VMEXPORT void* class_alloc_via_classloader(Class_Handle ch, int32 size);
 
 /**
- * @return <code>TRUE</code> if this is an array of primitives.
- */
- VMEXPORT Boolean class_is_non_ref_array(Class_Handle ch);
-
-/**
- * @return <code>TRUE</code> if the class has a non-trivial finalizer.
- */
- VMEXPORT BOOLEAN class_is_finalizable(Class_Handle ch);
-
-/**
  * This exactly what I want.
  * Get the alignment of the class.
  */
@@ -315,12 +165,6 @@
  VMEXPORT unsigned class_get_alignment_unboxed(Class_Handle ch);
 
 /**
- * @return For a class handle that represents and array, return the size of the
- *         element of the array.
- */
- VMEXPORT unsigned class_element_size(Class_Handle ch);
-
-/**
  * @return The size in bytes of an instance in the heap.
  */
  VMEXPORT unsigned class_get_boxed_data_size(Class_Handle ch);
@@ -331,13 +175,6 @@
  */
  VMEXPORT unsigned class_get_unboxed_data_offset(Class_Handle ch);
 
-
- /**
- * @return The size of array element for the given array class
- */
- VMEXPORT unsigned class_get_array_element_size(Class_Handle ch);
-
-
 /**
  * @return The class of the array element of the given class.
  *
@@ -358,31 +195,6 @@
  */ 
  DECLARE_OPEN(Class_Handle, vtable_get_class, (VTable_Handle vh));
 
-
-////
-// begin class iterator related functions.
-////
-
-/**
- * Initializes the <code>CHA_Class_Iterator</code>, to iterate over all 
- * classes that descend from <code>root_class</code>, including 
- * <code>root_class</code> itself.
- *
- * @return <code>TRUE</code> if iteration is supported over 
- *         <code>root_class</code>, <code>FALSE</code> if not.
- */ 
- VMEXPORT Boolean class_iterator_initialize(ChaClassIterator*, Class_Handle root_class);
-
-/**
- * @return The current class of the iterator. <code>NULL</code> if
- *         there are no more classes.
- */
- VMEXPORT Class_Handle class_iterator_get_current(ChaClassIterator*);
-
-/**
- * Advances the iterator.
- */
- VMEXPORT void class_iterator_advance(ChaClassIterator*);
 
 ////
 // begin inner-class related functions.

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_info.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_info.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_info.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_info.h Tue Apr 15 04:29:41 2008
@@ -44,39 +44,6 @@
  */
 DECLARE_OPEN(const char *, class_cp_get_const_string, (Class_Handle ch, U_16 idx));
 
-
-/**
- * @return The address where the interned version of the string
- *         is stored. 
- * 
- * Calling <code>class_get_const_string_intern_addr</code> has
- * a side-effect of interning the string, so that the JIT can
- * load a reference to the interned string without checking if
- * it is null.
- * FIXME the above side effect is no longer true.
- * FIXME rename??
- */
-DECLARE_OPEN(const void *, class_get_const_string_intern_addr, (Class_Handle ch, U_16 idx));
-
-/**
- * @return A pointer to the location where the constant is stored.
- *
- * The <code>idx</code> parameter is interpreted as a constant pool index for JVM.
- * This function shouldn't be called for constant strings. Instead, either:<br>
- * <ul><li>The jitted code should get the string object at runtime by calling
- *         <code>VM_RT_LDC_STRING</code>, or
- *     <li>Use class_get_const_string_intern_addr().
- *</ul>
- */
-DECLARE_OPEN(const void *, class_cp_get_const_addr, (Class_Handle ch, U_16 idx));
-
-/**
- * @return The type of a compile-time constant.
- *
- * The <code>idx</code> parameter is interpreted as a constant pool index for JVM.
- */
-DECLARE_OPEN(VM_Data_Type, class_cp_get_const_type, (Class_Handle ch, U_16 idx));
-
 /**
 * @return The data type for field in constant pool entry.
 * 
@@ -85,29 +52,7 @@
 */
 DECLARE_OPEN(VM_Data_Type, class_cp_get_field_type, (Class_Handle src_class, U_16 idx));
 
-/**
-* @return The signature for field or (interface) method in constant pool entry.
-* The <code>idx</code> parameter is interpreted as a constant pool index 
-* for JVM.
-*/
-DECLARE_OPEN(const char *, class_cp_get_entry_signature, (Class_Handle src_class, U_16 idx));
-
-DECLARE_OPEN(U_32, class_cp_get_num_array_dimensions, (Class_Handle cl, U_16 cpIndex));
 /// Returns 'TRUE' if the entry by the given cp_index is resolved.
-DECLARE_OPEN(BOOLEAN, class_cp_is_entry_resolved, (Class_Handle clazz, U_16 cp_index));
-
-DECLARE_OPEN(const char *, class_cp_get_field_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_field_class_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_method_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_method_class_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_class_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_interface_method_name, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_interface_method_class_name, (Class_Handle cl, U_16 index));
-
-//FIXME redundant, replace with class_cp_get_entry_signature
-DECLARE_OPEN(const char *, class_cp_get_interface_method_descriptor, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_method_descriptor, (Class_Handle cl, U_16 index));
-DECLARE_OPEN(const char *, class_cp_get_field_descriptor, (Class_Handle cl, U_16 index));
 
 #ifdef __cplusplus
 }

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_loading.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_loading.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_loading.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_loading.h Tue Apr 15 04:29:41 2008
@@ -21,6 +21,9 @@
 #ifndef _VM_CLASS_LOADING_H
 #define _VM_CLASS_LOADING_H
 
+#include "open/types.h"
+#include "open/common.h"
+
 /**
  * @file
  * Class loading functionality of the class support interface. 
@@ -28,6 +31,9 @@
  * from the virtual machine and interested components.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /** 
  * @defgroup Extended VM Class Loading Extended Interface
@@ -41,29 +47,42 @@
  * This class loader does not delegate the lookup operation to 
  * the parent loader or try to load any class.
  *
- * @param classloader    - the handle of the C++ class loader
- * @param name           - the name of the class to look up
+ * @param classloader - the handle of the C++ class loader. If <code>NULL</code>
+ *                      bootstrap class loader is assumed
+ * @param name           - the name of the class to look up. Name is accepted
+ *  both in internal and external forms (with '/'s and '.'s).
  *
  * @return The handle for C++ class representation, if found. Otherwise, <code>NULL</code>.
- *
- * @note Replaces cl_get_class.
  */
-Class_Handle
-class_loader_lookup_class(Open_Class_Loader_Handle classloader, const char* name);
+DECLARE_OPEN(Class_Handle, class_loader_lookup_class,
+    (ClassLoaderHandle classloader, const char* name));
 
 
 /**
  * Tries to load the class given its name and using the specified class loader.
  *
- * @param classloader    - the handle of the C++ class loader representation
+ * @param classloader    - the handle of the C++ class loader. If <code>NULL</code>
+ *                      bootstrap class loader is assumed
  * @param name           - the name of the class to load
  *
  * @return The handle for the C++ class representation, if loaded successfully; otherwise, <code>NULL</code>.
  *
  * @note Replaces cl_load_class. 
  */
-Class_Handle
-class_loader_load_class(Open_Class_Loader_Handle classloader, const char* name);
+DECLARE_OPEN(Class_Handle, class_loader_load_class,
+    (ClassLoaderHandle classloader, const char* name));
+
+/** @ingroup Extended 
+ *
+ * Finds already loaded class given its name and using the bootstrap class loader.
+ *
+ * @param name  - the name of the class to load
+ * @param exc   - the exception code for a class loading failure
+ *
+ * @result The handle for the C++ class representation, if found;
+ * otherwise, <code>NULL</code>.
+ */
+DECLARE_OPEN(Class_Handle, vm_lookup_class_with_bootstrap, (const char* name));
 
 /** @ingroup Extended 
  *
@@ -76,45 +95,49 @@
  *
  * @note Replaces class_load_class_by_name_using_system_class_loader. 
  */
-Class_Handle
-vm_load_class_with_bootstrap(const char* name);
+DECLARE_OPEN(Class_Handle, vm_load_class_with_bootstrap, (const char* name));
 
 /**
  * Returns the C++ class structure representing the system 
- * <code>java.lang.Object</code> class. 
+ * <code>java.lang.Object</code> class.
  *
- * This function is the fast equivalent of the <code>vm_load_class_with_bootstrap("java/lang/Object")</code> function.
+ * This function is the fast equivalent of the
+ * <code>vm_load_class_with_bootstrap("java/lang/Object")</code> function.
  *
- * @return the handle for the <code>java.lang.Object</code> C++ class representation. 
+ * @return the handle for the <code>java.lang.Object</code> C++ class representation.
+ */
+DECLARE_OPEN(Class_Handle, vm_get_system_object_class, ());
+
+/**
+ * Returns the C++ class structure representing the system 
+ * <code>java.lang.Class</code> class.
  *
- * @note Replaces get_system_object_class.
+ * This function is the fast equivalent of the
+ * <code>vm_load_class_with_bootstrap("java/lang/Class")</code> function.
+ *
+ * @return the handle for the <code>java.lang.Class</code> C++ class representation.
  */
-Class_Handle
-vm_get_java_lang_object_class();
+DECLARE_OPEN(Class_Handle, vm_get_system_class_class, ());
 
 /**
  * Returns the C++ class structure representing the system class
- * <code>java.lang.string</code>. 
+ * <code>java.lang.String</code>.
  * 
- * This function is the fast equivalent of the <code>vm_load_class_with_bootstrap("java/lang/String")</code> function.
- *
- * @return The handle of <code>java.lang.String</code> C++ class representation
+ * This function is the fast equivalent of the
+ * <code>vm_load_class_with_bootstrap("java/lang/String")</code> function.
  *
- * @note Replaces get_system_string_class.
+ * @return The handle of <code>java.lang.String</code> C++ class representation.
  */
-Class_Handle
-vm_get_java_lang_string_class();
+DECLARE_OPEN(Class_Handle, vm_get_system_string_class, ());
 
 /**
- * Stores the pointer to verifier-specific data into the class loader C++ structure. 
+ * Stores the pointer to verifier-specific data into the class loader C++ structure.
  *
  * @param classloader      - the handle to the class loader to set the verifier data in
  * @param data             - the pointer to the verifier data
- *
- * @note Replaces cl_set_verify_data_ptr.
  */
-void
-class_loader_set_verifier_data_ptr(Open_Class_Loader_Handle classloader, const void* data);
+DECLARE_OPEN(void, class_loader_set_verifier_data_ptr,
+    (ClassLoaderHandle classloader, void* data));
 
 /**
  * Returns the pointer to verifier-specific data associated with the given class loader.
@@ -125,8 +148,7 @@
  *
  * @note Replaces cl_get_verify_data_ptr.
  */
-void*
-class_loader_get_verifier_data_ptr(Open_Class_Loader_Handle classloader);
+DECLARE_OPEN(void*, class_loader_get_verifier_data_ptr, (ClassLoaderHandle classloader));
 
 /**
  * Acquires the lock on a given class loader. 
@@ -135,8 +157,7 @@
  * 
  * @note Replaces cl_acquire_lock.
  */
-void
-class_loader_lock(Open_Ă‘lass_Loader_Handle classloader);
+DECLARE_OPEN(void, class_loader_lock, (ClassLoaderHandle classloader));
 
 /**
  * Releases the lock on a given class loader. 
@@ -145,7 +166,10 @@
  * 
  * @note Replaces cl_acquire_lock.
  */
-void
-class_loader_unlock(Open_Class_Loader_Handle classloader);
+DECLARE_OPEN(void, class_loader_unlock, (ClassLoaderHandle classloader));
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif // _VM_CLASS_LOADING_H

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_manipulation.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_manipulation.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_manipulation.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_class_manipulation.h Tue Apr 15 04:29:41 2008
@@ -21,6 +21,9 @@
 #ifndef _VM_CLASS_MANIPULATION_H
 #define _VM_CLASS_MANIPULATION_H
 
+#include "open/types.h"
+#include "open/common.h"
+
 /**
  * @file
  * Part of Class Support interface related to retrieving and changing
@@ -30,6 +33,10 @@
  * class super class, fields, methods and so on.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** 
  * Returns the class name.
  *
@@ -39,8 +46,19 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-const char*
-class_get_name(Open_Class_Handle klass);
+DECLARE_OPEN(const char*, class_get_name, (Class_Handle klass));
+
+/**
+ * Returns class major version.
+ *
+ * @param klass - class handler
+ *
+ * @return Class major version.
+ *
+ * @note Assertion is raised if <code>klass</code> is equal
+ *       to <code>NULL</code>.
+ */
+DECLARE_OPEN(unsigned short, class_get_version, (Class_Handle klass));
 
 /** 
  * Returns the class name.
@@ -52,7 +70,7 @@
  * @ingroup Extended
  */
 const char*
-class_get_java_name(Open_Class_Handle klass);
+class_get_java_name(Class_Handle klass);
 
 
 /** 
@@ -64,8 +82,20 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-Open_Class_Handle
-class_get_super_class(Open_Class_Handle klass);
+DECLARE_OPEN(Class_Handle, class_get_super_class, (Class_Handle klass));
+
+/**
+ * Returns non-zero value if the class represented by Class_Handle
+ * is a descendant of java.lang.ref.Reference. The particular type
+ * of reference (weak, soft or phantom) is encoded by the return
+ * value as WeakReferenceType.
+ *
+ * @param clss - the class handle
+ *
+ * @return Type of weak reference represented by the class handle;
+ *         <code>NOT_REFERENCE</code> (0) otherwise
+ */
+VMEXPORT WeakReferenceType class_is_reference(Class_Handle clss);
 
 /**
  * Returns the class loader of the current class.
@@ -76,8 +106,7 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-Open_Class_Loader_Handle
-class_get_class_loader(Open_Class_Handle klass);
+DECLARE_OPEN(ClassLoaderHandle, class_get_class_loader, (Class_Handle klass));
 
 /**
  * Checks whether the current class is a primitive type.
@@ -88,8 +117,7 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-Boolean
-class_is_primitive(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_primitive, (Class_Handle klass));
 
 /**
  * Checks whether the current class is an array.
@@ -100,8 +128,7 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-Boolean
-class_is_array(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_array, (Class_Handle klass));
 
 /**
  * Checks whether the current class is an instance of another class.
@@ -113,8 +140,7 @@
  *
  * @note An assertion is raised if <i>klass</i> or <i>super_klass</i> equals to <code>NULL</code>.
  */
-Boolean
-class_is_instanceof(Open_Class_Handle klass, Open_Class_Handle super_klass);
+DECLARE_OPEN(BOOLEAN, class_is_instanceof, (Class_Handle klass, Class_Handle super_klass));
 
 /**
  * Checks whether the current class is abstract.
@@ -126,8 +152,7 @@
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  * @note Replaces the class_is_abstract function.
  */
-Boolean
-class_is_abstract(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_abstract, (Class_Handle klass));
 
 /**
  * Checks whether the current class is an interface class.
@@ -137,10 +162,8 @@
  * @return <code>TRUE</code> for an interface class; otherwise, <code>FALSE</code>.
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
- * @note Replaces functions class_is_interface_ and class_is_interface2.
  */
-Boolean
-class_is_interface(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_interface, (Class_Handle klass));
 
 /**
  * Checks whether the current class is final.
@@ -150,10 +173,8 @@
  * @return <code>TRUE</code> for a final class; otherwise, <code>FALSE</code>.
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
- * @note Replaces functions class_is_final_ and class_is_final.
  */
-Boolean
-class_is_final(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_final, (Class_Handle klass));
 
 /**
  * Checks whether the given classes are the same.
@@ -165,8 +186,42 @@
  *
  * @note An assertion is raised if <i>klass1</i> or <i>klass2</i> equal to <code>NULL</code>.
  */
-Boolean
-class_is_same_class(Open_Class_Handle klass1, Open_Class_Handle klass2);
+DECLARE_OPEN(BOOLEAN, class_is_same_class, (Class_Handle klass1, Class_Handle klass2));
+
+/**
+ * Checks whether the given classes have the same package.
+ *
+ * @param klass1 - class handler
+ * @param klass2 - class handler
+ *
+ * @return If classes have the same package returns <code>true</code>, else returns <code>false</code>.
+ *
+ * @note Assertion is raised if klass1 or klass2 are equal to null.
+ */
+DECLARE_OPEN(BOOLEAN, class_is_same_package, (Class_Handle klass1, Class_Handle klass2));
+
+/**
+ * Returns number of super interfaces of the class.
+ *
+ * @param klass - class handler
+ *
+ * @return Number of super interfaces of class.
+ *
+ * @note Assertion is raised if klass is equal to null.
+ */
+DECLARE_OPEN(unsigned short, class_get_superinterface_number, (Class_Handle klass));
+
+/**
+ * Returns superinterface of class by the given number.
+ *
+ * @param klass - class handler
+ * @param index - super interface number
+ *
+ * @return Super interface of class.
+ *
+ * @note Assertion is raised if klass is equal to null or index is out of range.
+ */
+DECLARE_OPEN(Class_Handle, class_get_superinterface, (Class_Handle klass, unsigned short index));
 
 /**
  * Returns the offset of the referent field 
@@ -181,8 +236,7 @@
  * @note This interface allows only one weak, soft or phantom reference per object.
  *             It seems to be sufficient for the JVM spec.
  */
-int
-class_get_referent_offset(Open_Class_Handle clss);
+DECLARE_OPEN(unsigned, class_get_referent_offset, (Class_Handle clss));
 
 /**
  * Returns the VM_Data_Type value for the given class.
@@ -191,8 +245,7 @@
  *
  * @return The VM_Data_Type value.
  */
-VM_Data_Type
-class_get_primitive_type_of_class(Open_Class_Handle klass);
+DECLARE_OPEN(VM_Data_Type, class_get_primitive_type_of_class, (Class_Handle klass));
 
 /**
  * Returns the class corresponding to the primitive type.
@@ -204,8 +257,7 @@
  * @note For all primitive types <i>type</i> is:
  *            <code>type == class_get_primitive_type_of_class(class_get_class_of_primitive_type(type))</code>
  */
-Open_Class_Handle
-class_get_class_of_primitive_type(VM_Data_Type type);
+DECLARE_OPEN(Class_Handle, class_get_class_of_primitive_type, (VM_Data_Type type));
 
 /**
  * Returns the size of an instance in the heap, in bytes.
@@ -217,7 +269,7 @@
  * @note Replaces class_get_boxed_data_size function.
  */
 unsigned
-class_get_instance_size(Open_Class_Handle klass);
+class_get_instance_size(Class_Handle klass);
 
 /**
  * For given a class handle <i>klass</i> constructs a class of
@@ -229,8 +281,7 @@
  *
  * @return The class handle of the type representing the array of <i>klass</i>.
  */
-Open_Class_Handle
-class_get_array_of_class(Open_Class_Handle klass);
+DECLARE_OPEN(Class_Handle, class_get_array_of_class, (Class_Handle klass));
 
 /**
  * Returns the class of the array element of the given class.
@@ -242,8 +293,37 @@
  * @note The behavior is undefined if the parameter does not represent
  * an array class.
  */
-Open_Class_Handle
-class_get_array_element_class(Open_Class_Handle klass);
+DECLARE_OPEN(Class_Handle, class_get_array_element_class, (Class_Handle klass));
+
+/**
+ * Returns class with the given name extended by the given class.
+ *
+ * @param klass      - checked klass
+ * @param super_name - parent class name
+ *
+ * @return If the given class extends the class with given name,
+ *         function returns extended class handle, otherwise <code>NULL</code> is returned.
+ *
+ * @note Assertion is raised if <i>klass</i> or <i>super_name</i> are equal to null.
+ */
+DECLARE_OPEN(Class_Handle, class_get_extended_class, (Class_Handle klass, const char* super_name));
+
+/**
+ * Function returns number of methods for current class.
+ * @param klass - class handler
+ * @return Number of methods for class.
+ * @note Assertion is raised if klass is equal to null.
+ */
+DECLARE_OPEN(unsigned short, class_get_method_number, (Class_Handle klass));
+
+/** 
+ * Function returns method of current class.
+ * @param klass - class handler
+ * @param index - method index
+ * @return Method handler.
+ * @note Assertion is raised if klass is equal to null or index is out of range.
+ */
+DECLARE_OPEN(Method_Handle, class_get_method, (Class_Handle klass, unsigned short index));
 
 /**
  * Returns the type info for the elements of the array for array classes.
@@ -252,8 +332,7 @@
  *
  * @return Type information for the elements of the array.
  */
-Open_Type_Info_Handle
-class_get_element_type_info(Open_Class_Handle klass);
+DECLARE_OPEN(Type_Info_Handle, class_get_element_type_info, (Class_Handle klass));
 
 /**
  * Gets the handle for the field. 
@@ -265,8 +344,7 @@
  * @return The handle for the field. If <i>index</i> is greater than or equal to
  * <code>class_num_instance_fields_recursive</code>, function returns NULL.
  */
-Open_Field_Handle
-class_get_instance_field_recursive(Open_Class_Handle klass, unsigned index);
+DECLARE_OPEN(Field_Handle, class_get_instance_field_recursive, (Class_Handle klass, unsigned index));
 
 /**
  * Returns the size of the element of the array for class handles that represent an array.
@@ -280,8 +358,7 @@
  *
  * @ingroup Extended
  */
-unsigned
-class_element_size(Open_Class_Handle klass);
+DECLARE_OPEN(unsigned, class_get_array_element_size, (Class_Handle klass));
 
 /**
  * Returns the vtable handle for the given class.
@@ -290,8 +367,7 @@
  *
  * @return The vtable handle for the given class.
  */
-Open_VTable_Handle
-class_get_vtable(Open_Class_Handle klass);
+DECLARE_OPEN(VTable_Handle, class_get_vtable, (Class_Handle klass));
 
 /**
  * Verifies that the class is fully initialized.
@@ -300,11 +376,8 @@
  *
  * @return <code>TRUE</code> if the class is already fully
  *                initialized; otherwise, <code>FALSE</code>. 
- *
- * @note The function class_needs_initialization is merged with this function. 
  */
-Boolean
-class_is_initialized(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_initialized, (Class_Handle klass));
 
 /**
  * Gets the alignment of the class.
@@ -313,8 +386,7 @@
  *
  * @return The alignment of the class.
  */
-unsigned
-class_get_alignment(Open_Class_Handle klass);
+DECLARE_OPEN(unsigned, class_get_alignment, (Class_Handle klass));
 
 /**
  * Checks whether the class has a non-trivial finalizer.
@@ -324,8 +396,7 @@
  * @return <code>TRUE</code> if the class has a non-trivial finalizer. 
  *                : otherwise, <code>FALSE</code>.
  */
-Boolean
-class_is_finalizable(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_finalizable, (Class_Handle klass));
 
 /**
  * Checks whether the class is an array of primitives.
@@ -335,18 +406,7 @@
  * @return <code>TRUE</code> if this is an array of primitives.
  *               : otherwise, <code>FALSE</code>.
  */
-Boolean
-class_is_non_ref_array(Open_Class_Handle klass);
-
-/**
- * Checks whether all instances of the given class are pinned.
- *
- * @param klass - the class handle
- *
- * @return <code>TRUE</code> if all instances of this class are pinned; otherwise, <code>FALSE</code>.
- */
-Boolean
-class_is_pinned(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_non_ref_array, (Class_Handle klass));
 
 /**
  * Checks whether the class represented by Class_Handle
@@ -362,10 +422,10 @@
  * NOT_REFERENCE (0) is returned otherwise.
  */
 WeakReferenceType
-class_get_reference_type(Open_Class_Handle klass);
+class_get_reference_type(Class_Handle klass);
 
 /**
- * Checks whether the class is likely to be used as an exception object. 
+ * Checks whether the class is likely to be used as an exception object.
  *
  * This is a hint only. Even if this function returns <code>FALSE</code>,
  * the class might still be used for exceptions.
@@ -375,8 +435,7 @@
  * @return <code>TRUE</code> if the class is likely to be used
  *                as an exception object; otherwise, <code>FALSE</code>. 
  */
-Boolean
-class_hint_is_exceptiontype(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_throwable, (Class_Handle klass));
 
 /**
  * Checks whether the class represents an enumerator.
@@ -386,8 +445,7 @@
  * @return <code>TRUE</code> if the class represents an enum.
  *               : otherwise, <code>FALSE</code>.
  */
-Boolean
-class_is_enum(Open_Class_Handle klass);
+DECLARE_OPEN(BOOLEAN, class_is_enum, (Class_Handle klass));
 
 /**
  * Returns the number of instance fields defined in the given class.
@@ -400,7 +458,7 @@
  * @note Replaces the class_num_instance_fields_recursive function.
  */
 unsigned
-class_get_all_instance_fields_number(Open_Class_Handle klass);
+class_get_all_instance_fields_number(Class_Handle klass);
 
 /**
  * Returns the name of the package containing the class.
@@ -411,8 +469,7 @@
  *
  * @note Not used
  */
-const char*
-class_get_package_name(Open_Class_Handle klass);
+DECLARE_OPEN(const char*, class_get_package_name, (Class_Handle klass));
 
 /**
  * Returns the pointer to the location of the constant.
@@ -431,8 +488,7 @@
  *               <li>The class_get_const_string_intern_addr() function is used.
  *            </ol>
  */
-const void*
-class_cp_get_const_addr(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(const void *, class_cp_get_const_addr, (Class_Handle klass, unsigned short index));
 
 /**
  * Returns the type of the compile-time constant.
@@ -442,16 +498,14 @@
  *
  * @return The type of a compile-time constant.
  */
-VM_Data_Type
-class_cp_get_const_type(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(VM_Data_Type, class_cp_get_const_type, (Class_Handle ch, unsigned short idx));
 
 /**
- * Returns the address of the interned version of the string. 
+ * Returns the address of the interned version of the string.
  * 
- * Calling this function has
- * a side-effect of interning the string, so that the JIT compiler can
- * load a reference to the interned string without checking whether 
- * it is <code>NULL</code>.
+ * Calling this function has a side-effect of interning the string,
+ * so that the JIT compiler can load a reference to the interned string
+ * without checking whether it is <code>NULL</code>.
  *
  * @param klass  - the class handle
  * @param index - interpreted as a constant pool index
@@ -459,96 +513,71 @@
  * @return The address of the interned version of the string.
  *
  * @note Not used
+ * FIXME the above side effect is no longer true.
  */
-void*
-class_get_const_string_intern_addr(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(const void*, class_get_const_string_intern_addr, (Class_Handle ch, unsigned short idx));
 
 /**
- * Returns the descriptor for the field or method/interface in the constant pool entry.
+ * Checks whether the entry by the specified constant pool index is resolved.
  *
- * @param klass         - the class handle
- * @param cp_index - interpreted as a constant pool index
+ * @param klass     - the class handle
+ * @param cp_index  - interpreted as a constant pool index
  *
- * @return The descriptor for field or method/interface in constant pool entry.
+ * @return <code>TRUE</code> if the constant pool entry is resolved; <code>FALSE</code> otherwise.
  */
-const char*
-class_get_cp_entry_descriptor(Open_Class_Handle klass, unsigned short cp_index);
+DECLARE_OPEN(BOOLEAN, class_cp_is_entry_resolved, (Class_Handle klass, unsigned short cp_index));
 
 /**
- * Returns the data type for the field in the constant pool entry.
+ * Returns the name for the field or method/interface in the constant pool entry.
  *
  * @param klass         - the class handle
  * @param cp_index - interpreted as a constant pool index
  *
- * @return The data type for the field in the constant pool entry.
+ * @return The name for field or method/interface in constant pool entry.
  */
-VM_Data_Type
-class_cp_get_field_type(Open_Class_Handle klass, unsigned short cp_index);
+DECLARE_OPEN(const char*, class_cp_get_entry_name, (Class_Handle cl, unsigned short index));
 
 /**
- * Initializes the <i>iterator</i> to iterate over all classes that
- * descend from <i>klass</i>, including <i>klass</i> itself.
- *
- * @param klass      - the class handle
- * @param iterator - the class iterator
+ * Returns the descriptor for the field or method/interface in the constant pool entry.
  *
- * @return <code>TRUE</code> if iteration is supported over <i>klass</i> and
- *               <code>FALSE</code> if it is not.
+ * @param klass         - the class handle
+ * @param cp_index - interpreted as a constant pool index
  *
- * @note Reference to the internal type ChaClassIterator.
+ * @return The descriptor for field or method/interface in constant pool entry.
  */
-Boolean
-class_iterator_initialize(ChaClassIterator* iterator, Open_Class_Handle klass);
+DECLARE_OPEN(const char*, class_cp_get_entry_descriptor, (Class_Handle klass, unsigned short cp_index));
 
 /**
- * Returns the current class of the iterator.
- *
- * @param iterator - the class iterator
+ * Returns the name of the class of the field or method/interface in the constant pool entry.
  *
- * @return The current class of the iterator. If there are no more classes, 
- *                returns <code>NULL</code>. 
+ * @param klass         - the class handle
+ * @param cp_index - interpreted as a constant pool index
  *
- * @note Reference to the internal type ChaClassIterator.
+ * @return The name of the class of field or method/interface in constant pool entry.
  */
-Open_Class_Handle
-class_iterator_get_current(ChaClassIterator* iterator);
+DECLARE_OPEN(const char *, class_cp_get_entry_class_name, (Class_Handle cl, unsigned short index));
 
 /**
- * Advances the iterator.
+ * Returns number of dimentions of symbolic link to an array class
  *
- * @param iterator  - the class iterator
+ * @param klass     - the class handle
+ * @param cp_index  - index into the constant pool of the <code>klass</code>
  *
- * @note Reference to the internal type ChaClassIterator.
+ * @return The number of dimentions in array linked from the constant pool
  */
-void class_iterator_advance(ChaClassIterator* iterator);
+DECLARE_OPEN(unsigned, class_cp_get_num_array_dimensions, (Class_Handle klass, unsigned short cp_index));
 
 /**
- * Returns the descriptor for the given method.
- *
- * @param klass  - the class handle
- * @param index - interpreted as a constant pool index
+ * Returns the data type for the field in the constant pool entry.
  *
- * @return The descriptor for the method.
+ * @param klass         - the class handle
+ * @param cp_index - interpreted as a constant pool index
  *
- * @note Replaces the class_cp_get_method_descriptor function.
+ * @return The data type for the field in the constant pool entry.
  */
-const char*
-class_get_cp_method_descriptor(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(VM_Data_Type, class_cp_get_field_type, (Class_Handle src_class, unsigned short cp_index));
 
 /**
- * Returns the descriptor for the field.
- *
- * @param klass - the class handle
- * @param index - interpreted as a constant pool index
- *
- * @return  The descriptor for the field.
- *
- * @note Replaces the class_cp_get_field_descriptor function.
- */
-const char*
-class_get_cp_field_descriptor(Open_Class_Handle klass, unsigned short index);
-
-/** 
  * Returns the class constant pool size.
  *
  * @param klass - the class handle
@@ -557,10 +586,9 @@
  *
  * @note An assertion is raised if <i>klass</i> equals to <code>NULL</code>.
  */
-unsigned short
-class_get_cp_size(Open_Class_Handle klass);
+DECLARE_OPEN(unsigned short, class_cp_get_size, (Class_Handle klass));
 
-/** 
+/**
  * Returns the constant pool entry tag.
  *
  * @param klass  - the class handle
@@ -571,12 +599,11 @@
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned char
-class_get_cp_tag(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned char, class_cp_get_tag, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns the class name entry index in the constant pool.
- * This function is only legal for constant pool entries with CONSTANT_Class tags.
+ * This function is only legal for constant pool entries with CONSTANT_Class tag.
  *
  * @param klass  - the class handle
  * @param index - the constant pool entry index
@@ -586,8 +613,21 @@
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_class_name_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_class_name_index, (Class_Handle klass, unsigned short index));
+
+/** 
+ * Returns the class name from the constant pool.
+ * This function is only legal for constant pool entries with CONSTANT_Class tag.
+ *
+ * @param klass - the class handle
+ * @param index - the constant pool entry index
+ *
+ * @return The class name.
+ *
+ * @note An assertion is raised if <i>klass</i> equals to 
+ *            <code>NULL</code> or if <i>index</i> is out of range.
+ */
+DECLARE_OPEN(const char*, class_cp_get_class_name, (Class_Handle cl, unsigned short index));
 
 /** 
  * Returns the class name entry index in the constant pool.
@@ -603,101 +643,116 @@
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_ref_class_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_ref_class_index, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns the name and type entry index in the constant pool.
  *
- * This function is legal for constant pool entries with CONSTANT_Fieldref, 
- * CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags. 
- *
  * @param klass  - the class handle
  * @param index - the constant pool entry index
  *
  * @return The name_and_type entry index.
  *
+ * @note Function is valid for constant pool entries with 
+ *       CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_ref_name_and_type_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_ref_name_and_type_index, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns the string entry index in the constant pool.
  *
- * This function is legal for constant pool entries with CONSTANT_String tags. 
- *
  * @param klass  - the class handle
  * @param index - the constant pool entry index
  *
  * @return The string entry index.
  *
+ * @note Function is valid for constant pool entries with CONSTANT_String tag.
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_string_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_string_index, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns the name entry index in the constant pool.
  *
- * @note Function is legal for constant pool entry with CONSTANT_NameAndType tags.
- *
  * @param klass - the class handle
  * @param index - the constant pool entry index
  *
  * @return  The name entry index.
  *
+ * @note Function is valid for constant pool entries with CONSTANT_NameAndType tag.
  * @note An assertion is raised if <i>klass</i> equals to 
  *       <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_name_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_name_index, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns the descriptor entry index in the constant pool.
- * This function is legal for constant pool entries with CONSTANT_NameAndType tags.
  *
  * @param klass   - the class handle
  * @param index - the constant pool entry index
  *
  * @return The descriptor entry index.
  *
+ * @note Function is valid for constant pool entries with CONSTANT_NameAndType tag.
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-unsigned short
-class_get_cp_descriptor_index(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(unsigned short, class_cp_get_descriptor_index, (Class_Handle klass, unsigned short index));
 
 /** 
  * Returns bytes for the UTF8 constant pool entry.
  * This function is legal for constant pool entries with CONSTANT_UTF8 tags.
  *
- * @param klass  - the class handle
+ * @param klass - the class handle
  * @param index - the constant pool entry index
  *
  * @return Bytes for the UTF8 constant pool entry. 
  *
+ * @note Function is valid for constant pool entries with CONSTANT_UTF8 tag.
  * @note An assertion is raised if <i>klass</i> equals to 
  *            <code>NULL</code> or if <i>index</i> is out of range.
  */
-const char*
-class_get_cp_utf8_bytes(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(const char*, class_cp_get_utf8_bytes, (Class_Handle klass, unsigned short index));
+
+/**
+ * Function sets verify data to a given class.
+ *
+ * @param klass     - class handler
+ * @param data      - verify data
+ *
+ * @note Assertion is raised if class is equal to null.
+ * @note Function makes non thread safe operation and 
+ *       must be called in thread safe manner.
+ */
+DECLARE_OPEN(void, class_set_verify_data_ptr, (Class_Handle klass, void* data));
+
+/**
+ * Function returns verify data for a given class.
+ *
+ * @param klass - class handler
+ *
+ * @return Verify data for a given class.
+ *
+ * @note Assertion is raised if klass is equal to null.
+ */
+DECLARE_OPEN(void*, class_get_verify_data_ptr, (Class_Handle klass));
 
 /**
  * Resolves the class for the constant pool entry.
  *
- * @param klass   - the class handle
- * @param index  - the constant pool entry index
- * @param exc     - the pointer to exception
+ * @param klass - the class handle
+ * @param index - the constant pool entry index
+ * @param exc   - the pointer to exception
  *
  * @return The class resolved for the constant pool entry.
  *
  * @note Replaces the vm_resolve_class and resolve_class functions.
  */
-Open_Class_Handle
-class_resolve_class(Open_Class_Handle klass, unsigned short index);
+Class_Handle
+class_resolve_class(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves the class for the constant pool entry 
@@ -713,22 +768,31 @@
  * @note Replaces the vm_resolve_class_new and resolve_class_new functions.
  *
  */
-Open_Class_Handle
-class_resolve_class_new(Open_Class_Handle klass, unsigned short index);
+Class_Handle
+class_resolve_class_new(Class_Handle klass, unsigned short index);
+
+/**
+ * Resolves the class method for the constant pool entry.
+ *
+ * @param klass   - the class handle
+ * @param index  - the constant pool entry index
+ *
+ * @return  interface method resolved for the constant pool entry.
+ */
+DECLARE_OPEN(Method_Handle, class_resolve_method, (Class_Handle klass, unsigned short index));
 
 /**
  * Resolves the class interface method for the constant pool entry.
  *
  * @param klass   - the class handle
  * @param index  - the constant pool entry index
- * @param exc     - the pointer to exception
  *
  * @return  interface method resolved for the constant pool entry.
  *
  * @note Replace the resolve_interface_method function.
  */
-Open_Method_Handle
-class_resolve_interface_method(Open_Class_Handle klass, unsigned short index);
+Method_Handle
+class_resolve_interface_method(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves class static method for the constant pool entry.
@@ -741,8 +805,8 @@
  *
  * @note Replaces the resolve_static_method function.
  */
-Open_Method_Handle
-class_resolve_static_method(Open_Class_Handle klass, unsigned short index);
+Method_Handle
+class_resolve_static_method(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves the class virtual method for the constant pool entry.
@@ -755,8 +819,8 @@
  *
  * @note Replaces the resolve_virtual_method function.
  */
-Open_Method_Handle
-class_resolve_virtual_method(Open_Class_Handle klass, unsigned short index);
+Method_Handle
+class_resolve_virtual_method(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves the class special method for the constant pool entry.
@@ -769,8 +833,8 @@
  *
  * @note Replaces the resolve_special_method function.
  */
-Open_Method_Handle
-class_resolve_special_method(Open_Class_Handle klass, unsigned short index);
+Method_Handle
+class_resolve_special_method(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves the class static field for the constant pool entry.
@@ -783,8 +847,8 @@
  *
  * @note Replaces the resolve_static_field function.
  */
-Open_Field_Handle
-class_resolve_static_field(Open_Class_Handle klass, unsigned short index);
+Field_Handle
+class_resolve_static_field(Class_Handle klass, unsigned short index);
 
 /**
  * Resolves the class non-static field for the constant pool entry.
@@ -797,8 +861,7 @@
  *
  * @note Replaces the resolve_nonstatic_field function.
  */
-Open_Field_Handle
-class_resolve_nonstatic_field(Open_Class_Handle klass, unsigned short index);
+DECLARE_OPEN(Field_Handle, class_resolve_nonstatic_field, (Class_Handle klass, unsigned short index));
 
 /**
  * Provides the initialization phase for the given class.
@@ -807,7 +870,10 @@
  *
  * @note For interpreter use only.
  */
-void
-class_initialize(Class_Handle klass);
+DECLARE_OPEN(void, class_initialize, (Class_Handle klass));
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif // _VM_CLASS_MANIPULATION_H

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_field_access.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_field_access.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_field_access.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_field_access.h Tue Apr 15 04:29:41 2008
@@ -135,6 +135,17 @@
 DECLARE_OPEN(BOOLEAN, field_is_private, (Field_Handle field));
 
 /**
+ *  Checks whether the field is protected.
+ *
+ * @param field - the field handle
+ *
+ * @return <code>TRUE</code> if the field is protected; otherwise, <code>FALSE</code>. 
+ *
+ * @ingroup Extended 
+ */
+DECLARE_OPEN(BOOLEAN, field_is_protected, (Field_Handle field));
+
+/**
  *  Checks whether the field is public.
  *
  * @param field - the field handle

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h Tue Apr 15 04:29:41 2008
@@ -200,21 +200,6 @@
 
 VMEXPORT void set_native_ref_enqueue_thread_flag(Boolean flag);
 
-enum WeakReferenceType {
-    NOT_REFERENCE = 0,
-    WEAK_REFERENCE,
-    SOFT_REFERENCE,
-    PHANTOM_REFERENCE
-};
-
-/**
- * Returns non-zero value if the class represented by Class_Handle
- * is a descendant of java.lang.ref.Reference. The particular type
- * of reference (weak, soft or phantom) is encoded by the return 
- * value of WeakReferenceType.
- */
-VMEXPORT WeakReferenceType class_is_reference(Class_Handle clss);
-
 /*
  * Returns handle of a class for a specified vtable
  *
@@ -230,23 +215,6 @@
  * @param clss - class of live object in Java heap
  */
 VMEXPORT void vm_notify_live_object_class(Class_Handle clss);
-
-/**
- * Returns the offset of the referent field 
- * in the <code>java.lang.ref.Reference</code> object.
- *
- * clss is assumed to represent the reference object,
- * i.e. class_is_reference() returned non-zero value.
- *
- * @note The returned value is most probably a constant,
- *       and is not dependent on the clss.
- *
- * @note This interface allows only one non-strong (i.e. weak
- *       soft or phantom) reference per object.
- *       It seems to be sufficient for JVM Spec.
- */
-VMEXPORT int class_get_referent_offset(Class_Handle clss);
-
 
 #define CL_PROP_ALIGNMENT_MASK      0x00FFF     ///< @sa <code>class_properties</code>
 #define CL_PROP_NON_REF_ARRAY_MASK  0x01000     ///< @sa <code>class_properties</code>

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_interface.h Tue Apr 15 04:29:41 2008
@@ -39,34 +39,17 @@
 
 //Class
 PROTOTYPE_WITH_NAME(Class_Handle, class_get_array_element_class, (Class_Handle cl));
-PROTOTYPE_WITH_NAME(unsigned    , class_get_array_element_size, (Class_Handle ch)); 
-PROTOTYPE_WITH_NAME(Class_Handle, class_get_array_of_class, (Class_Handle cl));
-PROTOTYPE_WITH_NAME(Type_Info_Handle, class_get_element_type_info, (Class_Handle ch));
-PROTOTYPE_WITH_NAME(const char* , class_get_name, (Class_Handle cl));
 PROTOTYPE_WITH_NAME(Class_Handle, class_get_super_class, (Class_Handle cl));
 PROTOTYPE_WITH_NAME(int         , class_get_depth, (Class_Handle cl));
-PROTOTYPE_WITH_NAME(VTable_Handle, class_get_vtable, (Class_Handle cl));
 PROTOTYPE_WITH_NAME(Allocation_Handle, class_get_allocation_handle, (Class_Handle ch));
 PROTOTYPE_WITH_NAME(unsigned    , class_get_boxed_data_size, (Class_Handle ch));
 
-PROTOTYPE_WITH_NAME(Class_Handle, class_get_class_of_primitive_type, (VM_Data_Type typ));
 PROTOTYPE_WITH_NAME(Method_Handle, class_get_method_by_name, (Class_Handle ch, const char* name));
 PROTOTYPE_WITH_NAME(Field_Handle, class_get_field_by_name, (Class_Handle ch, const char* name));
 PROTOTYPE_WITH_NAME(ClassLoaderHandle, class_get_class_loader, (Class_Handle ch));
 
-PROTOTYPE_WITH_NAME(Boolean     , class_is_array, (Class_Handle cl));
-PROTOTYPE_WITH_NAME(Boolean     , class_is_enum, (Class_Handle ch));
-PROTOTYPE_WITH_NAME(Boolean     , class_is_final, (Class_Handle cl)); //class_is_final
-PROTOTYPE_WITH_NAME(Boolean     , class_is_throwable, (Class_Handle ch)); //class_hint_is_exceptiontype
-PROTOTYPE_WITH_NAME(BOOLEAN     , class_is_interface, (Class_Handle cl)); //class_is_interface2
-PROTOTYPE_WITH_NAME(Boolean     , class_is_abstract, (Class_Handle cl)); //class_is_abstract
-PROTOTYPE_WITH_NAME(Boolean     , class_is_initialized, (Class_Handle ch)); //class_needs_initialization && class_is_initialized()
-PROTOTYPE_WITH_NAME(BOOLEAN     , class_is_finalizable, (Class_Handle ch));
-PROTOTYPE_WITH_NAME(Boolean     , class_is_instanceof, (Class_Handle s, Class_Handle t));
 PROTOTYPE_WITH_NAME(Boolean     , class_is_support_fast_instanceof, (Class_Handle cl));// class_get_fast_instanceof_flag
-PROTOTYPE_WITH_NAME(Boolean     , class_is_primitive, (Class_Handle vmTypeHandle));
 
-PROTOTYPE_WITH_NAME(Class_Handle, class_lookup_class_by_name_using_bootstrap_class_loader, (const char *name));
 PROTOTYPE_WITH_NAME(Method_Handle, class_lookup_method_recursively,
                    (Class_Handle clss,
                     const char *name,
@@ -117,9 +100,6 @@
 PROTOTYPE_WITH_NAME(UDATA       , vm_tls_is_fast, (void));//UDATA VMCALL hythread_uses_fast_tls
 PROTOTYPE_WITH_NAME(IDATA       , vm_get_tls_offset_in_segment, (void));//IDATA VMCALL hythread_get_hythread_offset_in_tls(void)
 
-PROTOTYPE_WITH_NAME(Class_Handle, vm_get_system_object_class, ()); // get_system_object_class
-PROTOTYPE_WITH_NAME(Class_Handle, vm_get_system_class_class, ()); // get_system_class_class
-PROTOTYPE_WITH_NAME(Class_Handle, vm_get_system_string_class, ()); // get_system_string_class
 PROTOTYPE_WITH_NAME(void*       , vm_get_vtable_base, ()); //POINTER_SIZE_INT vm_get_vtable_base()
 PROTOTYPE_WITH_NAME(void*       , vm_get_heap_base_address, ()); //vm_heap_base_address
 PROTOTYPE_WITH_NAME(void*       , vm_get_heap_ceiling_address, ()); //vm_heap_ceiling_address

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_method_access.h Tue Apr 15 04:29:41 2008
@@ -108,6 +108,18 @@
 DECLARE_OPEN(BOOLEAN, method_is_private, (Method_Handle method));
 
 /**
+ *  Checks whether the given method is protected.
+ *
+ * @param method - the method handle
+ *
+ * @return <code>TRUE</code> if the given method is protected; otherwise, <code>FALSE</code>.
+ *
+ * @note An assertion is raised if <i>method</i> equals to <code>NULL</code>. 
+ * @ingroup Extended 
+ */
+DECLARE_OPEN(BOOLEAN, method_is_protected, (Method_Handle method));
+
+/**
  *  Checks whether the given method is static.
  *
  * @param method - the method handle
@@ -316,8 +328,8 @@
  * @note Replaces the method_get_handler_info function.
  */
 DECLARE_OPEN(void, method_get_exc_handler_info,
-    (Method_Handle method, uint32 index,
-     uint32* start_pc, uint32* end_pc, uint32* handler_pc, uint32* catch_type));
+    (Method_Handle method, uint16 index,
+     uint16* start_pc, uint16* end_pc, uint16* handler_pc, uint16* catch_type));
 
 /**
  * Returns type information for the return value.
@@ -360,6 +372,17 @@
  * @note Reference to type <i>Byte</i>.
  */
 DECLARE_OPEN(const Byte*, method_get_bytecode, (Method_Handle method));
+
+/**
+ * Returns StackMapTable attribute.
+ * Parameter <i>hmethod</i> must not be equal to <code>NULL</code>.
+ * If parameter <i>index</i> is out of range, returns <code>NULL</code>.
+ *
+ * @param hmethod  - method handle
+ *
+ * @return StackMapTable bytes
+ */
+DECLARE_OPEN(unsigned char*, method_get_stackmaptable, (Method_Handle hmethod));
 
 /**
  * Returns the maximum number of local variables for the given method.

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp Tue Apr 15 04:29:41 2008
@@ -18,8 +18,7 @@
  * @author Ivan Volosyuk
  * @version $Revision: 1.6.4.4.4.3 $
  */  
-//#include "open/vm_ee.h"
-//#include "open/vm_class_loading.h"
+#include "open/vm_class_manipulation.h"
 #include "interp_vm_helpers.h"
 #include "interpreter_imports.h"
 #include "interp_native.h"

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Tue Apr 15 04:29:41 2008
@@ -17,9 +17,9 @@
 #include "interpreter.h"
 #include "interpreter_exports.h"
 #include "interpreter_imports.h"
-#include "open/vm_class_info.h"
 #include "open/vm_field_access.h"
 #include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 #include <math.h>
 
 #include "vtable.h"

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp Tue Apr 15 04:29:41 2008
@@ -18,16 +18,15 @@
  * @author Ivan Volosyuk
  * @version $Revision: 1.27.12.3.4.3 $
  */  
+#include "open/vm_field_access.h"
+#include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 #include "interpreter.h"
 #include "interpreter_exports.h"
 #include "interpreter_imports.h"
 #include "interp_defs.h"
 #include "interp_native.h"
-#include "open/vm_field_access.h"
-#include "open/vm_method_access.h"
 #include "port_malloc.h"
-#include "open/vm_class_info.h"
-//#include "open/vm_ee.h"
 #include "thread_generic.h"
 
 static jint skip_old_frames(VM_thread *thread)

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp Tue Apr 15 04:29:41 2008
@@ -403,7 +403,7 @@
                                             jinst.op0);
             if (meth != NULL) {
                 Class_Handle klass = method_get_class(meth);
-                if (class_needs_initialization(klass)) {
+                if (!class_is_initialized(klass)) {
                     gen_call_vm(ci_helper_o, rt_helper_init_class, 0, klass);
                 }
             }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp Tue Apr 15 04:29:41 2008
@@ -218,7 +218,7 @@
             if (fld != NULL) {
                 Class_Handle klass = field_get_class(fld);
                 assert(klass);
-                if (klass != m_klass && class_needs_initialization(klass)) {
+                if (klass != m_klass && !class_is_initialized(klass)) {
                     gen_call_vm(ci_helper_o, rt_helper_init_class, 0, klass);
                 }
                 fieldOp.fld = fld;
@@ -271,7 +271,7 @@
 {
     jtype jt = to_jtype(class_cp_get_field_type(fieldOp.enclClass, fieldOp.cpIndex));
     
-    const char* fieldDescName = class_cp_get_field_descriptor(fieldOp.enclClass, fieldOp.cpIndex);
+    const char* fieldDescName = class_cp_get_entry_descriptor(fieldOp.enclClass, fieldOp.cpIndex);
     bool fieldIsMagic = VMMagicUtils::isVMMagicClass(fieldDescName);
     if (fieldIsMagic) {
         jt = iplatf;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp Tue Apr 15 04:29:41 2008
@@ -170,7 +170,7 @@
         if (klass == NULL) {
             gen_call_throw(ci_helper_linkerr, rt_helper_throw_linking_exc, 0, enclClass, cpIndex, OPCODE_NEW);
         } else {
-            if ( klass!=enclClass && class_needs_initialization(klass)) {
+            if ( klass!=enclClass && !class_is_initialized(klass)) {
                 gen_call_vm(ci_helper_o, rt_helper_init_class, 0, klass);
             }
             unsigned size = class_get_boxed_data_size(klass);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Tue Apr 15 04:29:41 2008
@@ -357,7 +357,7 @@
     // We need to report 'this' additionally for the following cases:
     // - non-static sync methods - to allow VM to call monitor_exit() for
     //      abrupt exit
-    // - constructors of classes with class_hint_is_exceptiontype == true
+    // - constructors of classes with class_is_throwable == true
     //      to allow correct handling of stack trace in VM (see 
     //      stack_trace.cpp + com_openintel_drl_vm_VMStack.cpp:
     //      Java_com_openintel_drl_vm_VMStack_getStackState.
@@ -1210,7 +1210,7 @@
 
     bool eh_ok = true;
     for (unsigned i=0; i<num_handlers; i++) {
-        unsigned regStart, regEnd, handlerStart, klassType;
+        unsigned short regStart, regEnd, handlerStart, klassType;
         method_get_exc_handler_info(m_method, i,
                                 &regStart, &regEnd, &handlerStart,
                                 &klassType);
@@ -1278,16 +1278,17 @@
 void Compiler::get_args_info(bool is_static, unsigned cp_idx, 
                              ::std::vector<jtype>& args, jtype * retType)
 {
-    const char * cpentry = class_cp_get_entry_signature(m_klass, 
-                                                        (short)cp_idx);
+    const char* cpentry =
+        class_cp_get_entry_descriptor(m_klass, (unsigned short)cp_idx);
+
     // expecting an empty vector
     assert(args.size() == 0);
-    
+
     if (!is_static) {
         // all but static methods has 'this' as first argument
         args.push_back(jobj);
     }
-    
+
     if (!cpentry) {
         assert(false);
         *retType = jvoid;
@@ -1296,14 +1297,13 @@
 
     // skip '('
     const char *p = cpentry + 1;
-    
+
     //
     // The presumption (cast of '*p' to VM_Data_Type) below is based on the 
     // VM_Data_Type values - they are equal to the appropriate characters: 
     // i.e. VM_Data_Type's long is 'J' - exactly as it's used in methods'
     // signatures
     //
-    
     for (; *p != ')'; p++) {
         jtype jt = to_jtype((VM_Data_Type)*p);
         if (jt == jvoid) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp Tue Apr 15 04:29:41 2008
@@ -95,14 +95,14 @@
         return false;
     }
     
-    const char* kname = class_cp_get_method_class_name(m_klass, (unsigned short)jinst.op0);
+    const char* kname = class_cp_get_entry_class_name(m_klass, (unsigned short)jinst.op0);
 
     if (!VMMagicUtils::isVMMagicClass(kname)) {
         return false;
     }
     // This is a magic -> transform it
 
-    const char* mname = class_cp_get_method_name(m_klass, (unsigned short)jinst.op0);
+    const char* mname = class_cp_get_entry_name(m_klass, (unsigned short)jinst.op0);
 
     jtype magicType = iplatf;
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/structs.h Tue Apr 15 04:29:41 2008
@@ -32,9 +32,10 @@
 
 #include "jdefs.h"
 #include "jframe.h"
-#include "open/vm.h"
+//#include "open/vm.h"
 #include "jit_import.h"
 #include "open/vm_method_access.h"
+#include "open/vm_class_manipulation.h"
 
 namespace Jitrino {
 namespace Jet {
@@ -573,7 +574,7 @@
     /** Tests whether the method is constructor of Exception. */
     bool meth_is_exc_ctor(void)
     {
-        return class_hint_is_exceptiontype(m_klass) && meth_is_ctor();
+        return class_is_throwable(m_klass) && meth_is_ctor();
     }
     
 protected:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp Tue Apr 15 04:29:41 2008
@@ -27,7 +27,7 @@
 #include "compiler.h"
 
 #include "../shared/mkernel.h"
-#include "open/vm_class_info.h"
+#include "open/vm_class_manipulation.h"
 #include "jit_intf.h"
 
 #ifdef _WIN32
@@ -512,23 +512,14 @@
             case OPCODE_INVOKESPECIAL:
             case OPCODE_INVOKESTATIC:
             case OPCODE_INVOKEVIRTUAL:
-                lpClass = class_cp_get_method_class_name(m_klass, jinst.op0);
-                lpItem = class_cp_get_method_name(m_klass, jinst.op0);
-                lpDesc = class_cp_get_method_descriptor(m_klass, jinst.op0);
-            break;
             case OPCODE_INVOKEINTERFACE:
-                lpClass = 
-                class_cp_get_interface_method_class_name(m_klass, jinst.op0);
-                lpItem = class_cp_get_interface_method_name(m_klass, jinst.op0);
-                lpDesc = class_cp_get_interface_method_descriptor(m_klass, jinst.op0);
-                break;
             case OPCODE_GETFIELD:
             case OPCODE_PUTFIELD:
             case OPCODE_GETSTATIC:
             case OPCODE_PUTSTATIC:
-                lpClass = class_cp_get_field_class_name(m_klass, jinst.op0);
-                lpItem = class_cp_get_field_name(m_klass, jinst.op0);
-                lpDesc = class_cp_get_field_descriptor(m_klass, jinst.op0);
+                lpClass = class_cp_get_entry_class_name(m_klass, jinst.op0);
+                lpItem = class_cp_get_entry_name(m_klass, jinst.op0);
+                lpDesc = class_cp_get_entry_descriptor(m_klass, jinst.op0);
                 break;
             case OPCODE_NEW:
             case OPCODE_INSTANCEOF:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp?rev=648211&r1=648210&r2=648211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp Tue Apr 15 04:29:41 2008
@@ -298,7 +298,7 @@
     uint32 parseHandlers() {
         uint32 numHandlers = enclosingMethod->getNumHandlers();
         for (uint32 i=0; i<numHandlers; i++) {
-            unsigned beginOffset,endOffset,handlerOffset,handlerClassIndex;
+            unsigned short beginOffset,endOffset,handlerOffset,handlerClassIndex;
             enclosingMethod->getHandlerInfo(i,&beginOffset,&endOffset,
                 &handlerOffset,&handlerClassIndex);
             if (!catchBlock(beginOffset,endOffset-beginOffset,



Mime
View raw message