harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r529884 - in /harmony/enhanced/drlvm/trunk/vm: include/jit_runtime_support.h jitrino/src/codegenerator/ia32/Ia32IRManager.cpp jitrino/src/vm/VMInterface.h jitrino/src/vm/drl/DrlVMInterface.cpp vmcore/src/jit/jit_runtime_support.cpp
Date Wed, 18 Apr 2007 06:11:26 GMT
Author: xli
Date: Tue Apr 17 23:11:25 2007
New Revision: 529884

URL: http://svn.apache.org/viewvc?view=rev&rev=529884
Log:
HARMONY-3626 : add JIT-VM interface for JIT to query about a runtime helper's GC interruptibility

Modified:
    harmony/enhanced/drlvm/trunk/vm/include/jit_runtime_support.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.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/vmcore/src/jit/jit_runtime_support.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/include/jit_runtime_support.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jit_runtime_support.h?view=diff&rev=529884&r1=529883&r2=529884
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jit_runtime_support.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jit_runtime_support.h Tue Apr 17 23:11:25 2007
@@ -618,6 +618,13 @@
 VMEXPORT LilCodeStub *vm_get_rt_support_stub(VM_RT_SUPPORT f, Class_Handle c);
 
 
+/**
+ *  Checks if helper is a suspension point
+ */
+
+VMEXPORT Boolean vm_helper_is_gc_interruptible(VM_RT_SUPPORT f);
+
+
 #ifdef __cplusplus
 }
 #endif // __cplusplus

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp?view=diff&rev=529884&r1=529883&r2=529884
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Tue Apr
17 23:11:25 2007
@@ -2236,8 +2236,9 @@
         bool isInternalHelper = rt && rt->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress;
         bool isNonGCVMHelper = false;
         if (!isInternalHelper) {
+            CompilationInterface* ci = CompilationContext::getCurrentContext()->getVMCompilationInterface();
             isNonGCVMHelper = rt && rt->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress

-                && (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0)
== CompilationInterface::Helper_GetTLSBase;
+                && !ci->isGCInterruptible((CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0));
         }
         bool isGCPoint = !isInternalHelper && !isNonGCVMHelper;
         return isGCPoint;
@@ -2351,5 +2352,6 @@
 
 } //namespace Ia32
 } //namespace Jitrino
+
 
 

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=529884&r1=529883&r2=529884
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Tue Apr 17 23:11:25 2007
@@ -370,6 +370,7 @@
     static RuntimeHelperId str2rid( const char * helperName );
 
     VmCallingConvention getRuntimeHelperCallingConvention(RuntimeHelperId id);
+    bool        isGCInterruptible(RuntimeHelperId id);
     void*       getRuntimeHelperAddress(RuntimeHelperId);
     void*       getRuntimeHelperAddressForType(RuntimeHelperId, Type*);
 

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=529884&r1=529883&r2=529884
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Tue Apr 17 23:11:25
2007
@@ -75,7 +75,7 @@
 // TODO: free TLS key on JIT deinitilization
 uint32
 VMInterface::flagTLSSuspendRequestOffset(){
-    return hythread_tls_get_request_offset();
+    return (uint32)hythread_tls_get_request_offset();
 }
 
 uint32
@@ -563,6 +563,13 @@
         return CallingConvention_Stdcall;
     }
 }
+
+bool
+CompilationInterface::isGCInterruptible(RuntimeHelperId runtimeHelperId)  {
+    VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId);
+    return vm_helper_is_gc_interruptible(drlHelperId);
+}
+
 
 bool
 CompilationInterface::compileMethod(MethodDesc *method) {

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?view=diff&rev=529884&r1=529883&r2=529884
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Tue Apr 17 23:11:25
2007
@@ -1976,6 +1976,7 @@
         return rth_get_lil_ddiv(dyn_count);
     case VM_RT_RESOLVE:
         return rth_get_lil_resolve(dyn_count);
+
     default:
         return NULL;
     }
@@ -1984,6 +1985,135 @@
 //**********************************************************************//
 // End new LIL runtime support
 //**********************************************************************//
