Skip to content

Commit

Permalink
Internal change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 583460540
Change-Id: I2ee19a8353ac268b8d6000bf4d546eaf9406c60d
  • Loading branch information
Googler authored and copybara-github committed Nov 17, 2023
1 parent 484a4ab commit 79ae49c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public class SequencedSkyframeExecutor extends SkyframeExecutor {

// Use delegation so that the underlying inconsistency receiver can be changed per-command without
// recreating the evaluator.
private final DelegatingGraphInconsistencyReceiver inconsistencyReceiver =
protected final DelegatingGraphInconsistencyReceiver inconsistencyReceiver =
new DelegatingGraphInconsistencyReceiver(GraphInconsistencyReceiver.THROWING);

protected SequencedSkyframeExecutor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class AbstractIncrementalInMemoryMemoizingEvaluator
* Whether to store edges in the graph. Can be false to save memory, in which case incremental
* builds are not possible, and all evaluations will be at {@link Version#constant}.
*/
final boolean keepEdges;
protected final boolean keepEdges;

// Values that the caller explicitly specified are assumed to be changed -- they will be
// re-evaluated even if none of their children are changed.
Expand Down Expand Up @@ -195,4 +195,14 @@ protected void performInvalidation() throws InterruptedException {
// Ditto.
valuesToDirty = new LinkedHashSet<>();
}

protected final Version getNextGraphVersion() {
if (!keepEdges) {
return Version.constant();
} else if (lastGraphVersion == null) {
return IntVersion.of(0);
} else {
return lastGraphVersion.next();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,7 @@ public <T extends SkyValue> EvaluationResult<T> evaluate(
Iterable<? extends SkyKey> roots, EvaluationContext evaluationContext)
throws InterruptedException {
// NOTE: Performance critical code. See bug "Null build performance parity".
Version graphVersion;
if (!keepEdges) {
graphVersion = Version.constant();
} else if (lastGraphVersion == null) {
graphVersion = IntVersion.of(0);
} else {
graphVersion = lastGraphVersion.next();
}
Version graphVersion = getNextGraphVersion();
setAndCheckEvaluateState(true, roots);
try {
// Mark for removal inflight and rewound nodes from the previous evaluation. When the
Expand Down

0 comments on commit 79ae49c

Please sign in to comment.