# HG changeset patch # User Doug Simon # Date 1399838406 -7200 # Node ID 55977f9fa56fcc6b3bbeaf1c9794520e0ea115ae # Parent 1e63e4b5ef6d2962127a8b4c29720c63f3761a65 fixed assertion position and documented critical class initialization dependency diff -r 1e63e4b5ef6d -r 55977f9fa56f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java Sun May 11 13:43:58 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java Sun May 11 22:00:06 2014 +0200 @@ -33,6 +33,7 @@ import java.nio.file.*; import java.util.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.logging.*; @@ -247,8 +248,9 @@ unconditionallyEnableTimerOrMetric(InliningUtil.class, "InlinedBytecodes"); unconditionallyEnableTimerOrMetric(CompilationTask.class, "CompilationTime"); } + assert !Debug.Initialization.isDebugInitialized() : "The class " + Debug.class.getName() + " must not be initialized before the Graal runtime has been initialized. " + + "This can be fixed by placing a call to " + Graal.class.getName() + ".runtime() on the path that triggers initialization of " + Debug.class.getName(); if (areDebugScopePatternsEnabled()) { - assert !Debug.Initialization.isDebugInitialized(); System.setProperty(Debug.Initialization.INITIALIZER_PROPERTY_NAME, "true"); } } diff -r 1e63e4b5ef6d -r 55977f9fa56f graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DebugEnvironment.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DebugEnvironment.java Sun May 11 13:43:58 2014 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DebugEnvironment.java Sun May 11 22:00:06 2014 +0200 @@ -35,7 +35,11 @@ public class DebugEnvironment { public static GraalDebugConfig initialize(PrintStream log) { + + // Ensure Graal runtime is initialized prior to Debug being initialized as the former + // included processing command line options used by the latter. Graal.getRuntime(); + if (!Debug.isEnabled()) { log.println("WARNING: Scope debugging needs to be enabled with -esa or -D" + Debug.Initialization.INITIALIZER_PROPERTY_NAME + "=true"); return null;