--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java 2017-07-07 09:30:14.000000000 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java 2017-07-07 09:30:14.000000000 -0700 @@ -22,17 +22,18 @@ */ package org.graalvm.compiler.hotspot; +import java.util.ArrayList; +import java.util.List; + +import org.graalvm.compiler.code.CompilationResult; +import org.graalvm.compiler.debug.DebugContext; +import org.graalvm.compiler.debug.DebugOptions; +import org.graalvm.compiler.serviceprovider.GraalServices; + import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotVMEventListener; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.debug.Debug; -import org.graalvm.compiler.debug.GraalDebugConfig; -import org.graalvm.compiler.serviceprovider.GraalServices; - -import java.util.ArrayList; -import java.util.List; public class HotSpotGraalVMEventListener implements HotSpotVMEventListener { @@ -54,13 +55,14 @@ @Override public void notifyInstall(HotSpotCodeCacheProvider codeCache, InstalledCode installedCode, CompiledCode compiledCode) { - if (Debug.isDumpEnabled(Debug.BASIC_LEVEL)) { - CompilationResult compResult = Debug.contextLookup(CompilationResult.class); + DebugContext debug = DebugContext.forCurrentThread(); + if (debug.isDumpEnabled(DebugContext.BASIC_LEVEL)) { + CompilationResult compResult = debug.contextLookup(CompilationResult.class); assert compResult != null : "can't dump installed code properly without CompilationResult"; - Debug.dump(Debug.BASIC_LEVEL, installedCode, "After code installation"); + debug.dump(DebugContext.BASIC_LEVEL, installedCode, "After code installation"); } - if (Debug.isLogEnabled()) { - Debug.log("%s", codeCache.disassemble(installedCode)); + if (debug.isLogEnabled()) { + debug.log("%s", codeCache.disassemble(installedCode)); } for (HotSpotCodeCacheListener listener : listeners) { listener.notifyInstall(codeCache, installedCode, compiledCode); @@ -70,8 +72,8 @@ @Override public void notifyBootstrapFinished() { runtime.notifyBootstrapFinished(); - if (GraalDebugConfig.Options.ClearMetricsAfterBootstrap.getValue(runtime.getOptions())) { - runtime.clearMeters(); + if (DebugOptions.ClearMetricsAfterBootstrap.getValue(runtime.getOptions())) { + runtime.clearMetrics(); } } }