harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r659128 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H5480/ vm/include/open/ vm/jitrino/config/em64t/ vm/jitrino/config/ia32/ vm/jitrino/src/codegenerator/ vm/jitrino/src/codegenerator/ia32/ vm/jitrino/src/codegenerator/ipf/ vm/j...
Date Thu, 22 May 2008 15:04:01 GMT
Author: mfursov
Date: Thu May 22 08:03:58 2008
New Revision: 659128

URL: http://svn.apache.org/viewvc?rev=659128&view=rev
Log:
fix for HARMONY-5814 [drlvm] remove extra synchronization helpers


Modified:
    harmony/enhanced/drlvm/trunk/src/test/regression/H5480/LooseMathTest.java
    harmony/enhanced/drlvm/trunk/vm/include/open/rt_helpers.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_aggressive.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.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/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/rt_helper_info.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_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/ipf/base/jit_runtime_support_ipf.cpp

Modified: harmony/enhanced/drlvm/trunk/src/test/regression/H5480/LooseMathTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H5480/LooseMathTest.java?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H5480/LooseMathTest.java (original)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H5480/LooseMathTest.java Thu May 22 08:03:58 2008
@@ -113,7 +113,7 @@
 
         d = rnd.nextDouble();
         //TODO current impl is less accurate for small values
-        double ulp = 1.e-9; //Math.ulp(StrictMath.tan(d));
+        ulp = 1.e-9; //Math.ulp(StrictMath.tan(d));
         
         ulp = Math.ulp(StrictMath.log1p(d));
         assertEquals("small d=" + d + " ulp="+ulp, StrictMath.log1p(d), Math.log1p(d), ulp);

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/rt_helpers.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/rt_helpers.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/rt_helpers.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/rt_helpers.h Thu May 22 08:03:58 2008
@@ -161,19 +161,10 @@
  * @return None.
  *
  * Acquire the monitor associated with the object.
- * Throw <code>java/lang/NullPointerException</code>, if the argument is null.
+ * Doesn't throw <code>java/lang/NullPointerException</code>, if the argument
+ * is null, it assumes that the argument is non-null. Passing a null argument
+ * will result in undefined behavior..
  */
-    VM_RT_MONITOR_ENTER_NON_NULL=304,
- /**
-  * @param Object
-  *
-  * @return None.
-  *
-  * Acquire the monitor associated with the object.
-  * This function is identical to <code>VM_RT_MONITOR_ENTER</code> except that it
-  * assumes that the argument is non-null. Passing a null argument
-  * will result in undefined behavior.
-  */
     VM_RT_MONITOR_EXIT=301,
 /**   
  * @param Object
@@ -181,41 +172,21 @@
  * @return None.
  *
  * Release the monitor associated with the object.
- * Throw <code>java/lang/NullPointerException</code>, if the argument is null.
+ * Doesn't throw <code>java/lang/NullPointerException</code>, if the argument
+ * is null, it assumes that the argument is non-null. Passing a null argument
+ * will result in undefined behavior.
  * Throw <code>java/lang/IllegalMonitorStateException</code>, if the current 
  * thread is not the owner of the lock.
  */
-    VM_RT_MONITOR_EXIT_NON_NULL=305,
-  
-/**
- * @param Object
- *
- * @return None.
- *
- * Release the monitor associated with the object.
- * This function is identical to <code>VM_RT_MONITOR_EXIT</code> except that it
- * assumes that the argument is non-null. Passing a null argument
- * will result in undefined behavior.
- * Throw <code>java/lang/IllegalMonitorStateException</code>, if the current thread
- * is not the owner of the lock.
- */
-    VM_RT_MONITOR_ENTER_STATIC=302,
+
+
+    VM_RT_CLASS_2_JLC=310,
 /**  
  * @param Class handle
  *
- * @return None.
- *
- * Acquire the monitor associated with the class passed as the argument.
- */
-    VM_RT_MONITOR_EXIT_STATIC=303,
-/**
- * @param Class handle
- *
- * @return None.
+ * @return pointer to java/lang/Class object.
  *
- * Release the monitor associated with the class passed as the argument.
- * Throw <code>java/lang/IllegalMonitorStateException</code>, if the current thread
- * is not the owner of the lock.
+ * Converts Class handle to java/lang/Class object.
  */
 
 ////

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf Thu May 22 08:03:58 2008
@@ -117,11 +117,11 @@
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE=off
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_hotnessPercent=1
 
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0=off
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0_hotnessPercent=1

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server_static.emconf Thu May 22 08:03:58 2008
@@ -71,11 +71,11 @@
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE=off
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE_hotnessPercent=1
 
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL=on
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL_hotnessPercent=1
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER=on
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_hotnessPercent=1
 
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL=on
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL_hotnessPercent=1
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT=on
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_hotnessPercent=1
 
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0=off
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0_hotnessPercent=1

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?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Thu May 22 08:03:58 2008
@@ -119,11 +119,11 @@
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE=on
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_hotnessPercent=1
 
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0=on
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0_hotnessPercent=1

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_aggressive.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_aggressive.emconf?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_aggressive.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_aggressive.emconf Thu May 22 08:03:58 2008
@@ -113,11 +113,11 @@
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE=on
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_hotnessPercent=1
 
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL=on
--XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL_hotnessPercent=1
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT=on
+-XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_hotnessPercent=1
 
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0=on
 -XX:jit.SD2_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0_hotnessPercent=1

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf Thu May 22 08:03:58 2008
@@ -71,11 +71,11 @@
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE=on
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_NEW_VECTOR_USING_VTABLE_hotnessPercent=1
 
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL=on
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_NON_NULL_hotnessPercent=1
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER=on
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_ENTER_hotnessPercent=1
 
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL=on
--XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_NON_NULL_hotnessPercent=1
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT=on
+-XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_MONITOR_EXIT_hotnessPercent=1
 
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0=on
 -XX:jit.SS_OPT.arg.optimizer.inline_helpers.VM_RT_GET_INTERFACE_VTABLE_VER0_hotnessPercent=1

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h Thu May 22 08:03:58 2008
@@ -252,6 +252,7 @@
     virtual CG_OpndHandle*  tau_ldVTableAddr(Type *dstType, CG_OpndHandle* base,
                                              CG_OpndHandle *tauBaseNonNull) = 0;
     virtual CG_OpndHandle*  getVTableAddr(Type *dstType, ObjectType *base) = 0;
+    virtual CG_OpndHandle*  getClassObj(Type *dstType, ObjectType *base) = 0;
     virtual CG_OpndHandle*  tau_ldIntfTableAddr(Type *dstType, CG_OpndHandle* base, 
                                                 NamedType* vtableType) = 0;
     virtual CG_OpndHandle*  call(U_32 numArgs, CG_OpndHandle** args, Type* retType,

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Thu May 22 08:03:58 2008
@@ -1616,6 +1616,19 @@
 }
 
 //_______________________________________________________________________________________________________________
+//  get java.lang.Object
+
+CG_OpndHandle* InstCodeSelector::getClassObj(Type *       dstType, ObjectType * base) 
+{
+    Opnd * helperOpnds[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, base)};
+    Opnd * retOpnd=irManager.newOpnd(dstType);
+    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_CLASS_2_JLC,
+        1, helperOpnds, retOpnd);
+    appendInsts(callInst);
+    return retOpnd;
+}
+
+//_______________________________________________________________________________________________________________
 //  Load double FP constant (unoptimized straightforward version)
 
 CG_OpndHandle* InstCodeSelector::ldc_s(float val) 
@@ -2915,8 +2928,8 @@
     //vmhelper slow paths
     case VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE:
     case VM_RT_NEW_VECTOR_USING_VTABLE:
-    case VM_RT_MONITOR_ENTER_NON_NULL:
-    case VM_RT_MONITOR_EXIT_NON_NULL:
+    case VM_RT_MONITOR_ENTER:
+    case VM_RT_MONITOR_EXIT:
     case VM_RT_GC_HEAP_WRITE_REF:
     case VM_RT_GET_INTERFACE_VTABLE_VER0:
     case VM_RT_CHECKCAST:
@@ -3005,7 +3018,7 @@
 void InstCodeSelector::tau_monitorEnter(CG_OpndHandle* obj, CG_OpndHandle* tauIsNonNull) 
 {
     Opnd * helperOpnds[] = { (Opnd*)obj };
-    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER_NON_NULL,
+    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER,
         1, helperOpnds, NULL);
     appendInsts(callInst);
 }
@@ -3017,7 +3030,7 @@
                                           CG_OpndHandle* tauIsNonNull) 
 {
     Opnd * helperOpnds[] = { (Opnd*)obj };
-    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT_NON_NULL,
+    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT,
         1, helperOpnds, NULL);
     appendInsts(callInst);
 }
