Skip to content

Commit

Permalink
Delete unused eventTimes Fiber field (#26599)
Browse files Browse the repository at this point in the history
DiffTrain build for [58742c2](58742c2)
  • Loading branch information
acdlite committed Apr 11, 2023
1 parent be590dd commit e2c8a46
Show file tree
Hide file tree
Showing 18 changed files with 804 additions and 1,468 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0b931f90e8964183f08ac328e7350d847abb08f9
58742c21b8c3237e8b66c7df4e200504846a01ae
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-d66c88c7";
var ReactVersion = "18.3.0-www-modern-c910362f";

// ATTENTION
// When adding new symbols to this file,
Expand Down
104 changes: 29 additions & 75 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-ab122236";
var ReactVersion = "18.3.0-www-classic-e55ff31a";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -2161,7 +2161,7 @@ function createLaneMap(initial) {

return laneMap;
}
function markRootUpdated(root, updateLane, eventTime) {
function markRootUpdated(root, updateLane) {
root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update
// could unblock them. Clear the suspended lanes so that we can try rendering
// them again.
Expand All @@ -2179,12 +2179,6 @@ function markRootUpdated(root, updateLane, eventTime) {
root.suspendedLanes = NoLanes;
root.pingedLanes = NoLanes;
}

var eventTimes = root.eventTimes;
var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most
// recent event, and we assume time is monotonically increasing.

eventTimes[index] = eventTime;
}
function markRootSuspended$1(root, suspendedLanes) {
root.suspendedLanes |= suspendedLanes;
Expand Down Expand Up @@ -2217,7 +2211,6 @@ function markRootFinished(root, remainingLanes) {
root.entangledLanes &= remainingLanes;
root.errorRecoveryDisabledLanes &= remainingLanes;
var entanglements = root.entanglements;
var eventTimes = root.eventTimes;
var expirationTimes = root.expirationTimes;
var hiddenUpdates = root.hiddenUpdates; // Clear the lanes that no longer have pending work

Expand All @@ -2227,7 +2220,6 @@ function markRootFinished(root, remainingLanes) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
entanglements[index] = NoLanes;
eventTimes[index] = NoTimestamp;
expirationTimes[index] = NoTimestamp;
var hiddenUpdatesForLane = hiddenUpdates[index];

Expand Down Expand Up @@ -8790,7 +8782,7 @@ function forceStoreRerender(fiber) {
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}

Expand Down Expand Up @@ -9437,8 +9429,7 @@ function refreshCache(fiber, seedKey, seedValue) {
var root = enqueueUpdate(provider, refreshUpdate, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, provider, lane, eventTime);
scheduleUpdateOnFiber(root, provider, lane);
entangleTransitions(root, provider, lane);
} // TODO: If a refresh never commits, the new cache created here must be
// released. A simple case is start refreshing a cache boundary, but then
Expand Down Expand Up @@ -9492,8 +9483,7 @@ function dispatchReducerAction(fiber, queue, action) {
var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
scheduleUpdateOnFiber(root, fiber, lane);
entangleTransitionUpdate(root, queue, lane);
}
}
Expand Down Expand Up @@ -9576,8 +9566,7 @@ function dispatchSetState(fiber, queue, action) {
var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
scheduleUpdateOnFiber(root, fiber, lane);
entangleTransitionUpdate(root, queue, lane);
}
}
Expand Down Expand Up @@ -11064,8 +11053,7 @@ var classComponentUpdater = {
var root = enqueueUpdate(fiber, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
scheduleUpdateOnFiber(root, fiber, lane);
entangleTransitions(root, fiber, lane);
}

Expand Down Expand Up @@ -11100,8 +11088,7 @@ var classComponentUpdater = {
var root = enqueueUpdate(fiber, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
scheduleUpdateOnFiber(root, fiber, lane);
entangleTransitions(root, fiber, lane);
}

Expand Down Expand Up @@ -11136,8 +11123,7 @@ var classComponentUpdater = {
var root = enqueueUpdate(fiber, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
scheduleUpdateOnFiber(root, fiber, lane);
entangleTransitions(root, fiber, lane);
}

Expand Down Expand Up @@ -15081,16 +15067,9 @@ function updateDehydratedSuspenseComponent(
// Intentionally mutating since this render will get interrupted. This
// is one of the very rare times where we mutate the current tree
// during the render phase.
suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render

var eventTime = NoTimestamp;
suspenseState.retryLane = attemptHydrationAtLane;
enqueueConcurrentRenderForLane(current, attemptHydrationAtLane);
scheduleUpdateOnFiber(
root,
current,
attemptHydrationAtLane,
eventTime
); // Throw a special object that signals to the work loop that it should
scheduleUpdateOnFiber(root, current, attemptHydrationAtLane); // Throw a special object that signals to the work loop that it should
// interrupt the current render.
//
// Because we're inside a React-only execution stack, we don't
Expand Down Expand Up @@ -20976,7 +20955,7 @@ function detachOffscreenInstance(instance) {

if (root !== null) {
instance._pendingVisibility |= OffscreenDetached;
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}
function attachOffscreenInstance(instance) {
Expand All @@ -20997,7 +20976,7 @@ function attachOffscreenInstance(instance) {

if (root !== null) {
instance._pendingVisibility &= ~OffscreenDetached;
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}

Expand Down Expand Up @@ -23744,11 +23723,7 @@ var isFlushingPassiveEffects = false;
var didScheduleUpdateDuringPassiveEffects = false;
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
var nestedPassiveUpdateCount = 0;
var rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their
// event times as simultaneous, even if the actual clock time has advanced
// between the first and second call.

var currentEventTime = NoTimestamp;
var rootWithPassiveNestedUpdates = null;
var currentEventTransitionLane = NoLanes;
var isRunningInsertionEffect = false;
function getWorkInProgressRoot() {
Expand All @@ -23760,20 +23735,6 @@ function getWorkInProgressRootRenderLanes() {
function isWorkLoopSuspendedOnData() {
return workInProgressSuspendedReason === SuspendedOnData;
}
function requestEventTime() {
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
// We're inside React, so it's fine to read the actual time.
return now$1();
} // We're not inside React, so we may be in the middle of a browser event.

if (currentEventTime !== NoTimestamp) {
// Use the same start time for all updates until we enter React again.
return currentEventTime;
} // This is the first update since React yielded. Compute a new start time.

currentEventTime = now$1();
return currentEventTime;
}
function requestUpdateLane(fiber) {
// Special cases
var mode = fiber.mode;
Expand Down Expand Up @@ -23857,7 +23818,7 @@ function requestRetryLane(fiber) {
return claimNextRetryLane();
}

function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
function scheduleUpdateOnFiber(root, fiber, lane) {
{
if (isRunningInsertionEffect) {
error("useInsertionEffect must not schedule updates.");
Expand All @@ -23883,7 +23844,7 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
markRootSuspended(root, workInProgressRootRenderLanes);
} // Mark that the root has a pending update.

markRootUpdated(root, lane, eventTime);
markRootUpdated(root, lane);

if (
(executionContext & RenderContext) !== NoLanes &&
Expand Down Expand Up @@ -23995,10 +23956,8 @@ function isUnsafeClassRenderPhaseUpdate(fiber) {
function performConcurrentWorkOnRoot(root, didTimeout) {
{
resetNestedUpdateFlag();
} // Since we know we're in a React event, we can clear the current
// event time. The next update will compute a new event time.
}

currentEventTime = NoTimestamp;
currentEventTransitionLane = NoLanes;

if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
Expand Down Expand Up @@ -26246,10 +26205,9 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
var errorInfo = createCapturedValueAtFiber(error, sourceFiber);
var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
var root = enqueueUpdate(rootFiber, update, SyncLane);
var eventTime = requestEventTime();

if (root !== null) {
markRootUpdated(root, SyncLane, eventTime);
markRootUpdated(root, SyncLane);
ensureRootIsScheduled(root);
}
}
Expand Down Expand Up @@ -26285,10 +26243,9 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
var root = enqueueUpdate(fiber, update, SyncLane);
var eventTime = requestEventTime();

if (root !== null) {
markRootUpdated(root, SyncLane, eventTime);
markRootUpdated(root, SyncLane);
ensureRootIsScheduled(root);
}

Expand Down Expand Up @@ -26414,11 +26371,10 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) {
retryLane = requestRetryLane(boundaryFiber);
} // TODO: Special case idle priority?

var eventTime = requestEventTime();
var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);

if (root !== null) {
markRootUpdated(root, retryLane, eventTime);
markRootUpdated(root, retryLane);
ensureRootIsScheduled(root);
}
}
Expand Down Expand Up @@ -27154,7 +27110,7 @@ function scheduleFibersWithFamiliesRecursively(
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}

Expand Down Expand Up @@ -28048,7 +28004,6 @@ function FiberRootNode(
this.next = null;
this.callbackNode = null;
this.callbackPriority = NoLane;
this.eventTimes = createLaneMap(NoLanes);
this.expirationTimes = createLaneMap(NoTimestamp);
this.pendingLanes = NoLanes;
this.suspendedLanes = NoLanes;
Expand Down Expand Up @@ -28286,8 +28241,7 @@ function updateContainer(element, container, parentComponent, callback) {
var root = enqueueUpdate(current$1, update, lane);

if (root !== null) {
var eventTime = requestEventTime();
scheduleUpdateOnFiber(root, current$1, lane, eventTime);
scheduleUpdateOnFiber(root, current$1, lane);
entangleTransitions(root, current$1, lane);
}

Expand Down Expand Up @@ -28435,7 +28389,7 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}
};
Expand All @@ -28456,7 +28410,7 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}
};
Expand All @@ -28477,7 +28431,7 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
}
}; // Support DevTools props for function components, forwardRef, memo, host components, etc.
Expand All @@ -28492,7 +28446,7 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
};

Expand All @@ -28506,7 +28460,7 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
};

Expand All @@ -28520,15 +28474,15 @@ var setSuspenseHandler = null;
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
};

scheduleUpdate = function (fiber) {
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);

if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
scheduleUpdateOnFiber(root, fiber, SyncLane);
}
};

Expand Down
Loading

0 comments on commit e2c8a46

Please sign in to comment.