+
+
+/**
+ *  Checks if helper is a suspension point
+ */
+
+VMEXPORT Boolean vm_helper_is_gc_interruptible(VM_RT_SUPPORT f)
+{
+switch(f) {
+    case VM_RT_MULTIANEWARRAY_RESOLVED:
+        return TRUE;
+    case VM_RT_LDC_STRING:
+		return TRUE;
+    // Exceptions
+    case VM_RT_THROW:
+    case VM_RT_THROW_SET_STACK_TRACE:
+		return TRUE;
+    case VM_RT_THROW_LAZY:
+		return TRUE;
+    case VM_RT_IDX_OUT_OF_BOUNDS:
+		return TRUE;
+    case VM_RT_NULL_PTR_EXCEPTION:
+		return TRUE;
+    case VM_RT_DIVIDE_BY_ZERO_EXCEPTION:
+		return TRUE;
+    case VM_RT_ARRAY_STORE_EXCEPTION:
+		return TRUE;
+    case VM_RT_THROW_LINKING_EXCEPTION:
+		return TRUE;
+    // Type tests
+    case VM_RT_CHECKCAST:
+		return TRUE;
+    case VM_RT_INSTANCEOF:
+		return TRUE;
+    case VM_RT_AASTORE:
+		return TRUE;	
+    case VM_RT_AASTORE_TEST:
+		return TRUE;
+    // Misc
+    case VM_RT_GET_INTERFACE_VTABLE_VER0:
+		return TRUE;
+    case VM_RT_INITIALIZE_CLASS:
+		return TRUE;
+    case VM_RT_GC_SAFE_POINT:
+		return TRUE;
+    case VM_RT_GC_GET_TLS_BASE:
+		return FALSE;
+    // JVMTI
+    case VM_RT_JVMTI_METHOD_ENTER_CALLBACK:
+		return TRUE;
+    case VM_RT_JVMTI_METHOD_EXIT_CALLBACK:
+		return TRUE;
+    case VM_RT_JVMTI_FIELD_ACCESS_CALLBACK:
+		return TRUE;
+    case VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK:
+		return TRUE;
+    // Non-VM
+    case VM_RT_F2I:
+		return FALSE;
+    case VM_RT_F2L:
+		return FALSE;
+    case VM_RT_D2I:
+		return FALSE;
+    case VM_RT_D2L:
+		return FALSE;
+    case VM_RT_LSHL:
+		return FALSE;
+    case VM_RT_LSHR:
+		return FALSE;
+    case VM_RT_LUSHR:
+		return FALSE;
+    case VM_RT_LMUL:
+#ifdef VM_LONG_OPT
+    case VM_RT_LMUL_CONST_MULTIPLIER:  
+#endif
+		return FALSE;
+    case VM_RT_LREM:
+		return FALSE;
+    case VM_RT_LDIV:
+		return FALSE;
+    case VM_RT_ULDIV:
+		return FALSE;
+    case VM_RT_CONST_LDIV:             
+		return FALSE;
+    case VM_RT_CONST_LREM:             
+		return FALSE;
+    case VM_RT_IMUL:
+		return FALSE;
+    case VM_RT_IREM:
+		return FALSE;
+    case VM_RT_IDIV:
+		return FALSE;
+    case VM_RT_FREM:
+		return FALSE;
+    case VM_RT_FDIV:
+		return FALSE;
+    case VM_RT_DREM:
+		return FALSE;
+    case VM_RT_DDIV:
+		return FALSE;
+    case VM_RT_RESOLVE:
+		return TRUE;
+	case VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE:
+        return TRUE; 
+	case VM_RT_NEW_VECTOR_USING_VTABLE:
+        return TRUE;
+	case VM_RT_WRITE_BARRIER_FASTCALL:
+        return TRUE;
+	case VM_RT_MONITOR_ENTER:
+    case VM_RT_MONITOR_ENTER_NON_NULL:
+        return TRUE;
+
+    case VM_RT_MONITOR_ENTER_STATIC:
+        return TRUE;
+    case VM_RT_MONITOR_EXIT:
+    case VM_RT_MONITOR_EXIT_NON_NULL:
+        return TRUE;
+
+    case VM_RT_MONITOR_EXIT_STATIC:
+        return TRUE;
+	case VM_RT_CHAR_ARRAYCOPY_NO_EXC:
+        return TRUE;
+	case VM_RT_GC_HEAP_WRITE_REF:
+        return FALSE;
+    default:
+		ASSERT(false, "Unexpected helper id" << f);
+        return TRUE;
+	}
+}
 
 
 /////////////////////////////////////////////////////////////



Mime
View raw message