8155735: use strings instead of Symbol* in JVMCI exception stubs
authorrschatz
Tue, 03 May 2016 11:57:03 +0200
changeset 38229 7d3bad8f8ec8
parent 38227 2ad0ebc407ab
child 38230 700d01e49492
8155735: use strings instead of Symbol* in JVMCI exception stubs Reviewed-by: never, twisti
hotspot/src/share/vm/jvmci/jvmciRuntime.cpp
hotspot/src/share/vm/jvmci/jvmciRuntime.hpp
--- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Mon May 02 03:24:02 2016 +0300
+++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp	Tue May 03 11:57:03 2016 +0200
@@ -425,19 +425,22 @@
   }
 JRT_END
 
-JRT_ENTRY(void, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, Symbol* name, const char* message))
-  SharedRuntime::throw_and_post_jvmti_exception(thread, name, message);
+JRT_ENTRY(void, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message))
+  TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK);
+  SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message);
 JRT_END
 
-JRT_ENTRY(void, JVMCIRuntime::throw_klass_external_name_exception(JavaThread* thread, Symbol* exception, Klass* klass))
+JRT_ENTRY(void, JVMCIRuntime::throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass))
   ResourceMark rm(thread);
-  SharedRuntime::throw_and_post_jvmti_exception(thread, exception, klass->external_name());
+  TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK);
+  SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, klass->external_name());
 JRT_END
 
-JRT_ENTRY(void, JVMCIRuntime::throw_class_cast_exception(JavaThread* thread, Symbol* exception, Klass* caster_klass, Klass* target_klass))
+JRT_ENTRY(void, JVMCIRuntime::throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass))
   ResourceMark rm(thread);
   const char* message = SharedRuntime::generate_class_cast_message(caster_klass, target_klass);
-  SharedRuntime::throw_and_post_jvmti_exception(thread, exception, message);
+  TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK);
+  SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message);
 JRT_END
 
 JRT_LEAF(void, JVMCIRuntime::log_object(JavaThread* thread, oopDesc* obj, bool as_string, bool newline))
--- a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp	Mon May 02 03:24:02 2016 +0300
+++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp	Tue May 03 11:57:03 2016 +0200
@@ -156,10 +156,10 @@
   static void new_store_pre_barrier(JavaThread* thread);
 
   // used to throw exceptions from compiled JVMCI code
-  static void throw_and_post_jvmti_exception(JavaThread* thread, Symbol* exception, const char* message);
+  static void throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message);
   // helper methods to throw exception with complex messages
-  static void throw_klass_external_name_exception(JavaThread* thread, Symbol* exception, Klass* klass);
-  static void throw_class_cast_exception(JavaThread* thread, Symbol* exception, Klass* caster_klass, Klass* target_klass);
+  static void throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass);
+  static void throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass);
 
   // Test only function
   static int test_deoptimize_call_int(JavaThread* thread, int value);