changeset 4661:9ae5048b9153

Call uncommon_trap instead of fetch_unroll_info to correctly revoke biased locks on deopt.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 21 Feb 2012 19:31:06 +0100
parents b06ade6e927c
children 70583f504107
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java src/cpu/x86/vm/sharedRuntime_x86_64.cpp src/share/vm/runtime/deoptimization.cpp
diffstat 3 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Tue Feb 21 19:30:33 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Tue Feb 21 19:31:06 2012 +0100
@@ -94,7 +94,7 @@
         /**
          * The frame state of the caller of the method performing the lock, or null if the outermost method
          * performs the lock. This information is used to compute the {@link CiFrame} that this lock belongs to.
-         * We cannot use the actual frame state of the locking method, because it is now unique for a method. The
+         * We cannot use the actual frame state of the locking method, because it is not unique for a method. The
          * caller frame states are unique, i.e., all frame states of inlined methods refer to the same caller frame state.
          */
         public final FrameState callerState;
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue Feb 21 19:30:33 2012 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue Feb 21 19:31:06 2012 +0100
@@ -2702,12 +2702,18 @@
     __ bind(L);
   }
 #endif // ASSERT
+  
+  __ movl(c_rarg1, (int32_t)(Deoptimization::make_trap_request(Deoptimization::Reason_unreached, Deoptimization::Action_none)));
   __ mov(c_rarg0, r15_thread);
-  __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info)));
+  __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
+  oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
+
+  //__ reset_last_Java_frame(false, false);
+  //__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info)));
 
   // Need to have an oopmap that tells fetch_unroll_info where to
   // find any register it might need.
-  oop_maps->add_gc_map(__ pc() - start, map);
+//  oop_maps->add_gc_map(__ pc() - start, map);
 
   __ reset_last_Java_frame(false, false);
 
--- a/src/share/vm/runtime/deoptimization.cpp	Tue Feb 21 19:30:33 2012 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Tue Feb 21 19:31:06 2012 +0100
@@ -19,7 +19,6 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
- *
  */
 
 #include "precompiled.hpp"