@@ -3082,10 +3095,16 @@
 
 void InstCodeSelector::typeMonitorEnter(NamedType *type) 
 {
-    Opnd * helperOpnds[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)};
-    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER_STATIC,
-        1, helperOpnds, NULL);
-    appendInsts(callInst);
+    Opnd * helperOpnds1[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)};
+    Opnd * retOpnd=irManager.newOpnd(type);
+    CallInst * callInst1=irManager.newRuntimeHelperCallInst(VM_RT_CLASS_2_JLC,
+        1, helperOpnds1, retOpnd);
+    appendInsts(callInst1);
+
+    Opnd * helperOpnds2[]={retOpnd};
+    CallInst * callInst2=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER,
+        1, helperOpnds2, NULL);
+    appendInsts(callInst2);
 }
 
 //_______________________________________________________________________________________________________________
@@ -3094,10 +3113,16 @@
 
 void InstCodeSelector::typeMonitorExit(NamedType *type) 
 {
-    Opnd * helperOpnds[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)};
-    CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT_STATIC,
-        1, helperOpnds, NULL);
-    appendInsts(callInst);
+    Opnd * helperOpnds1[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)};
+    Opnd * retOpnd=irManager.newOpnd(type);
+    CallInst * callInst1=irManager.newRuntimeHelperCallInst(VM_RT_CLASS_2_JLC,
+        1, helperOpnds1, retOpnd);
+    appendInsts(callInst1);
+
+    Opnd * helperOpnds2[]={retOpnd};
+    CallInst * callInst2=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT,
+        1, helperOpnds2, NULL);
+    appendInsts(callInst2);
 }
 
 //_______________________________________________________________________________________________________________

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h Thu May 22 08:03:58 2008
@@ -204,6 +204,7 @@
                                 MethodDesc *desc, CG_OpndHandle *tauVtableHasDesc);
     CG_OpndHandle* tau_ldVTableAddr(Type *dstType, CG_OpndHandle* base, CG_OpndHandle *tauBaseNonNull);
     CG_OpndHandle* getVTableAddr(Type *dstType, ObjectType *base);
+    CG_OpndHandle* getClassObj(Type *dstType, ObjectType *base);
     CG_OpndHandle* tau_ldIntfTableAddr(Type *dstType, CG_OpndHandle* base,NamedType* vtableTypeDesc);
     CG_OpndHandle* calli(U_32 numArgs,CG_OpndHandle** args, Type* retType,
                          CG_OpndHandle* methodPtr);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp Thu May 22 08:03:58 2008
@@ -1831,6 +1831,28 @@
 }
 
 //----------------------------------------------------------------------------//
+// get java.langObject
+
+CG_OpndHandle *IpfInstCodeSelector::getClassObj(Type       *dstType, 
+                                                  ObjectType *base) {
+
+    IPF_LOG << "      getClassObj" << endl;
+
+    uint64 typeRuntimeId = (uint64) base->getRuntimeIdentifier();
+    Opnd   *helperArgs1[] = { opndManager->newImm(typeRuntimeId) };
+
+    VM_RT_SUPPORT hId1 = VM_RT_CLASS_2_JLC;
+    uint64  address1        = (uint64) compilationInterface.getRuntimeHelperAddress(hId1);
+    Opnd*   helperAddress1  = opndManager->newImm(address1);
+    OpndKind opndKind       = toOpndKind(dstType->tag);
+    DataKind dataKind       = toDataKind(dstType->tag);
+    RegOpnd* retOpnd        = opndManager->newRegOpnd(opndKind, dataKind);
+    
+    directCall(1, helperArgs1, retOpnd, helperAddress1, p0);
+    return retOpnd; 
+}
+
+//----------------------------------------------------------------------------//
 // Load interface table address
 
 CG_OpndHandle *IpfInstCodeSelector::tau_ldIntfTableAddr(Type          *dstType, 
@@ -2074,7 +2096,7 @@
     
     Opnd *helperArgs[] = { (Opnd *)obj };
 
-    VM_RT_SUPPORT hId = VM_RT_MONITOR_ENTER_NON_NULL;
+    VM_RT_SUPPORT hId = VM_RT_MONITOR_ENTER;
     uint64  address        = (uint64) compilationInterface.getRuntimeHelperAddress(hId);
     Opnd    *helperAddress = opndManager->newImm(address);
     
@@ -2091,7 +2113,7 @@
 
     Opnd *helperArgs[] = { (Opnd *)obj };
 
-    VM_RT_SUPPORT hId = VM_RT_MONITOR_EXIT_NON_NULL;
+    VM_RT_SUPPORT hId = VM_RT_MONITOR_EXIT;
     uint64  address        = (uint64) compilationInterface.getRuntimeHelperAddress(hId);
     Opnd    *helperAddress = opndManager->newImm(address);
     
@@ -2106,13 +2128,24 @@
     IPF_LOG << "      typeMonitorEnter" << endl;
 
     uint64 typeRuntimeId = (uint64) type->getRuntimeIdentifier();
-    Opnd   *helperArgs[] = { opndManager->newImm(typeRuntimeId) };
+    Opnd   *helperArgs1[] = { opndManager->newImm(typeRuntimeId) };
 
-    VM_RT_SUPPORT hId = VM_RT_MONITOR_ENTER_STATIC;
-    uint64  address        = (uint64) compilationInterface.getRuntimeHelperAddress(hId);
-    Opnd    *helperAddress = opndManager->newImm(address);
+    VM_RT_SUPPORT hId1 = VM_RT_CLASS_2_JLC;
+    uint64  address1        = (uint64) compilationInterface.getRuntimeHelperAddress(hId1);
+    Opnd*   helperAddress1  = opndManager->newImm(address1);
+    OpndKind opndKind       = toOpndKind(type->tag);
+    DataKind dataKind       = toDataKind(type->tag);
+    RegOpnd* retOpnd        = opndManager->newRegOpnd(opndKind, dataKind);
     
-    directCall(1, helperArgs, NULL, helperAddress, p0);
+    directCall(1, helperArgs1, retOpnd, helperAddress1, p0);
+
+    Opnd   *helperArgs2[] = { retOpnd };
+
+    VM_RT_SUPPORT hId2 = VM_RT_MONITOR_ENTER;
+    uint64  address2        = (uint64) compilationInterface.getRuntimeHelperAddress(hId2);
+    Opnd*   helperAddress2  = opndManager->newImm(address2);
+    
+    directCall(1, helperArgs2, NULL, helperAddress2, p0);
 }
 
 //----------------------------------------------------------------------------//
@@ -2123,13 +2156,24 @@
     IPF_LOG << "      typeMonitorExit" << endl;
 
     uint64 typeRuntimeId = (uint64) type->getRuntimeIdentifier();
-    Opnd   *helperArgs[] = { opndManager->newImm(typeRuntimeId) };
+    Opnd   *helperArgs1[] = { opndManager->newImm(typeRuntimeId) };
 
-    VM_RT_SUPPORT hId = VM_RT_MONITOR_EXIT_STATIC;
-    uint64  address        = (uint64) compilationInterface.getRuntimeHelperAddress(hId);
-    Opnd    *helperAddress = opndManager->newImm(address);
+    VM_RT_SUPPORT hId1 = VM_RT_CLASS_2_JLC;
+    uint64  address1        = (uint64) compilationInterface.getRuntimeHelperAddress(hId1);
+    Opnd*   helperAddress1  = opndManager->newImm(address1);
+    OpndKind opndKind       = toOpndKind(type->tag);
+    DataKind dataKind       = toDataKind(type->tag);
+    RegOpnd* retOpnd        = opndManager->newRegOpnd(opndKind, dataKind);
     
-    directCall(1, helperArgs, NULL, helperAddress, p0);
+    directCall(1, helperArgs1, retOpnd, helperAddress1, p0);
+
+    Opnd   *helperArgs2[] = { retOpnd };
+
+    VM_RT_SUPPORT hId2 = VM_RT_MONITOR_EXIT;
+    uint64  address2        = (uint64) compilationInterface.getRuntimeHelperAddress(hId2);
+    Opnd*   helperAddress2  = opndManager->newImm(address2);
+    
+    directCall(1, helperArgs2, NULL, helperAddress2, p0);
 }
 
 //----------------------------------------------------------------------------//

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h Thu May 22 08:03:58 2008
@@ -207,6 +207,7 @@
     CG_OpndHandle *tau_ldVirtFunAddr(Type*, CG_OpndHandle*, MethodDesc*, CG_OpndHandle*);
     CG_OpndHandle *tau_ldVTableAddr(Type*, CG_OpndHandle*, CG_OpndHandle*);
     CG_OpndHandle *getVTableAddr(Type*, ObjectType*);
+    CG_OpndHandle *getClassObj(Type*, ObjectType*);
     CG_OpndHandle *ldFieldAddr(Type*, CG_OpndHandle*, FieldDesc*);
     CG_OpndHandle *ldStaticAddr(Type*, FieldDesc*);
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp Thu May 22 08:03:58 2008
@@ -46,6 +46,10 @@
  * CallSig for monitor_enter and monitor_exit helpers.
  */
 static const CallSig cs_mon(CCONV_HELPERS, jvoid, jobj);
