Skip to content

Commit

Permalink
Do not pass the speculationLog into the TruffleTierContext.
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-spas committed Mar 14, 2022
1 parent 7d77e43 commit 7ac7747
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,17 +541,11 @@ private void compileAST(TruffleCompilationWrapper wrapper, DebugContext debug) {

@SuppressWarnings("try")
private StructuredGraph truffleTier(TruffleCompilationWrapper wrapper, DebugContext debug) {
SpeculationLog speculationLog = wrapper.compilable.getCompilationSpeculationLog();
if (speculationLog != null) {
speculationLog.collectFailedSpeculations();
}
StructuredGraph graph;
try (DebugCloseable a = PartialEvaluationTime.start(debug);
DebugCloseable c = PartialEvaluationMemUse.start(debug);
PerformanceInformationHandler handler = PerformanceInformationHandler.install(wrapper.options)) {
// SpeculationLog can be read from wrapper.compilable, but I'm not sure of the machinery
// around it
TruffleTierContext context = new TruffleTierContext(partialEvaluator, wrapper, debug, speculationLog, handler);
TruffleTierContext context = new TruffleTierContext(partialEvaluator, wrapper, debug, handler);
try (Scope s = context.debug.scope("CreateGraph", context.graph);
Indent indent = context.debug.logAndIndent("evaluate %s", context.graph);) {
truffleTier.apply(context.graph, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ public TruffleTierContext(PartialEvaluator partialEvaluator, OptionValues option
this.handler = handler;
}

public TruffleTierContext(PartialEvaluator partialEvaluator, TruffleCompilerImpl.TruffleCompilationWrapper wrapper, DebugContext debug, SpeculationLog speculationLog,
PerformanceInformationHandler handler) {
this(partialEvaluator, wrapper.options, debug, wrapper.compilable, partialEvaluator.rootForCallTarget(wrapper.compilable), wrapper.compilationId, speculationLog, wrapper.task, handler);
public TruffleTierContext(PartialEvaluator partialEvaluator, TruffleCompilerImpl.TruffleCompilationWrapper wrapper, DebugContext debug, PerformanceInformationHandler handler) {
this(partialEvaluator, wrapper.options, debug, wrapper.compilable, partialEvaluator.rootForCallTarget(wrapper.compilable), wrapper.compilationId, getSpeculationLog(wrapper), wrapper.task, handler);
}

public boolean isFirstTier() {
return task.isFirstTier();
}

private static SpeculationLog getSpeculationLog(TruffleCompilerImpl.TruffleCompilationWrapper wrapper) {
SpeculationLog speculationLog = wrapper.compilable.getCompilationSpeculationLog();
if (speculationLog != null) {
speculationLog.collectFailedSpeculations();
}
return speculationLog;
}
}

0 comments on commit 7ac7747

Please sign in to comment.