aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/runtime/deoptimization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/runtime/deoptimization.cpp')
-rw-r--r--src/share/vm/runtime/deoptimization.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp
index 4dd9e9705..e6a14d710 100644
--- a/src/share/vm/runtime/deoptimization.cpp
+++ b/src/share/vm/runtime/deoptimization.cpp
@@ -1065,7 +1065,9 @@ void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map)
}
-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) {
}
+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))
{