hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
changeset 28039 bf5a8340bf8a
parent 27420 04e6f914cce1
child 28196 6ba2bd76ea84
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Dec 05 15:16:01 2014 +0100
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Tue Nov 25 17:33:59 2014 +0100
@@ -385,6 +385,18 @@
   int                handler_bci;
   int                current_bci = bci(thread);
 
+  if (thread->frames_to_pop_failed_realloc() > 0) {
+    // Allocation of scalar replaced object used in this frame
+    // failed. Unconditionally pop the frame.
+    thread->dec_frames_to_pop_failed_realloc();
+    thread->set_vm_result(h_exception());
+    // If the method is synchronized we already unlocked the monitor
+    // during deoptimization so the interpreter needs to skip it when
+    // the frame is popped.
+    thread->set_do_not_unlock_if_synchronized(true);
+    return Interpreter::remove_activation_entry();
+  }
+
   // Need to do this check first since when _do_not_unlock_if_synchronized
   // is set, we don't want to trigger any classloading which may make calls
   // into java, or surprisingly find a matching exception handler for bci 0