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

Roland Schatz roland.schatz at oracle.com
Fri Apr 29 15:55:26 UTC 2016

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.

> 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