use of org.graalvm.compiler.options.OptionKey in project graal by oracle.
the class GraalOSRLockTest method testLockOSRRecursive.
@Test
@SuppressWarnings("try")
public void testLockOSRRecursive() {
run(() -> {
// call it
testRecursiveLockingLeaf();
ResolvedJavaMethod leaf = getResolvedJavaMethod("testRecursiveLockingLeaf");
// profile it
leaf.reprofile();
testRecursiveLockingLeaf();
EconomicMap<OptionKey<?>, Object> overrides = osrLockNoDeopt();
overrides.put(HighTier.Options.Inline, false);
OptionValues options = new OptionValues(getInitialOptions(), overrides);
DebugContext debug = getDebugContext(options);
compile(debug, leaf, -1);
testOSR(options, "testRecursiveLockingRoot");
});
}
use of org.graalvm.compiler.options.OptionKey in project graal by oracle.
the class GraalOSRLockTest method testLockOSRRecursiveLeafOSR.
@Test
@SuppressWarnings("try")
public void testLockOSRRecursiveLeafOSR() {
run(() -> {
testRecursiveRootNoOSR();
ResolvedJavaMethod root = getResolvedJavaMethod("testRecursiveRootNoOSR");
EconomicMap<OptionKey<?>, Object> overrides = osrLockNoDeopt();
overrides.put(HighTier.Options.Inline, false);
OptionValues options = new OptionValues(getInitialOptions(), overrides);
DebugContext debug = getDebugContext(options);
compile(debug, root, -1);
testOSR(options, "testRecursiveLeafOSR");
// force a safepoint and hope the inflated locks are deflated
System.gc();
// call the root to call into the leaf and enter the osr-ed code
testRecursiveRootNoOSR();
});
}
use of org.graalvm.compiler.options.OptionKey in project graal by oracle.
the class CompileTheWorld method loadOptions.
public static OptionValues loadOptions(OptionValues initialValues) {
EconomicMap<OptionKey<?>, Object> values = OptionValues.newOptionMap();
List<OptionDescriptors> loader = singletonList(DESCRIPTORS);
OptionsParser.parseOptions(extractEntries(System.getProperties(), "CompileTheWorld.", true), values, loader);
OptionValues options = new OptionValues(initialValues, values);
if (Options.Help.getValue(options)) {
options.printHelp(loader, System.out, "CompileTheWorld.");
System.exit(0);
}
return options;
}
use of org.graalvm.compiler.options.OptionKey in project graal by oracle.
the class DumpPathTest method testDump.
@Test
public void testDump() throws IOException {
Path dumpDirectoryPath = Files.createTempDirectory("DumpPathTest");
String[] extensions = new String[] { ".cfg", ".bgv", ".graph-strings" };
EconomicMap<OptionKey<?>, Object> overrides = OptionValues.newOptionMap();
overrides.put(DebugOptions.DumpPath, dumpDirectoryPath.toString());
overrides.put(DebugOptions.PrintGraphFile, true);
overrides.put(DebugOptions.PrintCanonicalGraphStrings, true);
overrides.put(DebugOptions.Dump, "*");
// Generate dump files.
test(new OptionValues(getInitialOptions(), overrides), "snippet");
// Check that Ideal files got created, in the right place.
checkForFiles(dumpDirectoryPath, extensions);
// Clean up the generated files.
scrubDirectory(dumpDirectoryPath);
}
use of org.graalvm.compiler.options.OptionKey in project graal by oracle.
the class RuntimeOptionFeature method collectOptionKeys.
private Object collectOptionKeys(Object obj) {
if (obj instanceof OptionKey) {
OptionKey<?> optionKey = (OptionKey<?>) obj;
if (!(optionKey instanceof HostedOptionKey)) {
OptionDescriptor optionDescriptor = optionKey.getDescriptor();
if (optionDescriptor == null) {
throw VMError.shouldNotReachHere("No OptionDescriptor registered for an OptionKey. Often that is the result of an incomplete build. " + "The registration code is generated by an annotation processor at build time, so a clean and full rebuild often helps to solve this problem");
}
reachableOptions.put(optionDescriptor, true);
}
}
return obj;
}
Aggregations