# HG changeset patch # User Doug Simon # Date 1370613586 -7200 # Node ID 0927013db134225a6dddd75295ebb3f6b035fe5e # Parent 2a091d2987bdc497ee50ef1ff2e83ad8c5a8f1f5 fail fast if a non-default value for GraalRuntime was specified and the corresponding factory is not available diff -r 2a091d2987bd -r 0927013db134 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Jun 07 15:59:09 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Jun 07 15:59:46 2013 +0200 @@ -31,6 +31,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.target.*; +import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.bridge.*; import com.oracle.graal.hotspot.logging.*; import com.oracle.graal.hotspot.meta.*; @@ -87,9 +88,11 @@ runtime.compilerToVm = toVM; } + private static final String DEFAULT_GRAAL_RUNTIME = "basic"; + // @formatter:off @Option(help = "The runtime configuration to use") - private static final OptionValue GraalRuntime = new OptionValue<>("basic"); + private static final OptionValue GraalRuntime = new OptionValue<>(DEFAULT_GRAAL_RUNTIME); // @formatter:on protected static HotSpotGraalRuntimeFactory findFactory(String architecture) { @@ -98,6 +101,11 @@ return factory; } } + if (!DEFAULT_GRAAL_RUNTIME.equals(GraalRuntime.getValue())) { + // Fail fast if a non-default value for GraalRuntime was specified + // and the corresponding factory is not available + throw new GraalInternalError("Specified runtime \"%s\" not available for the %s architecture", GraalRuntime.getValue(), architecture); + } return null; }