RFR(XS): 8155735: use strings instead of Symbol* in JVMCI exception stubs

Christian Thalinger christian.thalinger at oracle.com
Fri Apr 29 19:29:14 UTC 2016

> On Apr 29, 2016, at 5:55 AM, Roland Schatz <roland.schatz at oracle.com> wrote:
> On 04/29/2016 05:27 PM, Tom Rodriguez wrote:
>> I think you need to handle the case where the symbol doesn’t exist.  lookup_symbol will return NULL if there’s no currently loaded symbol with that name which will lead to a SEGV later.  So you either need to throw an exception here or you should use
>> TempNewSymbol symbol = SymbolTable::new_symbol
> SymbolTable::lookup should add it if it doesn't exist.

new_symbol actually calls lookup but I think you’d still want the TempNewSymbol.  Runtime people would know better.

>> and let new_exception throw an exception if the class named by symbol doesn’t exist.
> throw_and_post_jvmti_exception will throw a `NoClassDefFoundError` when the exception class doesn't exist.
> Just to be sure, I tested this using graal. Temporarily passing in a wrong class name into the stub results in:
>> java.lang.NoClassDefFoundError: bla/java/lang/NullPointerException
>>        at com.oracle.graal.replacements.test.CompiledNullPointerExceptionTest.testSnippet(CompiledNullPointerExceptionTest.java:93)
>>        at jdk.vm.ci.hotspot.CompilerToVM.executeInstalledCode(Native Method)
>>        at jdk.vm.ci.hotspot.HotSpotNmethod.executeVarargs(HotSpotNmethod.java:100)
>>        at com.oracle.graal.compiler.test.GraalCompilerTest.executeActual(GraalCompilerTest.java:578)
>> [...]
> - Roland

More information about the hotspot-compiler-dev mailing list