Skip to content

Commit

Permalink
Remove redundant lookups of the engine data.
Browse files Browse the repository at this point in the history
  • Loading branch information
chumer committed Nov 5, 2019
1 parent d382b39 commit b49b9f2
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ static void beforeCall(OptimizedDirectCallNode call, OptimizedCallTarget current
}
}

private static EngineData getEngineData(OptimizedDirectCallNode callNode) {
return GraalTVMCI.getEngineData(callNode.getCallTarget().getRootNode());
}

private static void doSplit(EngineData engineData, OptimizedDirectCallNode call) {
if (engineData.traceSplittingSummary) {
calculateSplitWasteImpl(call.getCurrentCallTarget());
Expand All @@ -78,9 +74,8 @@ private static boolean shouldSplit(EngineData engine, OptimizedDirectCallNode ca
if (!callTarget.isNeedsSplit()) {
return false;
}
final EngineData engineData = getEngineData(call);
if (!canSplit(engine, call) || isRecursiveSplit(call, RECURSIVE_SPLIT_DEPTH) ||
engineData.splitCount + call.getCallTarget().getUninitializedNodeCount() >= engineData.splitLimit) {
engine.splitCount + call.getCallTarget().getUninitializedNodeCount() >= engine.splitLimit) {
return false;
}
if (callTarget.getUninitializedNodeCount() > engine.splittingMaxCalleeSize) {
Expand All @@ -90,7 +85,7 @@ private static boolean shouldSplit(EngineData engine, OptimizedDirectCallNode ca
}

static void forceSplitting(OptimizedDirectCallNode call) {
final EngineData engineData = getEngineData(call);
final EngineData engineData = call.getCallTarget().engine;
if (engineData.splittingAllowForcedSplits) {
if (!canSplit(engineData, call) || isRecursiveSplit(call, RECURSIVE_SPLIT_DEPTH)) {
return;
Expand Down

0 comments on commit b49b9f2

Please sign in to comment.