changeset 23995:988dc143e0bf

8173699: Crash during deoptimization with "assert(result == __null || result->is_oop()) failed: must be oop" Summary: Ignore return_oop() when dispatching an exception and only try to retrieve the oop when performing re-allocation during a normal deoptimization (if exec_mode == Unpack_deopt). Reviewed-by: kvn, vlivanov
author thartmann
date Fri, 03 Feb 2017 08:17:35 +0100
parents ebce30b702eb
children 11f0412408cd
files src/share/vm/runtime/deoptimization.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp	Thu Feb 02 23:58:25 2017 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Fri Feb 03 08:17:35 2017 +0100
@@ -250,8 +250,9 @@
       // It is not guaranteed that we can get such information here only
       // by analyzing bytecode in deoptimized frames. This is why this flag
       // is set during method compilation (see Compile::Process_OopMap_Node()).
-      // If the previous frame was popped, we don't have a result.
-      bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution();
+      // If the previous frame was popped or if we are dispatching an exception,
+      // we don't have an oop result.
+      bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution() && (exec_mode == Unpack_deopt);
       Handle return_value;
       if (save_oop_result) {
         // Reallocation may trigger GC. If deoptimization happened on return from