# HG changeset patch # User Doug Simon # Date 1353925278 -3600 # Node ID 6838696d54ac59b6dd917ee1447a68e3e827da17 # Parent 17eeac928874df1e0c25420bbccf313c2e218537 cleanly handle a failure to install Graal compiled code due to failed dependency (re)checking diff -r 17eeac928874 -r 6838696d54ac graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Fri Nov 23 16:03:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon Nov 26 11:21:18 2012 +0100 @@ -123,7 +123,7 @@ * @param code if not null, then the code is installed as the non-default compiled code for the associated method * and the details of the installation are written to this object * @param info additional information about the installation are written to this object if it is not null - * @return the value of {@code code} + * @return the value of {@code code} if installation was successful, null otherwise */ HotSpotInstalledCode installCode(HotSpotCompilationResult compResult, HotSpotInstalledCode code, HotSpotCodeInfo info); diff -r 17eeac928874 -r 6838696d54ac src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Nov 23 16:03:39 2012 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Mon Nov 26 11:21:18 2012 +0100 @@ -776,6 +776,11 @@ Handle installed_code_handle = JNIHandles::resolve(installed_code); CodeInstaller installer(compResultHandle, method, nm, installed_code_handle); + if (nm == NULL) { + // dependency (re)checking failed + return NULL; + } + if (info != NULL) { arrayOop codeCopy = oopFactory::new_byteArray(nm->code_size(), CHECK_0); memcpy(codeCopy->base(T_BYTE), nm->code_begin(), nm->code_size());