+/**
+ * CallSig for Class* to java.lang.Class helpers.
+ */
+static const CallSig cs_jlc(CCONV_HELPERS, jobj, jobj);
 
 
 void Compiler::gen_prolog(void) {
@@ -524,9 +528,13 @@
     
     
     if (meth_is_sync()) {
+        unsigned stackFix = 0;
         if (is_set(DBG_TRACE_CG)) { dbg(";;>monitor_enter\n"); }
         if (method_is_static(m_method)) {
-            gen_call_vm(cs_mon, rt_helper_monitor_enter_static, 0, m_klass);
+            gen_call_vm(cs_jlc, rt_helper_class_2_jlc, 0, m_klass);
+            gen_save_ret(cs_jlc);
+            stackFix = gen_stack_to_args(true, cs_mon, 0);
+            //gen_call_vm(cs_mon, rt_helper_monitor_enter_static, 0, m_klass);
         }
         else {
             AR gr = gr0;
@@ -543,8 +551,17 @@
                 ld(jobj, gr, m_base, voff(m_stack.thiz()));
                 st(jobj, gr, sp, cs_mon.off(0));
             }
-            gen_call_vm(cs_mon, rt_helper_monitor_enter, 1);
+            //gen_call_vm(cs_mon, rt_helper_monitor_enter, 1);
+        }
+        gen_call_vm(cs_mon, rt_helper_monitor_enter, 1);
+
+        if (method_is_static(m_method)) {
+            runlock(cs_mon);
+            if (stackFix != 0) {
+                alu(alu_sub, sp, stackFix);
+            }
         }
+
         if (is_set(DBG_TRACE_CG)) { dbg(";;>~monitor_enter\n"); }
     }
     
@@ -573,38 +590,49 @@
     }
     
     bool is_sync = meth_is_sync();
