diff src/share/vm/runtime/deoptimization.cpp @ 1905:ce6848d0666d

6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places Reviewed-by: kvn, twisti
author never
date Tue, 19 Oct 2010 16:14:34 -0700
parents fd5d4527cdf5
children 4853c5cad3aa f95d63e2154a
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp	Mon Oct 18 15:43:29 2010 -0700
+++ b/src/share/vm/runtime/deoptimization.cpp	Tue Oct 19 16:14:34 2010 -0700
@@ -1065,7 +1065,9 @@
 }
 
 
-void Deoptimization::deoptimize_frame(JavaThread* thread, intptr_t* id) {
+void Deoptimization::deoptimize_frame_internal(JavaThread* thread, intptr_t* id) {
+  assert(thread == Thread::current() || SafepointSynchronize::is_at_safepoint(),
+         "can only deoptimize other thread at a safepoint");
   // Compute frame and register map based on thread and sp.
   RegisterMap reg_map(thread, UseBiasedLocking);
   frame fr = thread->last_frame();
@@ -1076,6 +1078,16 @@
 }
 
 
+void Deoptimization::deoptimize_frame(JavaThread* thread, intptr_t* id) {
+  if (thread == Thread::current()) {
+    Deoptimization::deoptimize_frame_internal(thread, id);
+  } else {
+    VM_DeoptimizeFrame deopt(thread, id);
+    VMThread::execute(&deopt);
+  }
+}
+
+
 // JVMTI PopFrame support
 JRT_LEAF(void, Deoptimization::popframe_preserve_args(JavaThread* thread, int bytes_to_save, void* start_address))
 {