# HG changeset patch # User Doug Simon # Date 1459803548 -7200 # Node ID 32d6bceb9adc659296eb23d6326dd1910249e30d # Parent c8526451bb6baa590f998da595a9ffb21150f641 do not install an empty SpeculationLog in an nmethod (JDK-8153439) diff -r c8526451bb6b -r 32d6bceb9adc jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java --- 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) { diff -r c8526451bb6b -r 32d6bceb9adc jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java Mon Apr 04 22:42:53 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java Mon Apr 04 22:59:08 2016 +0200 @@ -38,7 +38,7 @@ /** All speculations that have been a deoptimization reason. */ private Set failedSpeculations; - /** Strong references to all reasons embededded in the current nmethod. */ + /** Strong references to all reasons embedded in the current nmethod. */ private volatile Collection speculations; @Override @@ -81,4 +81,8 @@ return HotSpotObjectConstantImpl.forObject(reason); } + + public synchronized boolean hasSpeculations() { + return speculations != null && !speculations.isEmpty(); + } }