8169938: [AOT] SIGSEGV at ~BufferBlob::vtable chunks
authordlong
Tue, 20 Dec 2016 20:38:14 -0800
changeset 42861 1d4dfdf4390b
parent 42845 17469f16fbb4
child 42862 24ee5092cc0b
8169938: [AOT] SIGSEGV at ~BufferBlob::vtable chunks Summary: set "return_oop" on AOT scopes Reviewed-by: kvn, never
hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp
hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp
--- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Wed Jul 05 22:37:14 2017 +0200
+++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Tue Dec 20 20:38:14 2016 -0800
@@ -967,7 +967,7 @@
   return objects;
 }
 
-void CodeInstaller::record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, TRAPS) {
+void CodeInstaller::record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, bool return_oop, TRAPS) {
   Handle position = DebugInfo::bytecodePosition(debug_info);
   if (position.is_null()) {
     // Stubs do not record scope info, just oop maps
@@ -980,10 +980,10 @@
   } else {
     objectMapping = NULL;
   }
-  record_scope(pc_offset, position, scope_mode, objectMapping, CHECK);
+  record_scope(pc_offset, position, scope_mode, objectMapping, return_oop, CHECK);
 }
 
-void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, TRAPS) {
+void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, bool return_oop, TRAPS) {
   Handle frame;
   if (scope_mode == CodeInstaller::FullFrame) {
     if (!position->is_a(BytecodeFrame::klass())) {
@@ -993,7 +993,7 @@
   }
   Handle caller_frame = BytecodePosition::caller(position);
   if (caller_frame.not_null()) {
-    record_scope(pc_offset, caller_frame, scope_mode, objects, CHECK);
+    record_scope(pc_offset, caller_frame, scope_mode, objects, return_oop, CHECK);
   }
 
   Handle hotspot_method = BytecodePosition::method(position);
@@ -1083,7 +1083,7 @@
     throw_exception = BytecodeFrame::rethrowException(frame) == JNI_TRUE;
   }
 
-  _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, false,
+  _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, return_oop,
                                   locals_token, expressions_token, monitors_token);
 }
 
@@ -1139,7 +1139,10 @@
   if (debug_info.not_null()) {
     OopMap *map = create_oop_map(debug_info, CHECK);
     _debug_recorder->add_safepoint(next_pc_offset, map);
-    record_scope(next_pc_offset, debug_info, CodeInstaller::FullFrame, CHECK);
+
+    bool return_oop = hotspot_method.not_null() && getMethodFromHotSpotMethod(hotspot_method())->is_returning_oop();
+
+    record_scope(next_pc_offset, debug_info, CodeInstaller::FullFrame, return_oop, CHECK);
   }
 
   if (foreign_call.not_null()) {
--- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp	Wed Jul 05 22:37:14 2017 +0200
+++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp	Tue Dec 20 20:38:14 2016 -0800
@@ -254,8 +254,11 @@
     FullFrame
   };
 
-  void record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, TRAPS);
-  void record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, TRAPS);
+  void record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, bool return_oop, TRAPS);
+  void record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, TRAPS) {
+    record_scope(pc_offset, debug_info, scope_mode, false /* return_oop */, THREAD);
+  }
+  void record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, bool return_oop, TRAPS);
   void record_object_value(ObjectValue* sv, Handle value, GrowableArray<ScopeValue*>* objects, TRAPS);
 
   GrowableArray<ScopeValue*>* record_virtual_objects(Handle debug_info, TRAPS);