changeset 7019:6838696d54ac

cleanly handle a failure to install Graal compiled code due to failed dependency (re)checking
author Doug Simon <doug.simon@oracle.com>
date Mon, 26 Nov 2012 11:21:18 +0100
parents 17eeac928874
children 472609cc3e10
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java src/share/vm/graal/graalCompilerToVM.cpp
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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());