changeset 51170:7410cb248bbf

8207202: [Graal] compiler/graalunit/CoreTest.java fails Reviewed-by: kvn
author never
date Thu, 19 Jul 2018 12:55:24 -0700
parents 0058ffa0a922
children c3a089b16cc9
files src/hotspot/share/interpreter/interpreterRuntime.cpp
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Thu Jul 19 11:15:38 2018 -0700
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Thu Jul 19 12:55:24 2018 -0700
@@ -435,6 +435,7 @@
 
 
 IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
+  // Produce the error message first because note_trap can safepoint
   ResourceMark rm(thread);
   const char* klass_name = obj->klass()->external_name();
   // lookup exception klass
@@ -448,20 +449,22 @@
 IRT_END
 
 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, arrayOopDesc* a, jint index))
+  // Produce the error message first because note_trap can safepoint
+  ResourceMark rm(thread);
+  stringStream ss;
+  ss.print("Index %d out of bounds for length %d", index, a->length());
+
   if (ProfileTraps) {
     note_trap(thread, Deoptimization::Reason_range_check, CHECK);
   }
 
-  ResourceMark rm(thread);
-  stringStream ss;
-  ss.print("Index %d out of bounds for length %d", index, a->length());
-
   THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
 IRT_END
 
 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException(
   JavaThread* thread, oopDesc* obj))
 
+  // Produce the error message first because note_trap can safepoint
   ResourceMark rm(thread);
   char* message = SharedRuntime::generate_class_cast_message(
     thread, obj->klass());