diff src/share/vm/c1/c1_Runtime1.cpp @ 4048:cec1757a0134

7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely Reviewed-by: never, bdelsart
author twisti
date Thu, 27 Oct 2011 04:43:37 -0700
parents c124e2e7463e
children 04b9a2566eec 20334ed5ed3c
line wrap: on
line diff
--- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Oct 26 06:08:56 2011 -0700
+++ b/src/share/vm/c1/c1_Runtime1.cpp	Thu Oct 27 04:43:37 2011 -0700
@@ -681,6 +681,23 @@
   }
 JRT_END
 
+// Cf. OptoRuntime::deoptimize_caller_frame
+JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
+  // Called from within the owner thread, so no need for safepoint
+  RegisterMap reg_map(thread, false);
+  frame stub_frame = thread->last_frame();
+  assert(stub_frame.is_runtime_frame(), "sanity check");
+  frame caller_frame = stub_frame.sender(&reg_map);
+
+  // We are coming from a compiled method; check this is true.
+  assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
+
+  // Deoptimize the caller frame.
+  Deoptimization::deoptimize_frame(thread, caller_frame.id());
+
+  // Return to the now deoptimized frame.
+JRT_END
+
 
 static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
   Bytecode_field field_access(caller, bci);