< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java

Print this page
rev 52509 : [mq]: graal

*** 78,88 **** * taken when such objects can be exposed to multiple threads (e.g., they are in a non-thread-local * cache). */ public final class DebugContext implements AutoCloseable { ! public static final Description NO_DESCRIPTION = null; public static final GlobalMetrics NO_GLOBAL_METRIC_VALUES = null; public static final Iterable<DebugHandlersFactory> NO_CONFIG_CUSTOMIZERS = Collections.emptyList(); public static final PrintStream DEFAULT_LOG_STREAM = TTY.out; --- 78,88 ---- * taken when such objects can be exposed to multiple threads (e.g., they are in a non-thread-local * cache). */ public final class DebugContext implements AutoCloseable { ! public static final Description NO_DESCRIPTION = new Description(null, "NO_DESCRIPTION"); public static final GlobalMetrics NO_GLOBAL_METRIC_VALUES = null; public static final Iterable<DebugHandlersFactory> NO_CONFIG_CUSTOMIZERS = Collections.emptyList(); public static final PrintStream DEFAULT_LOG_STREAM = TTY.out;
*** 402,411 **** --- 402,423 ---- */ public static DebugContext create(OptionValues options, Iterable<DebugHandlersFactory> factories) { return new DebugContext(NO_DESCRIPTION, NO_GLOBAL_METRIC_VALUES, DEFAULT_LOG_STREAM, Immutable.create(options), factories); } + public static DebugContext create(OptionValues options, PrintStream logStream, DebugHandlersFactory factory) { + return new DebugContext(NO_DESCRIPTION, NO_GLOBAL_METRIC_VALUES, logStream, Immutable.create(options), Collections.singletonList(factory)); + } + + /** + * Creates a {@link DebugContext} based on a given set of option values and {@code factories}. + * The {@link DebugHandlersFactory#LOADER} can be used for the latter. + */ + public static DebugContext create(OptionValues options, Description description, Iterable<DebugHandlersFactory> factories) { + return new DebugContext(description, NO_GLOBAL_METRIC_VALUES, DEFAULT_LOG_STREAM, Immutable.create(options), factories); + } + /** * Creates a {@link DebugContext}. */ public static DebugContext create(OptionValues options, Description description, GlobalMetrics globalMetrics, PrintStream logStream, Iterable<DebugHandlersFactory> factories) { return new DebugContext(description, globalMetrics, logStream, Immutable.create(options), factories);
< prev index next >