changeset 23346:39f25354aeee

Sync speculation log changes with JDK9 version
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 07 Apr 2016 11:09:49 -0700
parents 1c4b6a7f1917
children 7ae6a635fad0
files jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
diffstat 3 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java	Thu Apr 07 13:56:58 2016 +0200
+++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java	Thu Apr 07 11:09:49 2016 -0700
@@ -120,8 +120,9 @@
             resultInstalledCode = installedCode;
         }
 
-        HotSpotSpeculationLog hsLog = (HotSpotSpeculationLog) log;
-        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, hsLog.hasSpeculations() ? hsLog : null);
+        HotSpotSpeculationLog speculationLog = (log != null && log.hasSpeculations()) ? (HotSpotSpeculationLog) log : null;
+
+        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, speculationLog);
         if (result != config.codeInstallResultOk) {
             String resultDesc = config.getCodeInstallResultDescription(result);
             if (compiledCode instanceof HotSpotCompiledNmethod) {
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java	Thu Apr 07 13:56:58 2016 +0200
+++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java	Thu Apr 07 11:09:49 2016 -0700
@@ -82,6 +82,7 @@
         return HotSpotObjectConstantImpl.forObject(reason);
     }
 
+    @Override
     public synchronized boolean hasSpeculations() {
         return speculations != null && !speculations.isEmpty();
     }
--- a/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java	Thu Apr 07 13:56:58 2016 +0200
+++ b/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java	Thu Apr 07 11:09:49 2016 -0700
@@ -56,4 +56,11 @@
      *         argument to the deoptimization function.
      */
     JavaConstant speculate(SpeculationReason reason);
+
+    /**
+     * Returns if this log has speculations.
+     *
+     * @return true if there are speculations, false otherwise
+     */
+    boolean hasSpeculations();
 }