harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r506971 - in /harmony/enhanced/drlvm/trunk: build/make/ build/make/components/vm/ vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/ vm/gc_cc/src/ vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/ vm/gc_gen/src/common/ vm/include/ vm/include...
Date Tue, 13 Feb 2007 11:10:55 GMT
Author: varlax
Date: Tue Feb 13 03:10:35 2007
New Revision: 506971

URL: http://svn.apache.org/viewvc?view=rev&rev=506971
Log:
Applied HARMONY-3126 [drlvm] VMMagic: migration to new interfaces
Tested on SUSE10@ia32.

Added:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/build/make/build.xml
    harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_cc.xml
    harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen.xml
    harmony/enhanced/drlvm/trunk/build/make/components/vm/hythr.xml
    harmony/enhanced/drlvm/trunk/build/make/components/vm/kernel_classes.xml
    harmony/enhanced/drlvm/trunk/build/make/lnx.properties
    harmony/enhanced/drlvm/trunk/build/make/setup.xml
    harmony/enhanced/drlvm/trunk/build/make/win.properties
    harmony/enhanced/drlvm/trunk/vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/GCHelper.java
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/GCHelper.java
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp
    harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h
    harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h
    harmony/enhanced/drlvm/trunk/vm/thread/javasrc/org/apache/harmony/drlvm/thread/ThreadHelper.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java

Modified: harmony/enhanced/drlvm/trunk/build/make/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/build.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/build.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/build.xml Tue Feb 13 03:10:35 2007
@@ -480,7 +480,7 @@
                                            deploy.getting_started,
                                            deploy.copy_classlib,
                                            deploy.antlr,
-                                           deploy.mmtk,
+                                           deploy.vmmagic,
                                            deploy.tweakname">
         
         <!-- copy our hythr for the launcher to use -->
@@ -572,18 +572,18 @@
         </if> 
     </target>
 
-    <target name="deploy.mmtk">
+    <target name="deploy.vmmagic">
         <copy todir="${build.deploy.dir}/jdk/jre/lib/boot">
-            <fileset dir="${build.MMTK.home}">
-                <include name="mmtk-20061012.jar" />
+            <fileset dir="${build.VMMAGIC.home}">
+                <include name="vmmagic-20070207.jar" />
             </fileset>
         </copy>
         <loadfile srcFile="${build.deploy.dir}/jdk/jre/lib/boot/bootclasspath.properties" property="boot.jars.list" />
-        <if> <not><contains string="${boot.jars.list}" substring="=mmtk-20061012.jar"/></not>
+        <if> <not><contains string="${boot.jars.list}" substring="=vmmagic-20070207.jar"/></not>
         <then>
 <concat append="true" destfile="${build.deploy.dir}/jdk/jre/lib/boot/bootclasspath.properties">
-# Dependency for unboxed mmtk package
-bootclasspath.100=mmtk-20061012.jar
+# Dependency for vmmagic package
+bootclasspath.100=vmmagic-20070207.jar
 </concat>
 <fixcrlf srcdir="${build.deploy.dir}/jdk/jre/lib/boot" includes="bootclasspath.properties"/>
         </then>

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_cc.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_cc.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_cc.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_cc.xml Tue Feb 13 03:10:35 2007
@@ -106,7 +106,7 @@
 
             <fileset dir="${external.dep.CLASSLIB.jardir}" includes="*.jar" />
             <pathelement location="${vm.kernel_classes.jardir}/kernel.jar"/>
-            <fileset dir="${build.MMTK.home}" includes="mmtk-20061012.jar" />
+            <fileset dir="${build.VMMAGIC.home}" includes="vmmagic-20070207.jar" />
         </path>
 
         <property name="jarname" value="gc_cc.jar"/>

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen.xml Tue Feb 13 03:10:35 2007
@@ -130,7 +130,7 @@
 
             <fileset dir="${external.dep.CLASSLIB.jardir}" includes="*.jar" />
             <pathelement location="${vm.kernel_classes.jardir}/kernel.jar"/>
-            <fileset dir="${build.MMTK.home}" includes="mmtk-20061012.jar" />
+            <fileset dir="${build.VMMAGIC.home}" includes="vmmagic-20070207.jar" />
         </path>
 
         <property name="jarname" value="gc_gen.jar"/>

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/hythr.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/hythr.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/hythr.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/hythr.xml Tue Feb 13 03:10:35 2007
@@ -117,7 +117,7 @@
 
             <fileset dir="${external.dep.CLASSLIB.jardir}" includes="*.jar" />
             <pathelement location="${vm.kernel_classes.jardir}/kernel.jar"/>
-            <fileset dir="${build.MMTK.home}" includes="mmtk-20061012.jar" />
+            <fileset dir="${build.VMMAGIC.home}" includes="vmmagic-20070207.jar" />
         </path>
 
         <property name="jarname" value="hythr.jar"/>

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/kernel_classes.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/kernel_classes.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/kernel_classes.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/kernel_classes.xml Tue Feb 13 03:10:35 2007
@@ -42,7 +42,7 @@
 
             <fileset dir="${external.dep.CLASSLIB.jardir}" includes="*.jar" />
             <fileset dir="${build.ANTLR.home}" includes="antlr-2.7.5.jar" />
-            <fileset dir="${build.MMTK.home}" includes="mmtk-20061012.jar" />
+            <fileset dir="${build.VMMAGIC.home}" includes="vmmagic-20070207.jar" />
         </path>
 
         <!-- compile time debug information - true by default for kernel classes -->

Modified: harmony/enhanced/drlvm/trunk/build/make/lnx.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/lnx.properties?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/lnx.properties (original)
+++ harmony/enhanced/drlvm/trunk/build/make/lnx.properties Tue Feb 13 03:10:35 2007
@@ -76,8 +76,8 @@
 remote.ANTLR.archive.type=asis
 
 # org.vmmagic unboxed package. Used to enable address arithmetic in Java
-remote.MMTK.archive=http://cs.anu.edu.au/people/Robin.Garner/mmtk-20061012.jar
-remote.MMTK.archive.type=asis
+remote.VMMAGIC.archive=http://cs.anu.edu.au/people/Robin.Garner/vmmagic-20070207.jar
+remote.VMMAGIC.archive.type=asis
 
 # Xalan-Java version 2.7.0
 XALAN_HOME=${external.dep.CLASSLIB}/depends/jars/xalan-j_2.7.0

Modified: harmony/enhanced/drlvm/trunk/build/make/setup.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/setup.xml?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/setup.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/setup.xml Tue Feb 13 03:10:35 2007
@@ -106,7 +106,7 @@
         <property name="XALAN.check.file" value="xalan.jar" />
         <property name="VM.check.file" value="vmcore/src/init/vm_init.cpp" />
         <property name="ANTLR.check.file" value="antlr-2.7.5.jar" />
