harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r481094 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/jvmti_internal.h src/jvmti/jvmti_capability.cpp src/util/ia32/base/jit_lock_rt_support_ia32.cpp
Date Thu, 30 Nov 2006 22:14:23 GMT
Author: gshimansky
Date: Thu Nov 30 14:14:21 2006
New Revision: 481094

URL: http://svn.apache.org/viewvc?view=rev&rev=481094
Log:
Applied HARMONY-2358 and HARMONY-2360
[drlvm][jvmti] Fix stub names for monitor_exit
[drlvm][jvmti] Disabling monitor_enter fast path on on can_generate_monitor_events capability

Tests passed on ubuntu, windows XP and partially on Gentoo x86_64 (kernel tests
on Jitrino.OPT failed)


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_lock_rt_support_ia32.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h?view=diff&rev=481094&r1=481093&r2=481094
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h Thu Nov 30 14:14:21 2006
@@ -293,6 +293,7 @@
             TI_GC_ENABLE_FIELD_MODIFICATION_EVENT = 0x40,
             TI_GC_ENABLE_POP_FRAME                = 0x80,
             TI_GC_ENABLE_TAG_OBJECTS              = 0x100,
+            TI_GC_ENABLE_MONITOR_EVENTS           = 0x200,
         };
 
         void set_global_capability(GlobalCapabilities ti_gc)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp?view=diff&rev=481094&r1=481093&r2=481094
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp Thu Nov 30 14:14:21
2006
@@ -284,6 +284,9 @@
     if (capabilities_ptr->can_pop_frame)
         ti->set_global_capability(DebugUtilsTI::TI_GC_ENABLE_POP_FRAME);
 
+    if (capabilities_ptr->can_generate_monitor_events)
+        ti->set_global_capability(DebugUtilsTI::TI_GC_ENABLE_MONITOR_EVENTS);
+
     if (capabilities_ptr->can_tag_objects) {
         ti->set_global_capability(DebugUtilsTI::TI_GC_ENABLE_TAG_OBJECTS);
         ManagedObject::_tag_pointer = true;
@@ -376,6 +379,12 @@
 
     if (capabilities_ptr->can_pop_frame)
         ti->reset_global_capability(DebugUtilsTI::TI_GC_ENABLE_POP_FRAME);
+
+    // relinquishing following capabilies will not revert VM operation mode
+    // back to optimized, so we do not reset global capabilities
+    //
+    //     TI_GC_ENABLE_MONITOR_EVENTS
+    //     TI_GC_ENABLE_TAG_OBJECTS
 
     return JVMTI_ERROR_NONE;
 }

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?view=diff&rev=481094&r1=481093&r2=481094
==============================================================================
--- 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 Nov 30 14:14:21 2006
@@ -96,20 +96,22 @@
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
 
-// skip fast path if ti is enabled
-// so all TI events will be generated
-if(!VM_Global_State::loader_env->TI->isEnabled()) {
-    ss = alu(ss, add_opc, ecx_opnd, Imm_Opnd(header_offset)); // pop parameters
-    ss = gen_monitorenter_fast_path_helper(ss, ecx_opnd);
-    ss = test(ss,  eax_opnd,   eax_opnd);
-    ss = branch8(ss, Condition_NZ,  Imm_Opnd(size_8, 0));
-    char *backpatch_address__fast_monitor_failed = ((char *)ss) - 1;
-    ss = ret(ss,  Imm_Opnd(4));
+    // 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(
+                DebugUtilsTI::TI_GC_ENABLE_MONITOR_EVENTS)) {
+        ss = alu(ss, add_opc, ecx_opnd, Imm_Opnd(header_offset)); // pop parameters
+        ss = gen_monitorenter_fast_path_helper(ss, ecx_opnd);
+        ss = test(ss,  eax_opnd,   eax_opnd);
+        ss = branch8(ss, Condition_NZ,  Imm_Opnd(size_8, 0));
+        char *backpatch_address__fast_monitor_failed = ((char *)ss) - 1;
+        ss = ret(ss,  Imm_Opnd(4));
+
+        // Slow path: happens when the monitor is busy (contention case)
+        offset = (signed)ss - (signed)backpatch_address__fast_monitor_failed - 1;
+        *backpatch_address__fast_monitor_failed = (char)offset;
+    }
 
-    // Slow path: happens when the monitor is busy (contention case)
-    offset = (signed)ss - (signed)backpatch_address__fast_monitor_failed - 1;
-    *backpatch_address__fast_monitor_failed = (char)offset;
-}
     ss = gen_setup_j2n_frame(ss);
     ss = push(ss,  M_Base_Opnd(esp_reg, m2n_sizeof_m2n_frame));
  
@@ -365,10 +367,10 @@
     addr = stub;
     assert((ss - stub) < stub_size);
 
-    compile_add_dynamic_generated_code_chunk("vm_monitor_enter_naked", stub, stub_size);
+    compile_add_dynamic_generated_code_chunk("vm_monitor_exit_naked", stub, stub_size);
 
     if (VM_Global_State::loader_env->TI->isEnabled())
-        jvmti_send_dynamic_code_generated_event("vm_monitor_enter_naked", stub, stub_size);
+        jvmti_send_dynamic_code_generated_event("vm_monitor_exit_naked", stub, stub_size);
 
     DUMP_STUB(stub, "getaddress__vm_monitor_exit_naked", ss - stub);
 



Mime
View raw message