Remove noinline directives from new commit phase (#20241)
My theory for too much inlining contributing to overall stack size is likely flawed, because Closure reuses variables within a function to optimize registers. Even if my theory were correct, the impact would be minimal anyway because the recursive implementation of the commit phase traversals is behind a disabled feature flag. Going to revert this. We can maybe test the impact once we land the commit phase changes. In the meantime, I'd prefer to eliminate this delta from the new fork.
Andrew Clark committed
Nov 12, 2020 at 12:21 UTC
1b96ee444e544cc4797bbbd8dee249ff02d62279
1 file changed
-13
packages/react-reconciler/src/ReactFiberCommitWork.new.js
-13
@@ -209,7 +209,6 @@ function safelyCallComponentWillUnmount(current, instance) {
209
}
210
}
211
212
-/** @noinline */
212
function safelyDetachRef(current: Fiber) {
213
const ref = current.ref;
214
if (ref !== null) {
@@ -273,7 +272,6 @@ export function safelyCallDestroy(current: Fiber, destroy: () => void) {
272
}
273
}
274
276
-/** @noinline */
275
function commitHookEffectListUnmount(flags: HookFlags, finishedWork: Fiber) {
276
const updateQueue: FunctionComponentUpdateQueue | null = (finishedWork.updateQueue: any);
277
const lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
@@ -294,7 +292,6 @@ function commitHookEffectListUnmount(flags: HookFlags, finishedWork: Fiber) {
292
}
293
}
294
297
-/** @noinline */
295
function commitHookEffectListMount(flags: HookFlags, finishedWork: Fiber) {
296
const updateQueue: FunctionComponentUpdateQueue | null = (finishedWork.updateQueue: any);
297
const lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
@@ -506,7 +503,6 @@ function iterativelyCommitBeforeMutationEffects_complete() {
503
}
504
}
505
509
-/** @noinline */
506
function commitBeforeMutationEffectsOnFiber(finishedWork: Fiber) {
507
const current = finishedWork.alternate;
508
const flags = finishedWork.flags;
@@ -621,7 +617,6 @@ function commitBeforeMutationEffectsOnFiber(finishedWork: Fiber) {
617
}
618
}
619
624
-/** @noinline */
620
function commitBeforeMutationEffectsDeletions(deletions: Array<Fiber>) {
621
for (let i = 0; i < deletions.length; i++) {
622
const fiber = deletions[i];
@@ -763,7 +758,6 @@ function iterativelyCommitMutationEffects_complete(
758
}
759
}
760
766
-/** @noinline */
761
function commitMutationEffectsOnFiber(
762
fiber: Fiber,
763
root: FiberRoot,
@@ -834,7 +828,6 @@ function commitMutationEffectsOnFiber(
828
}
829
}
830
837
-/** @noinline */
831
function commitMutationEffectsDeletions(
832
deletions: Array<Fiber>,
833
root: FiberRoot,
@@ -1320,7 +1313,6 @@ function commitLayoutEffectsOnFiber(
1313
}
1314
}
1315
1323
-/** @noinline */
1316
function commitLayoutEffectsForProfiler(
1317
finishedWork: Fiber,
1318
finishedRoot: FiberRoot,
@@ -1393,7 +1385,6 @@ function commitLayoutEffectsForProfiler(
1385
}
1386
}
1387
1396
-/** @noinline */
1388
function commitLayoutEffectsForClassComponent(finishedWork: Fiber) {
1389
const instance = finishedWork.stateNode;
1390
const current = finishedWork.alternate;
@@ -1542,7 +1533,6 @@ function commitLayoutEffectsForClassComponent(finishedWork: Fiber) {
1533
}
1534
}
1535
1545
-/** @noinline */
1536
function commitLayoutEffectsForHostRoot(finishedWork: Fiber) {
1537
// TODO: I think this is now always non-null by the time it reaches the
1538
// commit phase. Consider removing the type check.
@@ -1563,7 +1553,6 @@ function commitLayoutEffectsForHostRoot(finishedWork: Fiber) {
1553
}
1554
}
1555
1566
-/** @noinline */
1556
function commitLayoutEffectsForHostComponent(finishedWork: Fiber) {
1557
const instance: Instance = finishedWork.stateNode;
1558
const current = finishedWork.alternate;
@@ -1579,7 +1568,6 @@ function commitLayoutEffectsForHostComponent(finishedWork: Fiber) {
1568
}
1569
}
1570
1582
-/** @noinline */
1571
function hideOrUnhideAllChildren(finishedWork, isHidden) {
1572
if (supportsMutation) {
1573
// We only have the top Fiber that was inserted but we need to recurse down its
@@ -2866,7 +2854,6 @@ function commitSuspenseComponent(finishedWork: Fiber) {
2854
}
2855
}
2856
2869
-/** @noinline */
2857
function commitSuspenseHydrationCallbacks(
2858
finishedRoot: FiberRoot,
2859
finishedWork: Fiber,