-        <property name="MMTK.check.file" value="mmtk-20061012.jar" />
+        <property name="VMMAGIC.check.file" value="vmmagic-20070207.jar" />
         <property name="PATCHES.check.file" value="README.txt" />
     </target>
 
@@ -181,7 +181,7 @@
 
 
     <target name="setup.resources" depends="plugin.antcontrib">
-        <property name="common.resources" value="LOG4CXX,CPPTASKS,XALAN,VM,ANTLR,PATCHES,JASMIN,MMTK" />
+        <property name="common.resources" value="LOG4CXX,CPPTASKS,XALAN,VM,ANTLR,PATCHES,JASMIN,VMMAGIC" />
         <property name="build.resources" value="CPPTASKS" />
         <if>
             <isset property="if.lnx" />

Modified: harmony/enhanced/drlvm/trunk/build/make/win.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/win.properties?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/win.properties (original)
+++ harmony/enhanced/drlvm/trunk/build/make/win.properties Tue Feb 13 03:10:35 2007
@@ -75,8 +75,8 @@
 remote.ANTLR.archive.type=asis
 
 # org.vmmagic unboxed package. Used to enable address arithmetic in Java
-remote.MMTK.archive=http://cs.anu.edu.au/people/Robin.Garner/mmtk-20061012.jar
-remote.MMTK.archive.type=asis
+remote.VMMAGIC.archive=http://cs.anu.edu.au/people/Robin.Garner/vmmagic-20070207.jar
+remote.VMMAGIC.archive.type=asis
 
 # Xalan-Java version 2.7.0
 XALAN_HOME=${external.dep.CLASSLIB}/depends/jars/xalan-j_2.7.0

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/GCHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/GCHelper.java?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/GCHelper.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/javasrc/org/apache/harmony/drlvm/gc_cc/GCHelper.java Tue Feb 13 03:10:35 2007
@@ -36,7 +36,8 @@
     private static final int GC_OBJECT_ALIGNMENT = 4; //TODO: EM64 or IPF could have 8!
 
 
