harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r532370 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: jvmti/jvmti_event.cpp jvmti/jvmti_stack.cpp object/object_handles.cpp
Date Wed, 25 Apr 2007 14:41:31 GMT
Author: gshimansky
Date: Wed Apr 25 07:41:29 2007
New Revision: 532370

URL: http://svn.apache.org/viewvc?view=rev&rev=532370
Log:
Applied HARMONY-3532 [drlvm][jvmti] wrong METHOD_EXIT events are generated before VM_DEATH


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?view=diff&rev=532370&r1=532369&r2=532370
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Wed Apr 25 07:41:29 2007
@@ -1785,10 +1785,14 @@
         return;
 
     JNIEnv *jni_env = p_TLS_vmthread->jni_env;
-    tmn_suspend_disable();
-    ObjectHandle hLoader = oh_convert_to_local_handle((ManagedObject*)loader->GetLoader());
-    if( !(hLoader->object) ) hLoader = NULL;
-    tmn_suspend_enable();
+
+    ObjectHandle hLoader = NULL;
+    if (! loader->IsBootstrap()) {
+        tmn_suspend_disable();
+        hLoader = oh_convert_to_local_handle((ManagedObject*)loader->GetLoader());
+        tmn_suspend_enable();
+    }
+
     jint input_len = classlen;
     jint output_len = 0;
     unsigned char* input_class = classbytes;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?view=diff&rev=532370&r1=532369&r2=532370
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Wed Apr 25 07:41:29 2007
@@ -41,16 +41,10 @@
 #define jvmti_test_jenv (p_TLS_vmthread->jni_env)
 
 jthread getCurrentThread() {
-    tmn_suspend_disable();
-    ObjectHandle hThread = oh_allocate_local_handle();
-    jthread thread = jthread_self();
-    if(thread) {
-        hThread->object = (Java_java_lang_Thread *)thread->object;
-    } else {
-        hThread->object = NULL;
-    }
-    tmn_suspend_enable();
-    return (jthread) hThread;
+    jthread current_thread = jthread_self();
+    assert(current_thread);
+
+    return oh_copy_to_local_handle(current_thread);
 }
 
 jint get_thread_stack_depth(VM_thread *thread, jint* pskip)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp?view=diff&rev=532370&r1=532369&r2=532370
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp Wed Apr 25 07:41:29
2007
@@ -392,6 +392,7 @@
 
 ObjectHandle oh_convert_to_local_handle(ManagedObject* pointer) {
     assert(!hythread_is_suspend_enabled());
+    assert(pointer);
     ObjectHandle jobj = oh_allocate_local_handle();
     TRACE2("oh", "oh_convert_to_local_handle() pointer = " << pointer << ", handle
= " << jobj);
     jobj->object = pointer;
@@ -401,6 +402,8 @@
 
 ObjectHandle oh_copy_to_local_handle(ObjectHandle oh) {
     tmn_suspend_disable();
+    assert(oh);
+    assert(oh->object);
     ObjectHandle jobj = oh_allocate_local_handle();
     TRACE2("oh", "oh_copy_to_local_handle() oh = " << oh << ", handle = " <<
jobj);
     jobj->object = oh->object;



Mime
View raw message