harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r599465 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp
Date Thu, 29 Nov 2007 14:54:15 GMT
Author: gshimansky
Date: Thu Nov 29 06:54:14 2007
New Revision: 599465

URL: http://svn.apache.org/viewvc?rev=599465&view=rev
Log:
Applied patch from HARMONY-5221
[drlvm][jvmti] VTSVM JVMTI test GetOwnedMonitorInfo0101 fails on Linux x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_lock_rt_support_em64t.cpp

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=599465&r1=599464&r2=599465&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 Nov 29 06:54:14 2007
@@ -92,21 +92,26 @@
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
 
-    // Fast path
-    ss = push(ss, rdi_opnd);
-    ss = alu(ss, add_opc, rdi_opnd, Imm_Opnd(header_offset)); // pop parameters
-    ss = gen_monitorenter_fast_path_helper(ss, rdi_opnd);
-    ss = pop(ss, rdi_opnd);
-
-    ss = test(ss,  rax_opnd,   rax_opnd);
-    ss = branch8(ss, Condition_NZ,  Imm_Opnd(size_8, 0));
-    char *backpatch_address__fast_monitor_failed = ((char *)ss) - 1;
-    ss = ret(ss);
+    // 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)) {
+        // Fast path
+        ss = push(ss, rdi_opnd);
+        ss = alu(ss, add_opc, rdi_opnd, Imm_Opnd(header_offset)); // pop parameters
+        ss = gen_monitorenter_fast_path_helper(ss, rdi_opnd);
+        ss = pop(ss, rdi_opnd);
+
+        ss = test(ss,  rax_opnd,   rax_opnd);
+        ss = branch8(ss, Condition_NZ,  Imm_Opnd(size_8, 0));
+        char *backpatch_address__fast_monitor_failed = ((char *)ss) - 1;
+        ss = ret(ss);
 
-    // Slow path: happens when the monitor is busy (contention case)
-    offset = (int64)ss - (int64)backpatch_address__fast_monitor_failed - 1;
-    *backpatch_address__fast_monitor_failed = (char)offset;
+        offset = (int64)ss - (int64)backpatch_address__fast_monitor_failed - 1;
+        *backpatch_address__fast_monitor_failed = (char)offset;
+    }
 
+    // Slow path: happens when the monitor is busy (contention case)
     ss = gen_setup_j2n_frame(ss);
 
     ss = call(ss, (char *)oh_convert_to_local_handle);
@@ -214,10 +219,22 @@
     ss = branch8(ss, Condition_Z,  Imm_Opnd(size_8, 0));
     char *backpatch_address__null_pointer = ((char *)ss) - 1;
 
-    // Fast path only
-    ss = alu(ss, add_opc, rdi_opnd, Imm_Opnd(header_offset));
-    ss = gen_monitor_exit_helper(ss, rdi_opnd);
+    // 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)) {
+        // Fast path
+        ss = alu(ss, add_opc, rdi_opnd, Imm_Opnd(header_offset));
+        ss = gen_monitor_exit_helper(ss, rdi_opnd);
+    } else {
+        // Slow path
+        ss = gen_setup_j2n_frame(ss);
+
+        ss = call(ss, (char *)oh_convert_to_local_handle);
+        ss = gen_monitorexit_slow_path_helper(ss, rax_opnd);
 
+        ss = gen_pop_j2n_frame(ss);
+    }
     ss = test(ss,  rax_opnd,   rax_opnd);
     ss = branch8(ss, Condition_NZ,  Imm_Opnd(size_8, 0));
     char *backpatch_address__fast_monitor_failed = ((char *)ss) - 1;



Mime
View raw message