Mercurial > hg > graal-compiler
diff src/share/vm/runtime/deoptimization.cpp @ 1922:5caa30ea147b
Merge
author | iveresov |
---|---|
date | Mon, 08 Nov 2010 14:33:48 -0800 |
parents | ce6848d0666d |
children | 4853c5cad3aa f95d63e2154a |
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp Thu Nov 04 16:17:54 2010 -0700 +++ b/src/share/vm/runtime/deoptimization.cpp Mon Nov 08 14:33:48 2010 -0800 @@ -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)) {