-    public static Address alloc(int objSize, int allocationHandle) throws InlinePragma {
+    @Inline
+    public static Address alloc(int objSize, int allocationHandle) {
         Address tlsAddr = VMHelper.getTlsBaseAddress();
 
         Address tlsFreeFieldAddr = tlsAddr.plus(TLS_CURRENT_OFFSET);
@@ -57,17 +58,18 @@
     }
 
 
-   public static Address allocArray(int arrayLen, int elemSize, int allocationHandle)  throws InlinePragma {
+    @Inline   
+    public static Address allocArray(int arrayLen, int elemSize, int allocationHandle) {
         if (arrayLen >= 0) {
             int firstElementOffset = ARRAY_LEN_OFFSET + (elemSize==8?8:4);
             int size = firstElementOffset + elemSize*arrayLen;
             size = (((size + (GC_OBJECT_ALIGNMENT - 1)) & (~(GC_OBJECT_ALIGNMENT - 1))));
 
             Address arrayAddress = alloc(size, allocationHandle); //never null!
-            arrayAddress.store(arrayLen, Offset.fromInt(ARRAY_LEN_OFFSET));
+            arrayAddress.store(arrayLen, Offset.fromIntZeroExtend(ARRAY_LEN_OFFSET));
             return arrayAddress;
         }
-        return VMHelper.newVectorUsingAllocHandle(arrayLen, elemSize, allocationHandle);
+        return VMHelper.newVectorUsingAllocHandle(arrayLen, allocationHandle);
     }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/prepare.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/prepare.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/prepare.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/prepare.cpp Tue Feb 13 03:10:35 2007
@@ -64,7 +64,7 @@
     unsigned idx;
     for(idx = 0; idx < num_fields; idx++) {
         Field_Handle fh = class_get_instance_field_recursive(ch, idx);
-        if(field_is_reference(fh)) {
+        if(field_is_gc_enumerable(fh)) {
             num_ref_fields++;
         }
     }
@@ -93,7 +93,7 @@
 
     for(idx = 0; idx < num_fields; idx++) {
         Field_Handle fh = class_get_instance_field_recursive(ch, idx);
-        if(field_is_reference(fh)) {
+        if(field_is_gc_enumerable(fh)) {
             int offset = field_get_offset(fh);
             if (offset == skip) continue;
             *refs = offset;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/GCHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/GCHelper.java?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/GCHelper.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc/org/apache/harmony/drlvm/gc_gen/GCHelper.java Tue Feb 13 03:10:35 2007
@@ -33,7 +33,8 @@
 
     public static final int TLS_GC_OFFSET = TLSGCOffset();
 
-    public static Address alloc(int objSize, int allocationHandle)  throws InlinePragma {
+    @Inline
+    public static Address alloc(int objSize, int allocationHandle) {
         Address TLS_BASE = VMHelper.getTlsBaseAddress();
 
         Address allocator_addr = TLS_BASE.plus(TLS_GC_OFFSET);
@@ -56,17 +57,18 @@
     private static final int ARRAY_LEN_OFFSET = 8;
     private static final int GC_OBJECT_ALIGNMENT = 4; //TODO: EM64 or IPF could have 8!
 
-    public static Address allocArray(int arrayLen, int elemSize, int allocationHandle)  throws InlinePragma {
+    @Inline
+    public static Address allocArray(int arrayLen, int elemSize, int allocationHandle) {
         if (arrayLen >= 0) {
             int firstElementOffset = ARRAY_LEN_OFFSET + (elemSize==8?8:4);
             int size = firstElementOffset + elemSize*arrayLen;
             size = (((size + (GC_OBJECT_ALIGNMENT - 1)) & (~(GC_OBJECT_ALIGNMENT - 1))));
 
             Address arrayAddress = alloc(size, allocationHandle); //never null!
-            arrayAddress.store(arrayLen, Offset.fromInt(ARRAY_LEN_OFFSET));
+            arrayAddress.store(arrayLen, Offset.fromIntZeroExtend(ARRAY_LEN_OFFSET));
             return arrayAddress;
         }
-        return VMHelper.newVectorUsingAllocHandle(arrayLen, elemSize, allocationHandle);
+        return VMHelper.newVectorUsingAllocHandle(arrayLen, allocationHandle);
     }
 
     /** NOS (nursery object space) is higher in address than other spaces.
@@ -77,7 +79,8 @@
     public static Address NOS_BOUNDARY = getNosBoundary();
     public static boolean GEN_MODE = getGenMode();
 
-    public static void write_barrier_slot_rem(Address p_objBase, Address p_objSlot, Address p_target)  throws InlinePragma {
+    @Inline
+    public static void write_barrier_slot_rem(Address p_objBase, Address p_objSlot, Address p_target) {
       
        /* If the slot is in NOS or the target is not in NOS, we simply return*/
         if(p_objSlot.GE(NOS_BOUNDARY) || p_target.LT(NOS_BOUNDARY) || !GEN_MODE) {

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?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- 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 Feb 13 03:10:35 2007
@@ -70,7 +70,7 @@
   unsigned idx;
   for(idx = 0; idx < num_fields; idx++) {
     Field_Handle fh = class_get_instance_field_recursive(ch, idx);
-    if(field_is_reference(fh)) {
+    if(field_is_gc_enumerable(fh)) {
       num_ref_fields++;
     }
   }
@@ -102,7 +102,7 @@
   int *result = new_ref_array;
   for(unsigned int idx = 0; idx < num_fields; idx++) {
     Field_Handle fh = class_get_instance_field_recursive(ch, idx);
-    if(field_is_reference(fh)) {
+    if(field_is_gc_enumerable(fh)) {
       int offset = field_get_offset(fh);
 #ifndef BUILD_IN_REFERENT
       if(is_reference && offset == gc_referent_offset) continue;

Modified: harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jit_intf.h Tue Feb 13 03:10:35 2007
@@ -196,6 +196,7 @@
                                             Method_Handle caller,
                                             Method_Handle callee);
 
+VMEXPORT Boolean method_has_annotation(Method_Handle target, Class_Handle antn_type);
 
 //
 // Class

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?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Tue Feb 13 03:10:35 2007
@@ -431,13 +431,13 @@
  VMEXPORT Class_Handle field_get_class(Field_Handle fh);
 
 /**
- * @return <code>TRUE</code> if the field is of a reference type.
+ * @return <code>TRUE</code> if the field must be enumerated by GC
  *
  * This function doesn't cause resolution of the class of the field.
  */
- VMEXPORT Boolean field_is_reference(Field_Handle fh);
+ VMEXPORT Boolean field_is_gc_enumerable(Field_Handle fh);
 
-/**
+ /**
  * @return <code>TRUE</code> if the field is literal. In Java, it means that the
  *          field had the ConstantValue attribute set (JVMS2, Section  4.7.2).
  */

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Tue Feb 13 03:10:35 2007
@@ -148,4 +148,6 @@
 -XDvm.component.classpath.hythr=hythr.jar
 
 #VM helpers
--Dvm.components.vmcore.startupclass=org.apache.harmony.drlvm.VMHelperFastPath
+-Dvm.components.vmcore1.startupclass=org.apache.harmony.drlvm.VMHelper
+-Dvm.components.vmcore2.startupclass=org.apache.harmony.drlvm.VMHelperFastPath
+

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp Tue Feb 13 03:10:35 2007
@@ -32,6 +32,8 @@
 
 /** see article:  "Static Branch Frequency and Program Profile Analysis / Wu, Laurus, IEEE/ACM 1994" */
 
+//TODO: avoid using postdom information. A lot of exceptions-paths make it useless.
+
 namespace Jitrino{
 
 DEFINE_SESSION_ACTION(StaticProfilerPass, statprof, "Perform edge annotation pass based on static heuristics");
@@ -188,20 +190,20 @@
 
 /** looks for unconditional path to inner loop header.
  */
-static bool hasUncondPathToInnerLoopHeader(Node* parentLoopHeader, LoopTree* loopTree,  Edge* edge) {
+static Node* findLoopHeaderOnUncondPath(Node* parentLoopHeader, LoopTree* loopTree,  Edge* edge) {
     Node* node = edge->getTargetNode();
     if (!node->isBlockNode() || node == parentLoopHeader) {
-        return false;
+        return NULL;
     }
 
     if (loopTree->isLoopHeader(node)) {
-        return true;
+        return node;
     }
     Edge* uncondEdge = node->getUnconditionalEdge();
     if (uncondEdge==NULL) {
-        return false;
+        return NULL;
     }
-    return hasUncondPathToInnerLoopHeader(parentLoopHeader, loopTree, uncondEdge);
+    return findLoopHeaderOnUncondPath(parentLoopHeader, loopTree, uncondEdge);
 }
 
 /** returns TRUE if
@@ -458,22 +460,25 @@
 
 
 /**  Loop header heuristic (LHH)
- *   Predict a successor that is a loop header or loop pre-header
- *   and does not post-dominate will be taken
+ *   Predict a successor that is a loop header or loop pre-header will be taken
  */
 static double loopHeaderHeuristic(const StaticProfilerContext* c) {
     Node* parentLoopHeader = c->loopTree->getLoopHeader(c->node, true);
     
-    bool edge1Accepted = hasUncondPathToInnerLoopHeader(parentLoopHeader, c->loopTree, c->edge1) 
-        && !c->postDomTree->dominates(c->edge1->getTargetNode(), c->node);
-    
-    bool edge2Accepted = hasUncondPathToInnerLoopHeader(parentLoopHeader, c->loopTree, c->edge2) 
-        && !c->postDomTree->dominates(c->edge2->getTargetNode(), c->node);
-    
-    if (edge1Accepted == edge2Accepted) {
+    Node* edge1Loop = findLoopHeaderOnUncondPath(parentLoopHeader, c->loopTree, c->edge1);
+    Node* edge2Loop = findLoopHeaderOnUncondPath(parentLoopHeader, c->loopTree, c->edge2);
+        
+    if ( (edge1Loop!=NULL && edge2Loop!=NULL) || edge2Loop==edge2Loop) {
+        return PROB_HEURISTIC_FAIL;
+    }
+    Node* edge1Target = c->edge1->getTargetNode();
+    Node* edge2Target = c->edge2->getTargetNode();
+    if ((edge1Loop != NULL && !c->domTree->dominates(edge1Target, edge1Loop))
+        || (edge2Loop != NULL && !c->domTree->dominates(edge2Target, edge2Loop))) 
+    {
         return PROB_HEURISTIC_FAIL;
     }
-    return edge1Accepted ? PROB_LOOP_HEADER_HEURISTIC : 1 - PROB_LOOP_HEADER_HEURISTIC;
+    return edge1Loop!=NULL? PROB_LOOP_HEADER_HEURISTIC : 1 - PROB_LOOP_HEADER_HEURISTIC;
 }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Tue Feb 13 03:10:35 2007
@@ -27,6 +27,8 @@
 
 namespace Jitrino {
 
+#define PRAGMA_INLINE "org/vmmagic/pragma/Inline"
+
 struct HelperInlinerFlags {
     const char* inlinerPipelineName;
 
@@ -53,8 +55,11 @@
 
 class HelperInlinerAction: public Action {
 public:
+    HelperInlinerAction() : inlinePragma(NULL){}
     void init();
     HelperInlinerFlags& getFlags() {return flags;}
+    
+    NamedType* inlinePragma;
 protected:
     HelperInlinerFlags flags;
 };
@@ -101,13 +106,13 @@
     flags.wb_signature = "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)V";
 
     READ_STANDARD_HELPER_FLAGS(ldInterface);
-    flags.ldInterface_signature = "(Ljava/lang/Object;I)Lorg/vmmagic/unboxed/Address;";
+    flags.ldInterface_signature = "(Ljava/lang/Object;Lorg/vmmagic/unboxed/Address;)Lorg/vmmagic/unboxed/Address;";
     
     READ_STANDARD_HELPER_FLAGS(checkCast);
-    flags.checkCast_signature = "(Ljava/lang/Object;IZZZI)Ljava/lang/Object;";
+    flags.checkCast_signature = "(Ljava/lang/Object;Lorg/vmmagic/unboxed/Address;ZZZI)Ljava/lang/Object;";
     
     READ_STANDARD_HELPER_FLAGS(instanceOf);
-    flags.instanceOf_signature = "(Ljava/lang/Object;IZZZI)Z";
+    flags.instanceOf_signature = "(Ljava/lang/Object;Lorg/vmmagic/unboxed/Address;ZZZI)Z";
 }
 
 
@@ -115,7 +120,7 @@
 public:
     HelperInliner(HelperInlinerSession* _sessionAction, MemoryManager& tmpMM, CompilationContext* _cc, Inst* _inst)  
         : flags(((HelperInlinerAction*)_sessionAction->getAction())->getFlags()), localMM(tmpMM), 
-        cc(_cc), inst(_inst), action(_sessionAction), method(NULL)
+        cc(_cc), inst(_inst), session(_sessionAction), method(NULL)
     {
         irm = cc->getHIRManager();
         instFactory = &irm->getInstFactory();
@@ -137,7 +142,7 @@
     MemoryManager& localMM;
     CompilationContext* cc;
     Inst* inst;
-    HelperInlinerSession* action;
+    HelperInlinerSession* session;
     MethodDesc*  method;
 
 //these fields used by almost every subclass -> cache them
@@ -160,6 +165,12 @@
         }\
         method = ensureClassIsResolvedAndInitialized(flags.flagPrefix##_className, flags.flagPrefix##_methodName, flags.flagPrefix##_signature);\
         if (!method) return;\
+        HelperInlinerAction* action = (HelperInlinerAction*)session->getAction();\
+        if (!action->inlinePragma) { \
+            action->inlinePragma = cc->getVMCompilationInterface()->resolveClassUsingBootstrapClassloader(PRAGMA_INLINE);\
+        } \
+        if (!action->inlinePragma) return;\
+        \
         doInline();\
     }\
     virtual void doInline();\
@@ -275,9 +286,11 @@
 
 typedef StlVector<MethodCallInst*> InlineVector;
 
-#define PRAGMA_INLINE "org/vmmagic/pragma/InlinePragma"
 
 void HelperInliner::inlineVMHelper(MethodCallInst* origCall) {
+    NamedType* inlinePragma = ((HelperInlinerAction*)session->getAction())->inlinePragma;
+    assert(inlinePragma!=0);
+
     InlineVector  methodsToInline(localMM);
     methodsToInline.push_back(origCall);
     while (!methodsToInline.empty()) {
@@ -293,7 +306,7 @@
         CompilationContext inlineCC(cc->getCompilationLevelMemoryManager(), ci, cc->getCurrentJITContext());
         inlineCC.setPipeline(cc->getPipeline());
 
-        Inliner inliner(action, localMM, *irm, false);
+        Inliner inliner(session, localMM, *irm, false);
         InlineNode* regionToInline = inliner.createInlineNode(inlineCC, call);
 
         inliner.connectRegion(regionToInline);
@@ -311,15 +324,10 @@
                 if (inst->isMethodCall()) {
                     MethodCallInst* methodCall = inst->asMethodCallInst();
                     MethodDesc* md = methodCall->getMethodDesc();
-                    uint32 nThrows = md->getNumThrows();
-                    for (uint32 i=0; i<nThrows;i++) {
-                        NamedType* type = md->getThrowType(i);
-                        const char* name = type->getName();
-                        if (!strcmp(name, PRAGMA_INLINE)) {
-                            methodsToInline.push_back(methodCall);
-                            if (Log::isEnabled()) {
-                                Log::out()<<"Found InlinePragma, adding to the queue:";methodCall->print(Log::out());Log::out()<<std::endl;
-                            }
+                    if (md->hasAnnotation(inlinePragma)) {
+                        methodsToInline.push_back(methodCall);
+                        if (Log::isEnabled()) {
+                            Log::out()<<"Found Inline pragma, adding to the queue:";methodCall->print(Log::out());Log::out()<<std::endl;
                         }
                     }
                 }
@@ -563,10 +571,15 @@
 
     Opnd* baseOpnd = inst->getSrc(0);
     assert(baseOpnd->getType()->isObject());
+    
     Type* type = inst->asTypeInst()->getTypeInfo();
-    int typeId = (int)type->asNamedType()->getRuntimeIdentifier(); //TODO: EM64T or IPF incompatible convertion
-    Opnd* typeOpnd  = opndManager->createSsaTmpOpnd(typeManager->getInt32Type());
-    instFactory->makeLdConst(typeOpnd, typeId)->insertBefore(inst);
+    Opnd* typeOpnd  = opndManager->createSsaTmpOpnd(typeManager->getUnmanagedPtrType(typeManager->getInt8Type()));
+    Opnd* typeValOpnd = opndManager->createSsaTmpOpnd(typeManager->getUIntPtrType());
+    void* typeId = type->asNamedType()->getRuntimeIdentifier();
+    instFactory->makeLdConst(typeValOpnd, (int)typeId)->insertBefore(inst); //TODO: fix this for EM64T
+    Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
+    instFactory->makeConv(mod, Type::UnmanagedPtr, typeOpnd, typeValOpnd)->insertBefore(inst);
+    
     Opnd* resOpnd = inst->getDst();
     Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
     instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
@@ -599,15 +612,19 @@
     assert(type->isObject());
     ObjectType* castType = type->asObjectType();
 
-    int  typeId = (int)castType->getRuntimeIdentifier();
+    void* typeId = castType->getRuntimeIdentifier();
     bool isArrayType = castType->isArrayType();
     bool isInterfaceType = castType->isInterface();
     bool isFastInstanceOf = castType->getFastInstanceOfFlag();
     bool isFinalTypeCast = castType->isFinalClass();
     int  fastCheckDepth = isFastInstanceOf ? castType->getClassDepth() : 0;
     
-    Opnd* typeIdOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); //TODO: em64t & ipf!
-    instFactory->makeLdConst(typeIdOpnd, typeId)->insertBefore(inst);
+    Opnd* typeValOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); 
+    instFactory->makeLdConst(typeValOpnd, (int)typeId)->insertBefore(inst);//TODO: em64t & ipf!
+
+    Opnd* typeOpnd = opndManager->createSsaTmpOpnd(typeManager->getUnmanagedPtrType(typeManager->getInt8Type())); 
+    Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
+    instFactory->makeConv(mod, Type::UnmanagedPtr, typeOpnd, typeValOpnd)->insertBefore(inst);
 
     Opnd* isArrayOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
     instFactory->makeLdConst(isArrayOpnd, isArrayType)->insertBefore(inst);
@@ -624,7 +641,7 @@
     Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
     instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
 
-    Opnd* args[6] = {objOpnd, typeIdOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
+    Opnd* args[6] = {objOpnd, typeOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
     MethodCallInst* call = instFactory->makeDirectCall(opndManager->getNullOpnd(), tauSafeOpnd, tauSafeOpnd, 6, args, method)->asMethodCallInst();
     
     call->insertBefore(inst);
@@ -655,15 +672,19 @@
     assert(type->isObject());
     ObjectType* castType = type->asObjectType();
 
-    int  typeId = (int)castType->getRuntimeIdentifier();
+    void* typeId = castType->getRuntimeIdentifier();
     bool isArrayType = castType->isArrayType();
     bool isInterfaceType = castType->isInterface();
     bool isFastInstanceOf = castType->getFastInstanceOfFlag();
     bool isFinalTypeCast = castType->isFinalClass();
     int  fastCheckDepth = isFastInstanceOf ? castType->getClassDepth() : 0;
 
-    Opnd* typeIdOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); //TODO: em64t & ipf!
-    instFactory->makeLdConst(typeIdOpnd, typeId)->insertBefore(inst);
+    Opnd* typeValOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); 
+    instFactory->makeLdConst(typeValOpnd, (int)typeId)->insertBefore(inst);//TODO: em64t & ipf!
+
+    Opnd* typeOpnd = opndManager->createSsaTmpOpnd(typeManager->getUnmanagedPtrType(typeManager->getInt8Type())); 
+    Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
+    instFactory->makeConv(mod, Type::UnmanagedPtr, typeOpnd, typeValOpnd)->insertBefore(inst);
 
     Opnd* isArrayOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
     instFactory->makeLdConst(isArrayOpnd, isArrayType)->insertBefore(inst);
@@ -680,7 +701,7 @@
     Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
     instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
 
-    Opnd* args[6] = {objOpnd, typeIdOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
+    Opnd* args[6] = {objOpnd, typeOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
     MethodCallInst* call = instFactory->makeDirectCall(inst->getDst(), tauSafeOpnd, tauSafeOpnd, 6, args, method)->asMethodCallInst();
 
     call->insertBefore(inst);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Tue Feb 13 03:10:35 2007
@@ -66,6 +66,7 @@
 
     const char* name = type->getName();    
     if (!strcmp(name, "org/vmmagic/unboxed/Address") 
+        //TODO: ObjectReference must have a ManagedPointer/Object type
         || !strcmp(name, "org/vmmagic/unboxed/ObjectReference")) 
     {
         return tm.getUnmanagedPtrType(tm.getInt8Type());
@@ -73,7 +74,7 @@
         || !strcmp(name, "org/vmmagic/unboxed/Offset")
         || !strcmp(name, "org/vmmagic/unboxed/Extent")) 
     {
-            return tm.getUIntPtrType();
+        return tm.getUIntPtrType();
     } else if (!strcmp(name, "org/vmmagic/unboxed/WordArray")
         || !strcmp(name, "org/vmmagic/unboxed/OffsetArray")
         || !strcmp(name, "org/vmmagic/unboxed/ExtentArray") 
@@ -1108,7 +1109,7 @@
         if (field->isInitOnly() && !field->getParentType()->needsInitialization()) {
             //the final static field of the initialized class
             Type* fieldType = field->getFieldType();
-            if (field->getFieldType()->isNumeric()) {
+            if (field->getFieldType()->isNumeric() || field->getFieldType()->isBoolean()) {
                 Opnd* constVal = NULL;
                 void* fieldAddr = field->getAddress();
                 switch(fieldType->tag) {
@@ -1119,6 +1120,7 @@
                     case Type::Int64:   constVal=irBuilder.genLdConstant(*(int64*)fieldAddr);break;
                     case Type::Float:   constVal=irBuilder.genLdConstant(*(float*)fieldAddr);break;
                     case Type::Double:  constVal=irBuilder.genLdConstant(*(double*)fieldAddr);break;
+                    case Type::Boolean: constVal=irBuilder.genLdConstant(*(bool*)fieldAddr);break;
                     default: assert(0); //??
                 }
                 if (constVal != NULL) {
@@ -3808,7 +3810,7 @@
     //
     // fromXXX, toXXX - static creation from something
     //
-    if (!strcmp(mname, "fromInt") 
+    if (!strcmp(mname, "fromLong") 
         || !strcmp(mname, "fromIntSignExtend") 
         || !strcmp(mname, "fromIntZeroExtend")
         || !strcmp(mname, "fromObject")  
@@ -4013,7 +4015,7 @@
     }
 
     if (!strcmp(mname,"newVectorUsingAllocHandle")) {
-        assert(numArgs == 3);
+        assert(numArgs == 2);
         Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_NewVector_UsingVtable, resType, numArgs, srcOpnds);
         pushOpnd(res);
         return;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Tue Feb 13 03:10:35 2007
@@ -160,6 +160,7 @@
     virtual uint32      getNumHandlers()    = 0;
     virtual uint32      getNumThrows()    = 0;
     virtual NamedType*  getThrowType(uint32 i) = 0;
+    virtual bool        hasAnnotation(NamedType* type) = 0;
     
     // Exception handler and signature parsing API
     virtual unsigned    parseJavaHandlers(ExceptionCallback&) = 0;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Tue Feb 13 03:10:35 2007
@@ -1059,4 +1059,8 @@
     return res;
 }
 
+bool DrlVMMethodDesc::hasAnnotation(NamedType* type) {
+    return method_has_annotation(drlMethod, (Class_Handle)type->getVMTypeHandle());
+}
+
 } //namespace Jitrino

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h Tue Feb 13 03:10:35 2007
@@ -278,6 +278,7 @@
     uint32       getNumHandlers()  {return method_get_num_handlers(drlMethod);}
     uint32       getNumThrows() {return method_number_throws(drlMethod);}
     NamedType*   getThrowType(uint32 i);
+    bool         hasAnnotation(NamedType* type);
 
     //
     // accessors for method info, code and data

Modified: harmony/enhanced/drlvm/trunk/vm/thread/javasrc/org/apache/harmony/drlvm/thread/ThreadHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/javasrc/org/apache/harmony/drlvm/thread/ThreadHelper.java?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/javasrc/org/apache/harmony/drlvm/thread/ThreadHelper.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/javasrc/org/apache/harmony/drlvm/thread/ThreadHelper.java Tue Feb 13 03:10:35 2007
@@ -32,12 +32,14 @@
 
     public static final int TLS_THREAD_ID_OFFSET=getThreadIdOffset();
 
-    static int getThreadId() throws InlinePragma {
+    @Inline
+    static int getThreadId() {
         Address tlsAddr = VMHelper.getTlsBaseAddress();
         Address tlsThreadIdFieldAddr = tlsAddr.plus(TLS_THREAD_ID_OFFSET);
         return tlsThreadIdFieldAddr.loadInt();
     }
 
+    @Inline
     static void monitorEnterUseReservation(Object obj) {
         Address lockWordPtr = ObjectReference.fromObject(obj).toAddress().plus(LOCK_WORD_OFFSET);
         int threadId = getThreadId();
@@ -85,6 +87,7 @@
     public static final int FAT_LOCK_MASK = 0x80000000;
     public static final int RECURSION_MASK = 0x0000f800;
 
+    @Inline
     static void monitorExit(Object obj) {
         Address lockWordPtr = ObjectReference.fromObject(obj).toAddress().plus(LOCK_WORD_OFFSET);
         int lockword = lockWordPtr.loadInt();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h Tue Feb 13 03:10:35 2007
@@ -174,6 +174,7 @@
         _field_type_desc = 0;
         _offset_computed = 0;
         _is_injected = 0;
+        _is_magic_type = 0;
         track_access = 0;
         track_modification = 0;
     }
@@ -212,7 +213,7 @@
     unsigned is_volatile()  {return (_access_flags&ACC_VOLATILE);} 
     unsigned is_transient() {return (_access_flags&ACC_TRANSIENT);} 
     bool is_enum()          {return (_access_flags&ACC_ENUM)?true:false;} 
-
+    
     bool parse(Global_Env& env, Class* clss, ByteReader& cfs);
 
     unsigned calculate_size();
@@ -223,6 +224,8 @@
     Boolean is_injected() {return _is_injected;}
     void set_injected() { _is_injected = 1; }
 
+    Boolean is_magic_type()    {return  _is_magic_type;}
+    
     void set_track_access(bool value) {
         track_access = value ? 1 : 0 ;
     }
@@ -252,6 +255,7 @@
     Const_Java_Value const_value;
     TypeDesc* _field_type_desc;
     unsigned _is_injected : 1;
+    unsigned _is_magic_type : 1;
     unsigned _offset_computed : 1;
 
     /** Turns on sending FieldAccess events on access to this field */

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Tue Feb 13 03:10:35 2007
@@ -1790,11 +1790,11 @@
 } //field_get_class_of_field_value
 
 
-Boolean field_is_reference(Field_Handle fh)
+Boolean field_is_gc_enumerable(Field_Handle fh)
 {
     assert((Field *)fh);
     Java_Type typ = field_get_type(fh);
-    return typ == JAVA_TYPE_CLASS || typ == JAVA_TYPE_ARRAY;
+    return (typ == JAVA_TYPE_CLASS || typ == JAVA_TYPE_ARRAY) && !fh->is_magic_type();
 } //field_is_reference
 
 
@@ -2752,4 +2752,31 @@
     }
     destroy_property_value(value);
     return return_value;
+}
+
+
+static Annotation* lookup_annotation(AnnotationTable* table, Class* owner, Class* antn_type) {
+    for (unsigned i = table->length - 1; i >= 0; --i) {
+        Annotation* antn = table->table[i];
+        Type_Info_Handle tih = (Type_Info_Handle) type_desc_create_from_java_descriptor(antn->type->bytes, owner->get_class_loader());
+        if (tih) {
+            Class* type = type_info_get_class(tih);
+            if (antn_type == type) {
+                return antn;
+            }
+        }
+    }
+    LOG("No such annotation " << antn_type->get_name()->bytes);
+    return NULL;
+}
+
+
+Boolean method_has_annotation(Method_Handle target, Class_Handle antn_type) {
+    assert(target);
+    assert(antn_type);
+    if (target->get_declared_annotations()) {
+        Annotation* antn = lookup_annotation(target->get_declared_annotations(), target->get_class(), antn_type);
+        return antn!=NULL;
+    }
+    return false;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Tue Feb 13 03:10:35 2007
@@ -739,6 +739,22 @@
     // DIE( "unreachable code!" ); // exclude remark #111: statement is unreachable
 }
 
+static bool is_magic_type_name(const String* name) {
+    static String* MAGIC_TYPE_NAMES[]={
+        VM_Global_State::loader_env->string_pool.lookup("org/vmmagic/unboxed/Address"),
+        VM_Global_State::loader_env->string_pool.lookup("org/vmmagic/unboxed/Offset"), 
+        VM_Global_State::loader_env->string_pool.lookup("org/vmmagic/unboxed/Word"),
+        VM_Global_State::loader_env->string_pool.lookup("org/vmmagic/unboxed/Extent"),
+        NULL
+    };
+    for (int i=0;;i++)    {
+        String* magicClassName = MAGIC_TYPE_NAMES[i];
+        if (magicClassName == NULL) break;
+        if (magicClassName == name) return true;
+    }
+    return false;
+}
+
 //checks of field and method name depend on class version 
 static const uint16 JAVA5_CLASS_FILE_VERSION = 49;
 
@@ -791,6 +807,11 @@
             << "0x" << std::hex << _access_flags);
         return false;
     }
+
+    //check if field is magic type
+     if (is_magic_type_name(clss->get_name())) {
+         _is_magic_type = 1;
+     }
 
     //check field attributes
     uint16 attr_count;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp Tue Feb 13 03:10:35 2007
@@ -51,6 +51,11 @@
 #include "dump.h"
 
 
+static unsigned get_magic_type_size(Field* field) {
+    //all magic sizes use size==machine word today
+    return sizeof(char*);
+}
+
 // For Java currently, fields are not packed: an int16 occupies a full 32 bit word.
 // "do_field_compaction" is true, e.g., for packed ("sequential") layout.
 // If the "clss" pointer is non-NULL, the type must be that of an instance field and any
@@ -88,8 +93,10 @@
     case 'L': 
     case '[': 
         {
-            // compress static reference fields.
-            if (VM_Global_State::loader_env->compress_references) {
+            if (field->is_magic_type()) {
+                sz = get_magic_type_size(field);
+            } else if (VM_Global_State::loader_env->compress_references) {
+                // compress static reference fields.
                 sz = sizeof(COMPRESSED_REFERENCE);
             } else {
                 sz = OBJECT_REF_SIZE;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/root_set_enum_common.cpp Tue Feb 13 03:10:35 2007
@@ -95,8 +95,7 @@
                 for(unsigned i = 0; i < n_fields; i++) {
                     Field* f = c->get_field(i);
                     if(f->is_static()) {
-                        char desc0 = f->get_descriptor()->bytes[0];
-                        if(desc0 == 'L' || desc0 == '[') {
+                        if(field_is_gc_enumerable(f)) {
                             // The field is static and it is a reference.
                             if (global_env->compress_references) {
                                 vm_enumerate_compressed_root_reference((uint32 *)f->get_address(), FALSE);

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?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_trace.cpp Tue Feb 13 03:10:35 2007
@@ -100,7 +100,7 @@
         unsigned i;
         for (i = 0; i < num_fields; i++) {
             Field_Handle fh = class_get_instance_field_recursive(ch, i);
-            if (field_is_reference(fh)) {
+            if (field_is_gc_enumerable(fh)) {
                 int offset = field_get_offset(fh);
                 Slot slot((void*)((UDATA)referrer + offset));
                 if (slot.is_null()) continue;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java Tue Feb 13 03:10:35 2007
@@ -30,9 +30,11 @@
 
     public static Address getTlsBaseAddress() {fail(); return null;}
 
+    //TODO: allocation handle is int only on 32bit OS or (64bit OS && compressed mode)
     public static Address newResolvedUsingAllocHandleAndSize(int objSize, int allocationHandle) {fail(); return null;}
     
-    public static Address newVectorUsingAllocHandle(int arrayLen, int elemSize, int allocationHandle) {fail(); return null;}
+    //TODO: allocation handle is int only on 32bit OS or (64bit OS && compressed mode)
+    public static Address newVectorUsingAllocHandle(int arrayLen, int allocationHandle) {fail(); return null;}
 
     public static void monitorEnter(Object obj) {fail();}
 
@@ -40,13 +42,34 @@
 
     public static void writeBarrier(Address objBase, Address objSlot, Address source) {fail();}
 
-    public static Address getInterfaceVTable(Object obj, int intfTypeId) {fail(); return null;}
+    public static Address getInterfaceVTable(Object obj, Address intfTypePtr) {fail(); return null;}
  
-    public static Object checkCast(Object obj, int castType) {fail(); return null;}
+    public static Object checkCast(Object obj, Address castTypePtr) {fail(); return null;}
  
-    public static boolean instanceOf(Object obj, int castType) {fail(); return false;}
-
+    public static boolean instanceOf(Object obj, Address castTypePtr) {fail(); return false;}
 
     protected static void fail() {throw new RuntimeException("Not supported!");}
 
+
+    public static final int POINTER_TYPE_SIZE          = getPointerTypeSize();
+    public static final boolean COMPRESSED_REFS_MODE   = isCompressedRefsMode();
+    public static final boolean COMPRESSED_VTABLE_MODE = isCompressedVTableMode();
+    public static final long COMPRESSED_VTABLE_BASE_OFFSET    = getCompressedModeVTableBaseOffset();
+    public static final long COMPRESSED_REFS_OBJ_BASE_OFFSET  = getCompressedModeObjectBaseOffset();
+
+    /** @return pointer-type size. 4 or 8 */
+    private static native int getPointerTypeSize();
+
+    /** @return true if VM is run in compressed reference mode */
+    private static native boolean isCompressedRefsMode();
+
+    /** @return true if VM is run in compressed vtables mode */
+    private static native boolean isCompressedVTableMode();
+
+    /** @return vtable base offset if is in compressed-refs mode or -1*/
+    private static native long getCompressedModeVTableBaseOffset();
+
+    /** @return object base offset if is in compressed-refs mode or -1*/
+    private static native long getCompressedModeObjectBaseOffset();
 }
+

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java?view=diff&rev=506971&r1=506970&r2=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java Tue Feb 13 03:10:35 2007
@@ -21,10 +21,8 @@
 package org.apache.harmony.drlvm;
 
 import org.apache.harmony.drlvm.VMHelper;
-import org.vmmagic.unboxed.Address;
-import org.vmmagic.unboxed.ObjectReference;
-import org.vmmagic.unboxed.Offset;
-import org.vmmagic.pragma.InlinePragma;
+import org.vmmagic.unboxed.*;
+import org.vmmagic.pragma.*;
 
 public class VMHelperFastPath {
 
@@ -39,84 +37,92 @@
     private static final int CLASS_INF_TABLE_2_OFFSET = getVtableIntfTableOffset(2);
     private static final int CLASS_DEPTH_OFFSET = getClassDepthOffset();
 
-    private static final int POINTER_SIZE=4;//todo: em64 & ipf incompatible!
-
     private VMHelperFastPath() {}
 
+    @Inline
+    public static Address getVTableAddress(Object obj) {
+        Address objAddr = ObjectReference.fromObject(obj).toAddress();
+        if (VMHelper.COMPRESSED_VTABLE_MODE) {
+            int vtableOffset = objAddr.loadInt(Offset.fromIntZeroExtend(OBJ_VTABLE_OFFSET));
+            Address res = Address.fromLong(VMHelper.COMPRESSED_VTABLE_BASE_OFFSET + vtableOffset);
+            return res;
+        }
+        return objAddr.loadAddress(Offset.fromIntZeroExtend(OBJ_VTABLE_OFFSET));
+        
+    }
+
 
 //TODO: leave only one version 
 //TODO: refactor code to use getVtableIntfTableOffset method (+ avoid extra comparisons while refactoring)
 
-    public static Address getInterfaceVTable3(Object obj, int intfType)  {
-
-        Address objAddr = ObjectReference.fromObject(obj).toAddress();
-        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
-
-        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
-        if (inf0Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+    @Inline
+    public static Address getInterfaceVTable3(Object obj, Address intfType)  {
+        Address vtableAddr = getVTableAddress(obj);
+
+        Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_0_OFFSET));               
         }
     
-        int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
-        if (inf1Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_1_OFFSET));               
+        Address inf1Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_1_OFFSET));
+        if (inf1Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_1_OFFSET));               
         }
 
-        int inf2Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_2_OFFSET));
-        if (inf2Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_2_OFFSET));               
+        Address inf2Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_2_OFFSET));
+        if (inf2Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_2_OFFSET));               
         }
         //slow path version
         return VMHelper.getInterfaceVTable(obj, intfType);
     }
 
-    public static Address getInterfaceVTable2(Object obj, int intfType)  {
-        Address objAddr = ObjectReference.fromObject(obj).toAddress();
-        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
-
-        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
-        if (inf0Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+    @Inline
+    public static Address getInterfaceVTable2(Object obj, Address intfType)  {
+        Address vtableAddr = getVTableAddress(obj);
+
+        Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_0_OFFSET));               
         }
     
-        int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
-        if (inf1Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_1_OFFSET));               
+        Address inf1Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_1_OFFSET));
+        if (inf1Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_1_OFFSET));               
         }
 
         //slow path version
         return VMHelper.getInterfaceVTable(obj, intfType);
     }
 
-    public static Address getInterfaceVTable1(Object obj, int intfType)  {
-        Address objAddr = ObjectReference.fromObject(obj).toAddress();
-        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
-
-        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
-        if (inf0Type == intfType) {
-            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+    @Inline
+    public static Address getInterfaceVTable1(Object obj, Address intfType)  {
+        Address vtableAddr = getVTableAddress(obj);
+
+        Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type.EQ(intfType)) {
+            return vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TABLE_0_OFFSET));               
         }
     
         //slow path version
         return VMHelper.getInterfaceVTable(obj, intfType);
     }
 
-    public static boolean instanceOf(Object obj, int castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
+    @Inline
+    public static boolean instanceOf(Object obj, Address castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) {
         if (obj == null) {
             return false;
         }
         if (isInterface) {
-            Address objAddr = ObjectReference.fromObject(obj).toAddress();
-            Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
-
+            Address vtableAddr = getVTableAddress(obj);
 
-            int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
-            if (inf0Type == castType) {
+            Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));
+            if (inf0Type.EQ(castType)) {
                 return true;
             }
     
-            int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
-            if (inf1Type == castType) {
+            Address inf1Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_1_OFFSET));
+            if (inf1Type.EQ(castType)) {
                 return true;
             }
         } else if (!isArray && fastCheckDepth!=0) {
@@ -126,22 +132,21 @@
         
     }
 
-    public static Object checkCast(Object obj, int castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
+    @Inline
+    public static Object checkCast(Object obj, Address castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) {
         if (obj == null) {
             return obj;
         }
         if (isInterface) {
-            Address objAddr = ObjectReference.fromObject(obj).toAddress();
-            Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+            Address vtableAddr = getVTableAddress(obj);
 
-
-            int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
-            if (inf0Type == castType) {
+            Address inf0Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_0_OFFSET));
+            if (inf0Type.EQ(castType)) {
                 return obj;
             }
     
-            int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
-            if (inf1Type == castType) {
+            Address inf1Type = vtableAddr.loadAddress(Offset.fromIntZeroExtend(CLASS_INF_TYPE_1_OFFSET));
+            if (inf1Type.EQ(castType)) {
                 return obj;
             }
         } else if (!isArray && fastCheckDepth!=0 && fastClassInstanceOf(obj, castType, isFinalTypeCast, fastCheckDepth)) {
@@ -150,20 +155,21 @@
         return VMHelper.checkCast(obj, castType);
     }
 
-    public static boolean fastClassInstanceOf(Object obj, int castType, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
-        Address objAddr = ObjectReference.fromObject(obj).toAddress();
-        Address objVtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
-        int objClassType  = objVtableAddr.loadInt(Offset.fromInt(VTABLE_CLASS_OFFSET));//todo em64t & ipf incompat
+    @Inline
+    public static boolean fastClassInstanceOf(Object obj, Address castType, boolean isFinalTypeCast, int fastCheckDepth) {
+        Address objVtableAddr = getVTableAddress(obj);
+        Address objClassType  = objVtableAddr.loadAddress(Offset.fromIntZeroExtend(VTABLE_CLASS_OFFSET));
 
-        if (objClassType == castType) {
+        if (objClassType.EQ(castType)) {
             return true;
         }
         if (isFinalTypeCast) {
             return false;
         }
        
-        int depthSubType = objVtableAddr.loadInt(Offset.fromInt(VTABLE_SUPERCLASSES_OFFSET + POINTER_SIZE*(fastCheckDepth-1)));
-        return depthSubType == castType;
+        int subTypeOffset = VTABLE_SUPERCLASSES_OFFSET + VMHelper.POINTER_TYPE_SIZE*(fastCheckDepth-1);
+        Address depthSubType = objVtableAddr.loadAddress(Offset.fromIntZeroExtend(subTypeOffset));
+        return depthSubType.EQ(castType);
     }
 
 

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp?view=auto&rev=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp Tue Feb 13 03:10:35 2007
@@ -0,0 +1,59 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+
+#include "org_apache_harmony_drlvm_VMHelper.h"
+
+#include "open/vm.h"
+#include "open/vm_util.h"
+#include "environment.h"
+#include <assert.h>
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelper_getPointerTypeSize (JNIEnv *, jclass) {
+    return (jint)sizeof(void*);
+}
+
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_drlvm_VMHelper_isCompressedRefsMode(JNIEnv *, jclass) {
+    return (jboolean)VM_Global_State::loader_env->compress_references;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_drlvm_VMHelper_isCompressedVTableMode(JNIEnv *, jclass) {
+#ifdef USE_COMPRESSED_VTABLE_POINTERS
+    return true;
+#else
+    return false;
+#endif
+}
+
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeVTableBaseOffset(JNIEnv *, jclass) {
+    bool cm = (jboolean)VM_Global_State::loader_env->compress_references;
+    if (cm) {
+        return (jlong)vm_get_vtable_base();
+    }
+    return -1;
+}
+
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeObjectBaseOffset(JNIEnv *, jclass) {
+    bool cm = (jboolean)VM_Global_State::loader_env->compress_references;
+    if (cm) {
+        return (jlong)VM_Global_State::loader_env->heap_base;;
+    }
+    return -1;
+}

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h?view=auto&rev=506971
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h Tue Feb 13 03:10:35 2007
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#include <jni.h>
+
+
+/* Header for class org.apache.harmony.drlvm.VMHelperFastPath */
+
+#ifndef _ORG_APACHE_HARMONY_DRLVM_VMHELPER_H
+#define _ORG_APACHE_HARMONY_DRLVM_VMHELPER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelper_getPointerTypeSize
+  (JNIEnv *, jclass);
+
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_drlvm_VMHelper_isCompressedRefsMode
+  (JNIEnv *, jclass);
+
+JNIEXPORT jboolean JNICALL Java_org_apache_harmony_drlvm_VMHelper_isCompressedVTableMode
+(JNIEnv *, jclass);
+
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeVTableBaseOffset
+  (JNIEnv *, jclass);
+
+
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeObjectBaseOffset
+  (JNIEnv *, jclass);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ORG_APACHE_HARMONY_DRLVM_VMHELPER_H */

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message