-    if (is_sync && meth_is_static()) {
-        if (is_set(DBG_TRACE_CG)) {
-            dbg(";;>monitor_exit\n");
-        }
-        gen_call_vm(cs_mon, rt_helper_monitor_exit_static, 0, m_klass);
-        if (is_set(DBG_TRACE_CG)) {
-            dbg(";;>~monitor_exit\n");
-        }
-    }
-    else if (is_sync) {
+    if (is_sync) {
+        unsigned stackFix = 0;
+
         if (is_set(DBG_TRACE_CG)) {
             dbg(";;>monitor_exit\n");
         }
-        AR gr = valloc(jobj);
-        if (cs_mon.reg(0) != gr_x) {
-            if (cs_mon.size() != 0) {
-                assert(cs_mon.caller_pops());
-                alu(alu_sub, sp, cs_mon.size());                    
-            }            
-            vpark(cs_mon.reg(0));
-            ld(jobj, cs_mon.reg(0), m_base, voff(m_stack.thiz()));
-        }
-        else {
-            assert(cs_mon.size() != 0);
-            alu(alu_sub, sp, cs_mon.size());
-            ld(jobj, gr, m_base, voff(m_stack.thiz()));
-            st(jobj, gr, sp, cs_mon.off(0));
+
+        if (meth_is_static()) {
+            gen_call_vm(cs_jlc, rt_helper_class_2_jlc, 0, m_klass);
+            gen_save_ret(cs_jlc);
+            stackFix = gen_stack_to_args(true, cs_mon, 0);
+            //gen_call_vm(cs_mon, rt_helper_monitor_exit_static, 0, m_klass);
+        } else {
+            AR gr = valloc(jobj);
+            if (cs_mon.reg(0) != gr_x) {
+                if (cs_mon.size() != 0) {
+                    assert(cs_mon.caller_pops());
+                    alu(alu_sub, sp, cs_mon.size());                    
+                }            
+                vpark(cs_mon.reg(0));
+                ld(jobj, cs_mon.reg(0), m_base, voff(m_stack.thiz()));
+            }
+            else {
+                assert(cs_mon.size() != 0);
+                alu(alu_sub, sp, cs_mon.size());
+                ld(jobj, gr, m_base, voff(m_stack.thiz()));
+                st(jobj, gr, sp, cs_mon.off(0));
+            }
+            //gen_call_vm(cs_mon, rt_helper_monitor_exit, 1);
         }
         gen_call_vm(cs_mon, rt_helper_monitor_exit, 1);
+
+        if (meth_is_static()) {
+            runlock(cs_mon);
+            if (stackFix != 0) {
+                alu(alu_sub, sp, stackFix);
+            }
+        }
+
         if (is_set(DBG_TRACE_CG)) {
             dbg(";;>~monitor_exit\n");
         }
+
     }
     
     if (compilation_params.exe_notify_method_exit) {

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=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Thu May 22 08:03:58 2008
@@ -1485,10 +1485,9 @@
                 (char*)vm_helper_get_addr(VM_RT_MONITOR_ENTER);
     rt_helper_monitor_exit  = 
                 (char*)vm_helper_get_addr(VM_RT_MONITOR_EXIT);
-    rt_helper_monitor_enter_static = 
-                (char*)vm_helper_get_addr(VM_RT_MONITOR_ENTER_STATIC);
-    rt_helper_monitor_exit_static = 
-                (char*)vm_helper_get_addr(VM_RT_MONITOR_EXIT_STATIC);
+
+    rt_helper_class_2_jlc = 
+                (char*)vm_helper_get_addr(VM_RT_CLASS_2_JLC);
     
     rt_helper_new_array = 
                 (char*)vm_helper_get_addr(VM_RT_NEW_VECTOR_USING_VTABLE);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.cpp Thu May 22 08:03:58 2008
@@ -37,8 +37,8 @@
 
 char *  StaticConsts::rt_helper_monitor_enter = NULL;
 char *  StaticConsts::rt_helper_monitor_exit = NULL;
-char *  StaticConsts::rt_helper_monitor_enter_static = NULL;
-char *  StaticConsts::rt_helper_monitor_exit_static = NULL;
+
+char *  StaticConsts::rt_helper_class_2_jlc = NULL;
 
 char *  StaticConsts::rt_helper_ldc_string = NULL;
 char *  StaticConsts::rt_helper_new = NULL;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/sconsts.h Thu May 22 08:03:58 2008
@@ -57,8 +57,8 @@
 
     static char *       rt_helper_monitor_enter;
     static char *       rt_helper_monitor_exit;
-    static char *       rt_helper_monitor_enter_static;
-    static char *       rt_helper_monitor_exit_static;
+
+    static char *       rt_helper_class_2_jlc;
 
     static char *       rt_helper_ldc_string;
     static char *       rt_helper_init_class;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp Thu May 22 08:03:58 2008
@@ -1198,6 +1198,16 @@
                 isConstant = true;
             }
             break;
+        case Op_GetClassObj:
+            {
+                assert(inst->getNumSrcOperands() == 0);
+                Type *type = ((TypeInst*)inst)->getTypeInfo();
+                assert(type->isObject() || type->isUserValue());
+                Type * dstType = inst->getDst()->getType();
+                assert(type->isObject());
+                cgInst = instructionCallback.getClassObj( dstType,(ObjectType*)type);
+            }
+            break;
         case Op_TauLdIntfcVTableAddr:
             {
                 assert(inst->getNumSrcOperands() == 1);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp Thu May 22 08:03:58 2008
@@ -2175,6 +2175,19 @@
 }
 
 Opnd*
+IRBuilder::genGetClassObj(ObjectType* type) {
+    assert(type->isClass() && (!type->isAbstract() || type->isArray()));
+    Opnd* dst = lookupHash(Op_GetClassObj, type->getId());
+    if (dst) return dst;
+
+    Type* dstType = irManager->getCompilationInterface().findClassUsingBootstrapClassloader(JAVA_LANG_CLASS);
+    dst = createOpnd(dstType);
+    appendInst(instFactory->makeGetClassObj(dst, type));
+    insertHash(Op_GetClassObj, type->getId(), dst->getInst());
+    return dst;
+}
+
+Opnd*
 IRBuilder::genLdVirtFunAddr(Opnd* base, MethodDesc* methodDesc) {
     base = propagateCopy(base);
     Opnd* dst = lookupHash(Op_TauLdVirtFunAddr, base->getId(), 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h Thu May 22 08:03:58 2008
@@ -318,6 +318,7 @@
                       Opnd *tauNonNullBase, Opnd *tauAddressInRange); // for simplifier use
     Opnd* genLdFunAddrSlot(MethodDesc* methodDesc); //SI
     Opnd* genGetVTable(ObjectType* type); //SI
+    Opnd* genGetClassObj(ObjectType* type);
     // compressed reference instructions
     Opnd* genUncompressRef(Opnd *compref); //SI
     Opnd* genCompressRef(Opnd *uncompref); //SI

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp Thu May 22 08:03:58 2008
@@ -2190,6 +2190,11 @@
     return makeTypeInst(Op_GetVTableAddr, Modifier(), dst->getType()->tag, dst, type);
 }
 
+Inst* InstFactory::makeGetClassObj(Opnd* dst, ObjectType *type) {
+    //makeTypeInst(Op_TypeMonitorEnter, Modifier(), Type::Void, OpndManager::getNullOpnd(), type);
+    return makeTypeInst(Op_GetClassObj, Modifier(), dst->getType()->tag, dst, type);
+}
+
 Inst* InstFactory::makeTauArrayLen(Opnd* dst, Type::Tag type, Opnd* base,
                                    Opnd *tauBaseIsNonNull,
                                    Opnd *tauBaseIsArray) {
@@ -2704,6 +2709,7 @@
     case Op_LdFunAddr:          return caseLdFunAddr(inst->asMethodInst());
     case Op_LdFunAddrSlot:      return caseLdFunAddrSlot(inst->asMethodInst());
     case Op_GetVTableAddr:      return caseGetVTableAddr(inst->asTypeInst());
+    case Op_GetClassObj:      return caseGetClassObj(inst->asTypeInst());
     case Op_TauArrayLen:           return caseTauArrayLen(inst);
     case Op_LdArrayBaseAddr:    return caseLdArrayBaseAddr(inst);
     case Op_AddScaledIndex:     return caseAddScaledIndex(inst);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h Thu May 22 08:03:58 2008
@@ -1150,6 +1150,7 @@
     Inst*    makeLdFunAddr(Opnd* dst, MethodDesc*);
     Inst*    makeLdFunAddrSlot(Opnd* dst, MethodDesc*);
     Inst*    makeGetVTableAddr(Opnd* dst, ObjectType *type);
+    Inst*    makeGetClassObj(Opnd* dst, ObjectType *type);
     Inst*    makeTauArrayLen(Opnd* dst, Type::Tag type, Opnd* base, Opnd *tauBaseNonNull,
                              Opnd *tauBaseIsArray);
     Inst*    makeLdArrayBaseAddr(Type* type, Opnd* dst, Opnd* array);
@@ -1714,6 +1715,9 @@
     caseGetVTableAddr(TypeInst* inst)=0;//      {return caseDefault(inst);}
 
     virtual Inst*
+    caseGetClassObj(TypeInst* inst)=0;//      {return caseDefault(inst);}
+
+    virtual Inst*
     caseTauArrayLen(Inst* inst)=0;//           {return caseDefault(inst);}
 
     virtual Inst*

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp Thu May 22 08:03:58 2008
@@ -143,7 +143,8 @@
     { Op_LdFunAddr,             false, MB::CSEable,       MK::None,                                  "ldfn  ",        "ldfn      [%d] -) %l",         },
     { Op_LdFunAddrSlot,         false, MB::CSEable,       MK::None,                                  "ldfnslot",      "ldfnslot  [%d] -) %l",         },
     { Op_GetVTableAddr,         false, MB::Movable,       MK::None,                                  "getvtable",     "getvtable %d -) %l",           }, // obtains the address of the vtable for a particular object type
-    { Op_TauArrayLen,           false, MB::CSEable,       MK::None,                                  "arraylen ",        "arraylen  %0 ((%1,%2)) -) %l",           },       
+    { Op_GetClassObj,           false, MB::Movable,       MK::None,                                  "getclassobj",   "getclassobj %d -) %l",           }, // obtains the java.lang.class  object for a particular type
+    { Op_TauArrayLen,           false, MB::CSEable,       MK::None,                                  "arraylen ",     "arraylen  %0 ((%1,%2)) -) %l",           },       
     { Op_LdArrayBaseAddr,       false, MB::CSEable,       MK::None,                                  "ldbase",        "ldbase    %s -) %l",           }, // load the base (zero'th element) address of array
     { Op_AddScaledIndex,        false, MB::Movable,       MK::None,                                  "addindex",      "addindex  %s -) %l",           }, // Add a scaled index to an array element address
     { Op_StVar,                 true,  MB::None,          MK::None,                                  "stvar ",        "stvar     %0 -) %l",           },

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h Thu May 22 08:03:58 2008
@@ -364,6 +364,7 @@
     Op_LdFunAddrSlot,
     // Move these to the loads
     Op_GetVTableAddr,               // obtains the address of the vtable for a particular object type
+    Op_GetClassObj,
     // array manipulation
     Op_TauArrayLen,        
     Op_LdArrayBaseAddr,             // load the base (zero'th element) address of array

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h Thu May 22 08:03:58 2008
@@ -193,6 +193,8 @@
 
     Inst* caseGetVTableAddr(TypeInst* inst) {return caseDefault(inst);}
 
+    Inst* caseGetClassObj(TypeInst* inst) {return caseDefault(inst);}
+
     Inst* caseAddScaledIndex(Inst* inst) {return caseDefault(inst);}
 
     Inst* caseStVar(Inst* inst) {return caseDefault(inst);}

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp Thu May 22 08:03:58 2008
@@ -326,6 +326,7 @@
                 ntype=NT_OBJECT;        // for 3 cases above
             case Op_LdRef:           // ldref
             case Op_LdConstant:      // ldc
+            case Op_GetClassObj:     // getclassobj
                 if (ntype==0) 
                     ntype=NT_LDOBJ;         // loads refs
             case Op_DefArg:          // defarg

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp Thu May 22 08:03:58 2008
@@ -516,6 +516,7 @@
     Inst* caseLdFunAddr(MethodInst* inst)           { return hashInst(inst); }
     Inst* caseLdFunAddrSlot(MethodInst* inst)       { return hashInst(inst); }
     Inst* caseGetVTableAddr(TypeInst* inst)         { return hashInst(inst); }
+    Inst* caseGetClassObj(TypeInst* inst)           { return hashInst(inst); }
 
     // array access
     Inst* caseTauArrayLen(Inst* inst) { 

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?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Thu May 22 08:03:58 2008
@@ -66,8 +66,8 @@
     
     registerHelper(Op_NewObj, VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE);
     registerHelper(Op_NewArray, VM_RT_NEW_VECTOR_USING_VTABLE);
-    registerHelper(Op_TauMonitorEnter, VM_RT_MONITOR_ENTER_NON_NULL);
-    registerHelper(Op_TauMonitorExit, VM_RT_MONITOR_EXIT_NON_NULL);
+    registerHelper(Op_TauMonitorEnter, VM_RT_MONITOR_ENTER);
+    registerHelper(Op_TauMonitorExit, VM_RT_MONITOR_EXIT);
     registerHelper(Op_TauStRef, VM_RT_GC_HEAP_WRITE_REF);
     registerHelper(Op_TauLdIntfcVTableAddr, VM_RT_GET_INTERFACE_VTABLE_VER0);
     registerHelper(Op_TauCheckCast, VM_RT_CHECKCAST);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp Thu May 22 08:03:58 2008
@@ -941,6 +941,7 @@
         case Op_LdFunAddr:
         case Op_LdFunAddrSlot:
         case Op_GetVTableAddr:
+        case Op_GetClassObj:
             return false;
         case Op_TauArrayLen:
         case Op_LdArrayBaseAddr:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp Thu May 22 08:03:58 2008
@@ -753,6 +753,14 @@
         }
         break;
 
+    case Op_GetClassObj:
+        {
+            thePass->effectNew(n, i, i->getDst());
+            thePass->effectWriteVtable(n, i, i->getDst());
+            thePass->effectReleaseObject(n, i, i->getDst());
+        }
+        break;
+
     case Op_TypeMonitorEnter:
         {
             TypeInst *tinst = i->asTypeInst();

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h Thu May 22 08:03:58 2008
@@ -609,6 +609,9 @@
 
     Inst* caseGetVTableAddr(TypeInst* inst) {return caseDefault(inst);}
 
+    Inst* caseGetClassObj(TypeInst* inst) {return caseDefault(inst);}
+
+
     // array access
     Inst* caseTauArrayLen(Inst* inst) {
         Opnd* opnd = simplifyTauArrayLen(inst->getDst()->getType(),

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp Thu May 22 08:03:58 2008
@@ -548,6 +548,13 @@
     case Op_LdFunAddr:
     case Op_LdFunAddrSlot:
     case Op_GetVTableAddr:
+        assert(0);        // not an object type
+
+    case Op_GetClassObj:
+        {
+            return genTauSafe();
+        }
+
     case Op_TauArrayLen:
     case Op_LdArrayBaseAddr:
     case Op_AddScaledIndex:

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?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Thu May 22 08:03:58 2008
@@ -189,7 +189,10 @@
     // check for synchronized methods
     if (methodToCompile.isSynchronized()) {
         if (methodToCompile.isStatic()) {
-            irBuilder.genTypeMonitorEnter(methodToCompile.getParentType());
+            //irBuilder.genTypeMonitorEnter(methodToCompile.getParentType());
+            Opnd* classObjectOpnd = irBuilder.genGetClassObj((ObjectType*) methodToCompile.getParentType());
+            pushOpnd(classObjectOpnd);
+            genMethodMonitorEnter();
         } else {
             genLdVar(0,JavaLabelPrepass::A);
             genMethodMonitorEnter();
@@ -1968,7 +1971,10 @@
         // go to unwind.
         cfgBuilder.genBlock(irBuilder.createLabel());
         if (methodToCompile.isStatic()) {
-            irBuilder.genTypeMonitorExit(methodToCompile.getParentType());
+            //irBuilder.genTypeMonitorExit(methodToCompile.getParentType());
+            Opnd* classObjectOpnd = irBuilder.genGetClassObj((ObjectType*) methodToCompile.getParentType());
+            pushOpnd(classObjectOpnd);
+            genMethodMonitorExit();
         } else {
             genLdVar(0,JavaLabelPrepass::A);
             genMethodMonitorExit();
@@ -1986,7 +1992,10 @@
         // go to unwind.
         cfgBuilder.genBlock(irBuilder.createLabel());
         if (methodToCompile.isStatic()) {
-            irBuilder.genTypeMonitorExit(methodToCompile.getParentType());
+           // irBuilder.genTypeMonitorExit(methodToCompile.getParentType());
+            Opnd* classObjectOpnd = irBuilder.genGetClassObj((ObjectType*) methodToCompile.getParentType());
+            pushOpnd(classObjectOpnd);
+            genMethodMonitorExit();
         } else {
             genLdVar(0,JavaLabelPrepass::A);
             genMethodMonitorExit();
@@ -2996,13 +3005,13 @@
 
     if (!strcmp(mname,"monitorEnter")) {
         assert(numArgs == 1);
-        irBuilder.genVMHelperCall(VM_RT_MONITOR_ENTER_NON_NULL, resType, numArgs, srcOpnds);
+        irBuilder.genVMHelperCall(VM_RT_MONITOR_ENTER, resType, numArgs, srcOpnds);
         return true;
     }
 
     if (!strcmp(mname,"monitorExit")) {
         assert(numArgs == 1);
-        irBuilder.genVMHelperCall(VM_RT_MONITOR_EXIT_NON_NULL, resType, numArgs, srcOpnds);
+        irBuilder.genVMHelperCall(VM_RT_MONITOR_EXIT, resType, numArgs, srcOpnds);
         return true;
     }
 

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?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Thu May 22 08:03:58 2008
@@ -25,6 +25,7 @@
 #include "open/em.h"
 #include "open/ee_em_intf.h"
 
+#define JAVA_LANG_CLASS                 "java/lang/Class"
 #define NULL_POINTER_EXCEPTION          "java/lang/NullPointerException"
 #define INDEX_OUT_OF_BOUNDS             "java/lang/ArrayIndexOutOfBoundsException"
 #define ARRAY_STORE_EXCEPTION           "java/lang/ArrayStoreException"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Thu May 22 08:03:58 2008
@@ -284,11 +284,15 @@
     if (is_synchronised) {
         if (is_static) {
             cs = lil_parse_onto_end(cs,
-                                    "out stdcall:pint:void;"
+                                    "out stdcall:pint:pint;"
                                     "o0=%0i;"
-                                    "call %1i;",
+                                    "call %1i;"
+                                    "out stdcall:pint:void;"
+                                    "o0=r;"
+                                    "call %2i;",
                                     clss,
-                                    lil_npc_to_fp(vm_helper_get_addr(VM_RT_MONITOR_ENTER_STATIC)));
+                                    lil_npc_to_fp(vm_helper_get_addr(VM_RT_CLASS_2_JLC)),
+                                    lil_npc_to_fp(vm_helper_get_addr(VM_RT_MONITOR_ENTER)));
             assert(cs);
         } else {
             cs = lil_parse_onto_end(cs,
@@ -450,11 +454,15 @@
     if (is_synchronised) {
         if (is_static) {
             cs = lil_parse_onto_end(cs,
-                "out stdcall:pint:void;"
+                "out stdcall:pint:pint;"
                 "o0=%0i;"
-                "call %1i;",
+                "call %1i;"
+                "out stdcall:pint:void;"
+                "o0=r;"
+                "call %2i;",
                 clss,
-                lil_npc_to_fp(vm_helper_get_addr(VM_RT_MONITOR_EXIT_STATIC)));
+                lil_npc_to_fp(vm_helper_get_addr(VM_RT_CLASS_2_JLC)),
+                lil_npc_to_fp(vm_helper_get_addr(VM_RT_MONITOR_EXIT)));
         } else {
             cs = lil_parse_onto_end(cs,
                 "ld l0,[l0+%0i:ref];"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Thu May 22 08:03:58 2008
@@ -1639,7 +1639,15 @@
 
 //end of lazy resolution helpers
 //////////////////////////////////////////////////////////////////////////
-
+#if (defined PLATFORM_POSIX) && (defined _IA32_)
+ManagedObject* __attribute__ ((__stdcall__)) rth_struct_Class_to_java_lang_Class(Class *clss) {
+#elif defined _IA32_
+ManagedObject* __stdcall rth_struct_Class_to_java_lang_Class(Class *clss) {
+#else
+ManagedObject* rth_struct_Class_to_java_lang_Class(Class *clss) {
+#endif
+    return struct_Class_to_java_lang_Class(clss);
+}
 
 
 
@@ -1663,6 +1671,10 @@
         return rth_wrap_exn_throw(dyn_count, "rth_throw_lazy", exn_get_rth_throw_lazy());
     case VM_RT_THROW_LINKING_EXCEPTION:
         return rth_get_lil_throw_linking_exception(dyn_count);
+
+    case VM_RT_CLASS_2_JLC:
+        return (NativeCodePtr)rth_struct_Class_to_java_lang_Class;
+
     // Type tests
     case VM_RT_CHECKCAST:
         return rth_get_lil_checkcast(dyn_count);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp Thu May 22 08:03:58 2008
@@ -77,30 +77,14 @@
             "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorEnterUseReservation",
             "(Ljava/lang/Object;)V",   NULL},
 
-    {VM_RT_MONITOR_ENTER_NON_NULL,             "VM_RT_MONITOR_ENTER_NON_NULL",
-            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1,
-            "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorEnterUseReservation",
-            "(Ljava/lang/Object;)V",   NULL},
-
     {VM_RT_MONITOR_EXIT,                       "VM_RT_MONITOR_EXIT",
             INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1,
             "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorExit",
             "(Ljava/lang/Object;)V",   NULL},
 
-    {VM_RT_MONITOR_EXIT_NON_NULL,              "VM_RT_MONITOR_EXIT_NON_NULL",
-            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1,
-            "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorExit",
-            "(Ljava/lang/Object;)V",   NULL},
-
-    {VM_RT_MONITOR_ENTER_STATIC,               "VM_RT_MONITOR_ENTER_STATIC",
-            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1,
-            "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorEnterUseReservation",
-            "(Ljava/lang/Object;)V",   NULL},
-
-    {VM_RT_MONITOR_EXIT_STATIC,                "VM_RT_MONITOR_EXIT_STATIC",
-            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1,
-            "org/apache/harmony/drlvm/thread/ThreadHelper",   "monitorExit",
-            "(Ljava/lang/Object;)V",   NULL},
+    {VM_RT_CLASS_2_JLC,                        "VM_RT_CLASS_2_JLC",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              1,
+            NULL,   NULL,   NULL,   NULL},
 
     {VM_RT_CHECKCAST,                          "VM_RT_CHECKCAST",
             INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2,

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp Thu May 22 08:03:58 2008
@@ -52,23 +52,6 @@
                                                   const R_Opnd & input_param1);
 #define INPUT_ARG_OFFSET 8
 
-
-// patch_addr_null_arg_ptr is the address of a variable holding the
-// address of a branch instruction byte to patch with the destination
-// to be taken if the struct Class* argument is NULL.
-static char * gen_convert_struct_class_to_object(char *ss, char **patch_addr_null_arg_ptr)
-{
-    // First make sure the struct Class* argument is non-NULL.
-    ss = test(ss,  rdi_opnd,   rdi_opnd);
-    ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
-    *patch_addr_null_arg_ptr = ((char *)ss) - 1;
-
-    // Convert the struct Class* argument to the corresponding java_lang_Class reference.
-    ss = call(ss, (char *)struct_Class_to_java_lang_Class);
-    ss = mov(ss,  rdi_opnd,  rax_opnd);  // overwrite the struct Class* with the raw java_lang_Class reference
-    return ss;
-} //gen_convert_struct_class_to_object
-
 // Helper for monenter intstruction
 static char * gen_restore_monitor_enter(char *ss, char *patch_addr_null_arg)
 {
@@ -81,9 +64,12 @@
 //    ss = inc(ss,  M_Opnd((int64)incr));
 #endif
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG
+    // check on the null
     ss = test(ss,  rdi_opnd,   rdi_opnd);
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
+#endif
 
     // skip fast path if can_generate_monitor_events capability
     // was requested, so all TI events will be generated
@@ -111,6 +97,7 @@
 
     ss = ret(ss);
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG
     // Handle NPE here
     int64 npe_offset = (int64)ss - (int64)backpatch_address__null_pointer - 1;
     *backpatch_address__null_pointer = (char)npe_offset;
@@ -121,7 +108,7 @@
 
     // Object is null so throw a null pointer exception
     ss = jump(ss, (char*)exn_get_rth_throw_null_pointer());
-
+#endif
     return ss;
 } //gen_restore_monitor_enter
 
@@ -158,43 +145,6 @@
     return addr;
 }
 
-void * getaddress__vm_monitor_enter_static_naked()
-{
-    static void *addr = NULL;
-    if (addr != NULL) {
-        return addr;
-    }
-
-    const int stub_size = 208;
-    char *stub = (char *)malloc_fixed_code_for_jit(stub_size, DEFAULT_CODE_ALIGNMENT, CODE_BLOCK_HEAT_MAX/2, CAA_Allocate);
-#ifdef _DEBUG
-    memset(stub, 0xcc /*int 3*/, stub_size);
-#endif
-    char *ss = stub;
-
-#ifdef VM_STATS
-    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_ENTER_STATIC, 0, NULL);
-    ss = mov(ss,  rax_opnd,  Imm_Opnd(size_64, (int64)value));
-    ss = inc(ss,  M_Base_Opnd(rax_reg, 0));
-#endif
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_enter(ss, patch_addr_null_arg);
-
-    addr = stub;
-    assert((ss - stub) < stub_size);
-
-    compile_add_dynamic_generated_code_chunk("vm_monitor_enter_static_naked", false, stub, stub_size);
-
-    if (jvmti_should_report_event(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
-        jvmti_send_dynamic_code_generated_event("vm_monitor_enter_static_naked", stub, stub_size);
-    }
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_enter_static_naked", ss - stub);
-
-    return addr;
-} //getaddress__vm_monitor_enter_static_naked
 
 static char * gen_restore_monitor_exit(char *ss, char *patch_addr_null_arg)
 {
@@ -205,9 +155,12 @@
 //    ss = inc(ss,  M_Opnd((int64)incr));
 #endif
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG
+    // check on teh null
     ss = test(ss, rdi_opnd, rdi_opnd);
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
+#endif
 
     // skip fast path if can_generate_monitor_events capability
     // was requested, so all TI events will be generated
@@ -236,6 +189,8 @@
     //  Monitor illegal state happend
     ss = jump(ss, (char*)exn_get_rth_throw_illegal_state_exception());
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG
+    //NPE
     offset = (POINTER_SIZE_SINT)ss - (POINTER_SIZE_SINT)backpatch_address__null_pointer - 1;
     *backpatch_address__null_pointer = (char)offset;
     if (patch_addr_null_arg != NULL) {
@@ -245,7 +200,7 @@
 
     // Object is null so throw a null pointer exception
     ss = jump(ss, (char*)exn_get_rth_throw_null_pointer());
-
+#endif
     return ss;
 } //gen_restore_monitor_exit
 
@@ -283,41 +238,6 @@
     return addr;
 } //getaddress__vm_monitor_exit_naked
 
-void * getaddress__vm_monitor_exit_static_naked()
-{
-    static void *addr = NULL;
-    if (addr != NULL) {
-        return addr;
-    }
-
-    const int stub_size = 144;
-    char *stub = (char *)malloc_fixed_code_for_jit(stub_size, DEFAULT_CODE_ALIGNMENT, CODE_BLOCK_HEAT_MAX/2, CAA_Allocate);
-    char *ss = stub;
-
-#ifdef VM_STATS
-    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_EXIT_STATIC, 0, NULL);
-    ss = mov(ss,  rax_opnd,  Imm_Opnd(size_64, (int64)value));
-    ss = inc(ss,  M_Base_Opnd(rax_reg, 0));
-#endif
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_exit(ss, patch_addr_null_arg);
-
-    addr = stub;
-    assert((ss - stub) < stub_size);
-
-    compile_add_dynamic_generated_code_chunk("vm_monitor_exit_static_naked", false, stub, stub_size);
-
-    if (jvmti_should_report_event(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
-        jvmti_send_dynamic_code_generated_event("vm_monitor_exit_static_naked", stub, stub_size);
-    }
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_exit_static_naked", ss - stub);
-
-    return addr;
-} //getaddress__vm_monitor_exit_static_naked
-
 // Windows x86-64 helpers
 static LilCodeStub * rth_get_lil_monitor_enter_generic(LilCodeStub * cs) {
     if(VM_Global_State::loader_env->TI->isEnabled() &&
@@ -351,41 +271,6 @@
     }
 }
 
-NativeCodePtr rth_get_lil_monitor_enter_static() {    
-    static NativeCodePtr addr = NULL;
-    
-    if (addr != NULL) {
-        return addr;
-    }    
-
-    LilCodeStub * cs = lil_parse_code_stub("entry 0:stdcall:pint:void;");
-#ifdef VM_STATS
-//    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_ENTER_STATIC, 0, NULL);
-//    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
-//    assert(cs);
-#endif
-        // convert struct Class into java_lang_Class
-    cs = lil_parse_onto_end(cs,
-        "in2out platform:ref;"
-        "call %0i;"
-        "locals 1;"
-        "l0 = r;",
-        struct_Class_to_java_lang_Class
-    );
-    assert(cs);
-
-    // append generic monitor enter code
-    cs = rth_get_lil_monitor_enter_generic(cs);
-    assert(cs && lil_is_valid(cs));
-
-    addr = LilCodeGenerator::get_platform()->compile(cs);
-
-    DUMP_STUB(addr, "monitor_enter_static", lil_cs_get_code_size(cs));
-
-    lil_free_code_stub(cs);
-    return addr;
-}
-
 NativeCodePtr rth_get_lil_monitor_enter() {
     static NativeCodePtr addr = NULL;
     
@@ -400,19 +285,27 @@
 //    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
 //    assert(cs);
 #endif
+
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG
     // check if object is null
     cs = lil_parse_onto_end(cs,
-        "jc i0 = %0i:ref, throw_null_pointer;"
-        "locals 1;"
-        "l0 = i0;",
+        "jc i0 = %0i:ref, throw_null_pointer;",
         (ManagedObject *) VM_Global_State::loader_env->managed_null
     );
     assert(cs);
-    
+#endif
+
+    cs = lil_parse_onto_end(cs,
+        "locals 1;"
+        "l0 = i0;"
+    );
+    assert(cs);
+
     // append generic monitor enter code
     cs = rth_get_lil_monitor_enter_generic(cs);
     assert(cs);
-    
+
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
     // throw NullPointerException
     cs = lil_parse_onto_end(cs,
         ":throw_null_pointer;"
@@ -421,48 +314,16 @@
         lil_npc_to_fp(exn_get_rth_throw_null_pointer())
     );
     assert(cs && lil_is_valid(cs));
-    
-    addr = LilCodeGenerator::get_platform()->compile(cs);
-
-    DUMP_STUB((char *)addr, "monitor_enter", lil_cs_get_code_size(cs));
-
-    lil_free_code_stub(cs);
-    return addr;
-}
-
-// this function doesn't throw NullPointerException in case of null object
-NativeCodePtr rth_get_lil_monitor_enter_non_null() {
-    static NativeCodePtr addr = NULL;
-    
-    if (addr != NULL) {
-        return addr;
-    }    
-
-    LilCodeStub * cs = lil_parse_code_stub(
-        "entry 0:stdcall:ref:void;"
-        "locals 1;"
-        "l0 = i0;"
-    );    
-    assert(cs);
-
-#ifdef VM_STATS
-//    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_ENTER_NON_NULL, 0, NULL);
-//    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
-//    assert(cs);
 #endif
-    // append generic monitor enter code
-    cs = rth_get_lil_monitor_enter_generic(cs);
-    assert(cs && lil_is_valid(cs));
-    
+
     addr = LilCodeGenerator::get_platform()->compile(cs);
 
-    DUMP_STUB(addr, "monitor_enter_non_null", lil_cs_get_code_size(cs));
+    DUMP_STUB((char *)addr, "monitor_enter", lil_cs_get_code_size(cs));
 
     lil_free_code_stub(cs);
     return addr;
 }
 
-
 /*    MONITOR EXIT RUNTIME SUPPORT    */
 
 static LilCodeStub * rth_get_lil_monitor_exit_generic(LilCodeStub * cs) {
@@ -494,41 +355,6 @@
     }
 }
 
-NativeCodePtr rth_get_lil_monitor_exit_static() {    
-    static NativeCodePtr addr = NULL;
-    
-    if (addr != NULL) {
-        return addr;
-    }    
-
-    LilCodeStub * cs = lil_parse_code_stub("entry 0:stdcall:pint:void;");
-#ifdef VM_STATS
-//    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_EXIT_STATIC, 0, NULL);
-//    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
-//    assert(cs);
-#endif
-        // convert struct Class into java_lang_Class
-    cs = lil_parse_onto_end(cs,
-        "in2out platform:ref;"
-        "call %0i;"
-        "out platform:ref:g4;"
-        "o0 = r;",
-        struct_Class_to_java_lang_Class
-    );
-    assert(cs);
-    
-    // append generic monitor enter code
-    cs = rth_get_lil_monitor_exit_generic(cs);
-    assert(cs && lil_is_valid(cs));
-
-    addr = LilCodeGenerator::get_platform()->compile(cs);
-
-    DUMP_STUB(addr, "monitor_exit_static", lil_cs_get_code_size(cs));
-
-    lil_free_code_stub(cs);
-    return addr;
-}
-
 
 NativeCodePtr rth_get_lil_monitor_exit() {
     static NativeCodePtr addr = NULL;
@@ -544,19 +370,26 @@
 //    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
 //    assert(cs);
 #endif
+
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
     // check if object is null
     cs = lil_parse_onto_end(cs,
         "jc i0 = %0i:ref, throw_null_pointer;"
-        "in2out platform:g4;",
         (ManagedObject *) VM_Global_State::loader_env->managed_null
     );
+    assert(cs);
+#endif
 
+    cs = lil_parse_onto_end(cs,
+        "in2out platform:g4;"
+    );
     assert(cs);
     
     // append generic monitor enter code
     cs = rth_get_lil_monitor_exit_generic(cs);
     assert(cs);
-    
+
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
     // throw NullPointerException
     cs = lil_parse_onto_end(cs,
         ":throw_null_pointer;"
@@ -565,7 +398,8 @@
         lil_npc_to_fp(exn_get_rth_throw_null_pointer())
     );
     assert(cs && lil_is_valid(cs));
-    
+#endif
+
     addr = LilCodeGenerator::get_platform()->compile(cs);
 
     DUMP_STUB(addr, "monitor_exit", lil_cs_get_code_size(cs));
@@ -574,33 +408,3 @@
     return addr;
 }
 
-// this function doesn't throw NullPointerException in case of null object
-NativeCodePtr rth_get_lil_monitor_exit_non_null() {
-    static NativeCodePtr addr = NULL;
-    
-    if (addr != NULL) {
-        return addr;
-    }    
-
-    LilCodeStub * cs = lil_parse_code_stub(
-        "entry 0:stdcall:ref:void;"
-        "in2out platform:g4;"
-    );    
-    assert(cs);
-
-#ifdef VM_STATS
-//    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_EXIT_NON_NULL, 0, NULL);
-//    cs = lil_parse_onto_end(cs, "inc [%0i:pint];", value);
-//    assert(cs);
-#endif
-    // append generic monitor enter code
-    cs = rth_get_lil_monitor_exit_generic(cs);
-    assert(cs && lil_is_valid(cs));
-    
-    addr = LilCodeGenerator::get_platform()->compile(cs);
-
-    DUMP_STUB(addr, "monitor_exit_non_null", lil_cs_get_code_size(cs));
-
-    lil_free_code_stub(cs);
-    return addr;
-}

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp Thu May 22 08:03:58 2008
@@ -308,37 +308,15 @@
 
     switch(f) {
 #ifdef _WIN64
-    // Monitor enter runtime helpers
-    case VM_RT_MONITOR_ENTER_STATIC:
-        return rth_get_lil_monitor_enter_static();
     case VM_RT_MONITOR_ENTER:
         return rth_get_lil_monitor_enter();
-    case VM_RT_MONITOR_ENTER_NON_NULL:
-        return rth_get_lil_monitor_enter_non_null();
-
-   // Monitor exit runtime helpers
-    case VM_RT_MONITOR_EXIT_STATIC:
-        return rth_get_lil_monitor_exit_static();
     case VM_RT_MONITOR_EXIT:
         return rth_get_lil_monitor_exit();
-    case VM_RT_MONITOR_EXIT_NON_NULL:
-        return rth_get_lil_monitor_exit_non_null();
 #else
-    // Monitor enter runtime helpers
-    case VM_RT_MONITOR_ENTER_STATIC:
-        return getaddress__vm_monitor_enter_static_naked();
     case VM_RT_MONITOR_ENTER:
         return getaddress__vm_monitor_enter_naked();
-    case VM_RT_MONITOR_ENTER_NON_NULL:
-        return getaddress__vm_monitor_enter_naked();
-
-   // Monitor exit runtime helpers
-    case VM_RT_MONITOR_EXIT_STATIC:
-        return getaddress__vm_monitor_exit_static_naked();
     case VM_RT_MONITOR_EXIT:
         return getaddress__vm_monitor_exit_naked();
-    case VM_RT_MONITOR_EXIT_NON_NULL:
-        return getaddress__vm_monitor_exit_naked();
 #endif
 
     // Object creation helper

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_ia32.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_ia32.cpp Thu May 22 08:03:58 2008
@@ -46,27 +46,6 @@
 
 #define INPUT_ARG_OFFSET 4
 
-
-// patch_addr_null_arg_ptr is the address of a variable holding the
-// address of a branch instruction byte to patch with the destination
-// to be taken if the struct Class* argument is NULL.
-static char * gen_convert_struct_class_to_object(char *ss, char **patch_addr_null_arg_ptr)
-{    
-    // First make sure the struct Class* argument is non-NULL.
-    ss = mov(ss,  ecx_opnd,  M_Base_Opnd(esp_reg, INPUT_ARG_OFFSET));
-    ss = test(ss,  ecx_opnd,   ecx_opnd);
-    ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
-    *patch_addr_null_arg_ptr = ((char *)ss) - 1;
-
-    // Convert the struct Class* argument to the corresponding java_lang_Class reference. 
-    ss = push(ss,  M_Base_Opnd(esp_reg, INPUT_ARG_OFFSET));
-    ss = call(ss, (char *)struct_Class_to_java_lang_Class);
-    ss = alu(ss, add_opc,  esp_opnd,  Imm_Opnd(4));
-    ss = mov(ss,  M_Base_Opnd(esp_reg, INPUT_ARG_OFFSET),  eax_opnd);  // overwrite the struct Class* with the raw java_lang_Class reference
-    return ss;
-} //gen_convert_struct_class_to_object
-
-
 /*
  * Helper for monenter intstruction
  */
@@ -82,9 +61,12 @@
 #endif
     ss = mov(ss,  ecx_opnd,  M_Base_Opnd(esp_reg, INPUT_ARG_OFFSET));
     
+#ifdef _DEBUG_CHECK_NULL_ //_DEBUG    
+    //npe check
     ss = test(ss,  ecx_opnd,   ecx_opnd);
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
+#endif
 
     // skip fast path if can_generate_monitor_events capability
     // was requested, so all TI events will be generated
@@ -109,6 +91,7 @@
 
     ss = ret(ss,  Imm_Opnd(4));
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
     // Handle NPE here
     signed npe_offset = (signed)ss - (signed)backpatch_address__null_pointer - 1;
     *backpatch_address__null_pointer = (char)npe_offset;
@@ -118,53 +101,10 @@
     }
     // Object is null so throw a null pointer exception
     ss = jump(ss, (char*)exn_get_rth_throw_null_pointer());
-
+#endif
     return ss;
 } //gen_restore_monitor_enter
 
-
-void * restore__vm_monitor_enter_naked(void * code_addr)
-{
-    char *stub = (char *)code_addr;
-
-#ifdef _DEBUG
-    const int stub_size = 86;
-    memset(stub, 0xcc, stub_size);
-#endif
-    char *ss = stub;
-
-    ss = gen_restore_monitor_enter(ss, /*patch_addr_null_arg*/ NULL);
-
-    assert((ss - stub) < stub_size);
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_enter_naked_mt", ss - stub);
-
-    return code_addr;
-} //restore__vm_monitor_enter_naked
-
-
-void * restore__vm_monitor_enter_static_naked(void * code_addr)
-{
-    char *stub = (char *)code_addr;
-
-#ifdef _DEBUG
-    const int stub_size = 107;
-    memset(stub, 0xcc, stub_size);
-#endif
-    char *ss = stub;
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_enter(ss, patch_addr_null_arg);
-
-    assert((ss - stub) < stub_size);
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_enter_static_naked_mt", ss - stub);
-
-    return code_addr;
-} //restore__vm_monitor_enter_static_naked
-
-
 static char * gen_restore_monitor_exit(char *ss, char *patch_addr_null_arg)
 {
 
@@ -174,9 +114,14 @@
 #endif
 
     ss = mov(ss,  ecx_opnd,  M_Base_Opnd(esp_reg, INPUT_ARG_OFFSET));
+
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
+    //check npe
     ss = test(ss,  ecx_opnd,   ecx_opnd);
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
+#endif
+
     // skip fast path if can_generate_monitor_events capability
     // was requested, so all TI events will be generated
     if (!VM_Global_State::loader_env->TI->get_global_capability(
@@ -202,6 +147,8 @@
     //  illegal state happend
     ss = jump(ss, (char*)exn_get_rth_throw_illegal_state_exception());
 
+#ifdef _DEBUG_CHECK_NULL_//_DEBUG    
+    //NPE
     offset = (signed)ss - (signed)backpatch_address__null_pointer - 1;
     *backpatch_address__null_pointer = (char)offset;
     if (patch_addr_null_arg != NULL) {
@@ -210,54 +157,12 @@
     }
     // Object is null so throw a null pointer exception
     ss = jump(ss, (char*)exn_get_rth_throw_null_pointer());
-    
+#endif     
     return ss;
   
 } //gen_restore_monitor_exit
 
 
-void * restore__vm_monitor_exit_naked(void * code_addr)
-{
-    char *stub = (char *)code_addr;
-
-#ifdef _DEBUG
-    const int stub_size = /*106*/210;
-    memset(stub, 0xcc, stub_size);
-#endif
-    char *ss = stub;
-
-    ss = gen_restore_monitor_exit(ss, /*patch_addr_null_arg*/ NULL);
-
-    assert((ss - stub) < stub_size);
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_exit_naked_mt", ss - stub);
-
-    return code_addr; 
-} //restore__vm_monitor_exit_naked
-
-
-void * restore__vm_monitor_exit_static_naked(void * code_addr)
-{
-    char *stub = (char *)code_addr;
-
-#ifdef _DEBUG
-    const int stub_size = /*106*/210;
-    memset(stub, 0xcc, stub_size);
-#endif
-    char *ss = stub;
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_exit(ss, patch_addr_null_arg);
-
-    assert((ss - stub) < stub_size);
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_exit_static_naked_mt", ss - stub);
-
-    return code_addr; 
-} //restore__vm_monitor_exit_static_naked
-
-
 void * getaddress__vm_monitor_enter_naked()
 {
     static void *addr = NULL;
@@ -294,46 +199,6 @@
 }
 
 
-void * getaddress__vm_monitor_enter_static_naked()
-{    
-    static void *addr = NULL;
-    if (addr != NULL) {
-        return addr;
-    }
-
-    const int stub_size = 250;
-    char *stub = (char *)malloc_fixed_code_for_jit(stub_size, DEFAULT_CODE_ALIGNMENT, CODE_BLOCK_HEAT_MAX/2, CAA_Allocate);
-#ifdef _DEBUG
-    memset(stub, 0xcc /*int 3*/, stub_size);
-#endif
-    char *ss = stub;
-
-#ifdef VM_STATS
-    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_ENTER_STATIC, 0, NULL);
-    ss = inc(ss,  M_Opnd((unsigned)value));
-#endif
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_enter(ss, patch_addr_null_arg);    
-
-    addr = stub;
-    assert((ss - stub) < stub_size);
-
-    compile_add_dynamic_generated_code_chunk("vm_monitor_enter_static_naked", false, stub, stub_size);
-
-    if (jvmti_should_report_event(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
-        jvmti_send_dynamic_code_generated_event("vm_monitor_enter_static_naked", stub, stub_size);
-    }
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_enter_static_naked", ss - stub);
-
-    return addr;
-} //getaddress__vm_monitor_enter_static_naked
-
-
-
-
 void * getaddress__vm_monitor_exit_naked()
 {
     static void *addr = NULL;
@@ -367,38 +232,3 @@
     return addr;
 } //getaddress__vm_monitor_exit_naked
 
-
-void * getaddress__vm_monitor_exit_static_naked()
-{
-    static void *addr = NULL;
-    if (addr != NULL) {
-        return addr;
-    }
-
-    const int stub_size = /*126*/210;
-    char *stub = (char *)malloc_fixed_code_for_jit(stub_size, DEFAULT_CODE_ALIGNMENT, CODE_BLOCK_HEAT_MAX/2, CAA_Allocate);
-    char *ss = stub;
-
-#ifdef VM_STATS
-    int * value = VM_Statistics::get_vm_stats().rt_function_calls.lookup_or_add((void*)VM_RT_MONITOR_EXIT_STATIC, 0, NULL);
-    ss = inc(ss,  M_Opnd((unsigned)value));
-#endif
-
-    char *patch_addr_null_arg;
-    ss = gen_convert_struct_class_to_object(ss, &patch_addr_null_arg);
-    ss = gen_restore_monitor_exit(ss, patch_addr_null_arg);    
-
-    addr = stub;
-    assert((ss - stub) < stub_size);
-
-    compile_add_dynamic_generated_code_chunk("vm_monitor_exit_static_naked", false, stub, stub_size);
-
-    if (jvmti_should_report_event(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
-        jvmti_send_dynamic_code_generated_event("vm_monitor_exit_static_naked", stub, stub_size);
-    }
-
-    DUMP_STUB(stub, "getaddress__vm_monitor_exit_static_naked", ss - stub);
-
-    return addr;
-} //getaddress__vm_monitor_exit_static_naked
-

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp Thu May 22 08:03:58 2008
@@ -1043,18 +1043,10 @@
     return getaddress__vm_instanceof();
 
     case VM_RT_MONITOR_ENTER:
-    case VM_RT_MONITOR_ENTER_NON_NULL:
         return getaddress__vm_monitor_enter_naked();
-
-    case VM_RT_MONITOR_ENTER_STATIC:
-        return getaddress__vm_monitor_enter_static_naked();
-
     case VM_RT_MONITOR_EXIT:
-    case VM_RT_MONITOR_EXIT_NON_NULL:
         return getaddress__vm_monitor_exit_naked();
 
-    case VM_RT_MONITOR_EXIT_STATIC:
-        return getaddress__vm_monitor_exit_static_naked();
 
     case VM_RT_GET_INTERFACE_VTABLE_VER0:
         return getaddress__vm_get_interface_vtable_old_naked();  //tryitx

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/jit_runtime_support_ipf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/jit_runtime_support_ipf.cpp?rev=659128&r1=659127&r2=659128&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/jit_runtime_support_ipf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/jit_runtime_support_ipf.cpp Thu May 22 08:03:58 2008
@@ -1390,40 +1390,6 @@
 } //get_vm_rt_monitor_exit_address
 
 
-
-static void *get_vm_rt_monitor_enter_static_address()
-{
-    static void *addr = 0;
-    if (addr) {
-        return addr;
-    }
-    // 20030220 The "static" monitor enter function is only called with a struct Class pointer, which can't be NULL.
-    void (*p_vm_monitor_enter)(ManagedObject *p_obj);
-    p_vm_monitor_enter = vm_monitor_enter;
-    addr = gen_vm_rt_monitor_wrapper((void **)p_vm_monitor_enter, gen_vm_rt_monitorenter_fast_path, 
-                                      /*check_null*/ false, /*static_operation*/ true,
-                                      "rt_monitor_enter_static_slowpath", "rt_monitor_enter_static_fastpath");
-    return addr;
-} //get_vm_rt_monitor_enter_static_address
-
-
-
-static void *get_vm_rt_monitor_exit_static_address()
-{
-    static void *addr = 0;
-    if (addr) {
-        return addr;
-    }
-    // 20030220 The "static" monitor exit function is only called with a struct Class pointer, which can't be NULL.
-    void (*p_vm_monitor_exit)(ManagedObject *p_obj);
-    p_vm_monitor_exit = vm_monitor_exit;
-    addr = gen_vm_rt_monitor_wrapper((void **)p_vm_monitor_exit, gen_vm_rt_monitorexit_fast_path, 
-                                      /*check_null*/ false, /*static_operation*/ true,
-                                      "rt_monitor_exit_static_slowpath", "rt_monitor_exit_static_fastpath");
-    return addr;
-} //get_vm_rt_monitor_exit_static_address
-
-
 #ifdef VM_STATS // exclude remark in release mode (defined but not used)
 // Return the log base 2 of the integer operand. If the argument is less than or equal to zero, return zero.
 static int get_log2(int value)
@@ -1829,26 +1795,10 @@
         dereference_fptr = false;
         break;
     case VM_RT_MONITOR_ENTER:
-        fptr =  get_vm_rt_monitor_enter_address(true);
-        dereference_fptr = false;
-        break;
-    case VM_RT_MONITOR_ENTER_STATIC:
-        fptr =  get_vm_rt_monitor_enter_static_address();
-        dereference_fptr = false;
-        break;
-    case VM_RT_MONITOR_ENTER_NON_NULL:
         fptr =  get_vm_rt_monitor_enter_address(false);
         dereference_fptr = false;
         break;
     case VM_RT_MONITOR_EXIT:
-        fptr =  get_vm_rt_monitor_exit_address(true);
-        dereference_fptr = false;
-        break;
-    case VM_RT_MONITOR_EXIT_STATIC:
-        fptr =  get_vm_rt_monitor_exit_static_address();
-        dereference_fptr = false;
-        break;
-    case VM_RT_MONITOR_EXIT_NON_NULL:
         fptr =  get_vm_rt_monitor_exit_address(false);
         dereference_fptr = false;
         break;



Mime
View raw message