diff jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @ 23344:32d6bceb9adc

do not install an empty SpeculationLog in an nmethod (JDK-8153439)
author Doug Simon <doug.simon@oracle.com>
date Mon, 04 Apr 2016 22:59:08 +0200
parents bf8a5a6861b1
children 39f25354aeee
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java	Mon Apr 04 22:42:53 2016 +0200
+++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java	Mon Apr 04 22:59:08 2016 +0200
@@ -120,7 +120,8 @@
             resultInstalledCode = installedCode;
         }
 
-        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, (HotSpotSpeculationLog) log);
+        HotSpotSpeculationLog hsLog = (HotSpotSpeculationLog) log;
+        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, hsLog.hasSpeculations() ? hsLog : null);
         if (result != config.codeInstallResultOk) {
             String resultDesc = config.getCodeInstallResultDescription(result);
             if (compiledCode instanceof HotSpotCompiledNmethod) {