From baaa97f36bbe793a5f11d3bec2d4bbf98f30fc6f Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Fri, 13 Sep 2024 18:59:00 -0700 Subject: [PATCH] [Fiber] Profiler - Use two separate functions instead of branch by flag (#30957) Nit: I don't trust flags in hot code. While it can take somewhat longer to compile two functions and JIT them. After that they don't need to check branches. Also makes it clearer the purpose. DiffTrain build for commit https://github.com/facebook/react/commit/3d95c43b8967d4dda1ec9a22f0d9ea4999fee8b8. --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../cjs/ReactTestRenderer-dev.js | 31 ++++++++++------- .../cjs/ReactTestRenderer-prod.js | 8 ++--- .../cjs/ReactTestRenderer-profiling.js | 30 ++++++++++------- .../vendor/react/react/cjs/React-dev.js | 4 +-- .../vendor/react/react/cjs/React-prod.js | 4 +-- .../vendor/react/react/cjs/React-profiling.js | 4 +-- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 29 ++++++++++------ .../implementations/ReactFabric-prod.fb.js | 6 ++-- .../ReactFabric-profiling.fb.js | 27 +++++++++------ .../ReactNativeRenderer-dev.fb.js | 33 ++++++++++++------- .../ReactNativeRenderer-prod.fb.js | 10 +++--- .../ReactNativeRenderer-profiling.fb.js | 31 ++++++++++------- 14 files changed, 134 insertions(+), 87 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 5891b5c191..f578c1171d 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.0.0-native-fb-d3d4d3a4-20240913 \ No newline at end of file +19.0.0-native-fb-3d95c43b-20240913 \ No newline at end of file diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js index e38af9d6ac..fbf3964407 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<2d89a3e686f85aa5ee5696aad303b4b0>> + * @generated SignedSource<> */ "use strict"; @@ -5032,11 +5032,18 @@ __DEV__ && profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -11149,7 +11156,7 @@ __DEV__ && else switch ( (handler.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(handler, !0), + stopProfilerTimerIfRunningAndRecordDuration(handler), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -11426,7 +11433,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -11485,7 +11492,7 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { @@ -11555,7 +11562,9 @@ __DEV__ && completedWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration( + completedWork + )); if (null !== current) { workInProgress = current; return; @@ -11579,7 +11588,7 @@ __DEV__ && return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -15124,11 +15133,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15273,5 +15282,5 @@ __DEV__ && flushSyncWorkAcrossRoots_impl(0, !0)); } }; - exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; + exports.version = "19.0.0-native-fb-3d95c43b-20240913"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js index 05078d9ac2..79390cebe0 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4f55ec78358c8ebecf4eaa369cc81849>> + * @generated SignedSource<<1bf2ef454808c04dbe363a5699c9a59f>> */ "use strict"; @@ -9486,14 +9486,14 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1266 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function (mockNode) { mockNode = nodeToInstanceMap.get(mockNode); return void 0 !== mockNode ? mockNode.internalInstanceHandle : null; }, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1267 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -9629,4 +9629,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; +exports.version = "19.0.0-native-fb-3d95c43b-20240913"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js index d75dccdd97..1793981ba5 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<2929f47cce484593e96e4514ec4d434b>> */ "use strict"; @@ -3660,11 +3660,18 @@ function startProfilerTimer(fiber) { profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { +function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } +} +function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -8603,8 +8610,7 @@ function handleThrow(root, thrownValue) { ); else switch ( - (handler.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(handler, !0), + (handler.mode & 2 && stopProfilerTimerIfRunningAndRecordDuration(handler), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -8830,7 +8836,7 @@ function performUnitOfWork(unitOfWork) { 0 !== (unitOfWork.mode & 2) ? (startProfilerTimer(unitOfWork), (current = beginWork(current, unitOfWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = beginWork(current, unitOfWork, entangledRenderLanes)); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current @@ -8878,7 +8884,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { resetWorkInProgress(next, entangledRenderLanes)), (current = beginWork(current, next, entangledRenderLanes)); } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDelta(next, !0); + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); next = current; unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); @@ -8937,7 +8943,7 @@ function completeUnitOfWork(unitOfWork) { ? (current = completeWork(current, completedWork, entangledRenderLanes)) : (startProfilerTimer(completedWork), (current = completeWork(current, completedWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork)); if (null !== current) { workInProgress = current; return; @@ -8960,7 +8966,7 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -10074,14 +10080,14 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1141 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function (mockNode) { mockNode = nodeToInstanceMap.get(mockNode); return void 0 !== mockNode ? mockNode.internalInstanceHandle : null; }, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913", + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$138 = 0; @@ -10232,4 +10238,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; +exports.version = "19.0.0-native-fb-3d95c43b-20240913"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js index 2c2971f6b8..582c49faa6 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<598e1a1554be705744125c5f6e86546f>> + * @generated SignedSource<<151f049853714f91fd46ef5a8978deb0>> */ "use strict"; @@ -1705,7 +1705,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; + exports.version = "19.0.0-native-fb-3d95c43b-20240913"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js index dd05bb0823..3e124cdc3a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<304b6c7b540179b069a45ff09f35dbe5>> */ "use strict"; @@ -580,4 +580,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; +exports.version = "19.0.0-native-fb-3d95c43b-20240913"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js index cd6d07b57d..3aa947b476 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<92d8fbd56fb11e8c6a3aad4c04d6df3c>> + * @generated SignedSource<<09bffda39d917b825e992af0d48176ef>> */ "use strict"; @@ -584,7 +584,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-d3d4d3a4-20240913"; +exports.version = "19.0.0-native-fb-3d95c43b-20240913"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index c992fb345e..5db82e3735 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -d3d4d3a46b014ab0f6edc443c19fcdba09105f20 +3d95c43b8967d4dda1ec9a22f0d9ea4999fee8b8 diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index b90b1740b1..82c1434288 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -5918,11 +5918,18 @@ __DEV__ && profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -12297,7 +12304,7 @@ __DEV__ && else switch ( (JSCompiler_temp.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0), + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -12606,7 +12613,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -12665,7 +12672,7 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } function throwAndUnwindWorkLoop( @@ -12760,7 +12767,9 @@ __DEV__ && completedWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration( + completedWork + )); if (null !== current) { workInProgress = current; return; @@ -12784,7 +12793,7 @@ __DEV__ && return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -17173,11 +17182,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 9157f8df57..e0646589f2 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<322e750c3add37d8f3b0459e45ce2320>> + * @generated SignedSource<<29f9932a8cd462c8e4d6e6a1bab1ffe7>> */ "use strict"; @@ -11077,11 +11077,11 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1164 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1164.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index cc857cbbf8..2478b4a301 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<2e8b99493c3aa005334ae8baef13ae78>> + * @generated SignedSource<<22b0fd36180890c63b8c7db1f327dc65>> */ "use strict"; @@ -4983,11 +4983,18 @@ function startProfilerTimer(fiber) { profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { +function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } +} +function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -10203,7 +10210,7 @@ function handleThrow(root, thrownValue) { else switch ( (JSCompiler_temp.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0), + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -10456,7 +10463,7 @@ function performUnitOfWork(unitOfWork) { 0 !== (unitOfWork.mode & 2) ? (startProfilerTimer(unitOfWork), (current = beginWork(current, unitOfWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = beginWork(current, unitOfWork, entangledRenderLanes)); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current @@ -10504,7 +10511,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { resetWorkInProgress(next, entangledRenderLanes)), (current = beginWork(current, next, entangledRenderLanes)); } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDelta(next, !0); + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); next = current; unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); @@ -10588,7 +10595,7 @@ function completeUnitOfWork(unitOfWork) { ? (current = completeWork(current, completedWork, entangledRenderLanes)) : (startProfilerTimer(completedWork), (current = completeWork(current, completedWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork)); if (null !== current) { workInProgress = current; return; @@ -10611,7 +10618,7 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -11766,11 +11773,11 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1249 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1249.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index cef5c3d429..c473a18f2a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<8eef9cb3f1219e888f66f19585d81895>> */ "use strict"; @@ -6142,11 +6142,18 @@ __DEV__ && profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -12665,7 +12672,7 @@ __DEV__ && else switch ( (JSCompiler_temp.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0), + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -12974,7 +12981,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -13033,7 +13040,7 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } function throwAndUnwindWorkLoop( @@ -13128,7 +13135,9 @@ __DEV__ && completedWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration( + completedWork + )); if (null !== current) { workInProgress = current; return; @@ -13152,7 +13161,7 @@ __DEV__ && return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -17399,11 +17408,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isomorphicReactPackageVersion = React.version; - if ("19.0.0-native-fb-d3d4d3a4-20240913" !== isomorphicReactPackageVersion) + if ("19.0.0-native-fb-3d95c43b-20240913" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-d3d4d3a4-20240913\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-3d95c43b-20240913\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -17429,11 +17438,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromTag, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 863c78037b..c7270f7468 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -11205,11 +11205,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-d3d4d3a4-20240913" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-3d95c43b-20240913" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-d3d4d3a4-20240913\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-3d95c43b-20240913\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11258,11 +11258,11 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1230 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromTag, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1230.rendererConfig = extraDevToolsConfig); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 1478748038..7fb488c65b 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -5272,11 +5272,18 @@ function startProfilerTimer(fiber) { profilerStartTime = now(); 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { +function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } +} +function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { if (0 <= profilerStartTime) { var elapsedTime = now() - profilerStartTime; fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); profilerStartTime = -1; } } @@ -10634,7 +10641,7 @@ function handleThrow(root, thrownValue) { else switch ( (JSCompiler_temp.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0), + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), markComponentRenderStopped(), workInProgressSuspendedReason) ) { @@ -10887,7 +10894,7 @@ function performUnitOfWork(unitOfWork) { 0 !== (unitOfWork.mode & 2) ? (startProfilerTimer(unitOfWork), (current = beginWork(current, unitOfWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = beginWork(current, unitOfWork, entangledRenderLanes)); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current @@ -10935,7 +10942,7 @@ function replaySuspendedUnitOfWork(unitOfWork) { resetWorkInProgress(next, entangledRenderLanes)), (current = beginWork(current, next, entangledRenderLanes)); } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDelta(next, !0); + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); next = current; unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); @@ -11019,7 +11026,7 @@ function completeUnitOfWork(unitOfWork) { ? (current = completeWork(current, completedWork, entangledRenderLanes)) : (startProfilerTimer(completedWork), (current = completeWork(current, completedWork, entangledRenderLanes)), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork)); if (null !== current) { workInProgress = current; return; @@ -11042,7 +11049,7 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { return; } if (0 !== (unitOfWork.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); next = unitOfWork.actualDuration; for (var child = unitOfWork.child; null !== child; ) (next += child.actualDuration), (child = child.sibling); @@ -11895,11 +11902,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-d3d4d3a4-20240913" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-3d95c43b-20240913" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-d3d4d3a4-20240913\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-3d95c43b-20240913\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11948,11 +11955,11 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1315 = { bundleType: 0, - version: "19.0.0-native-fb-d3d4d3a4-20240913", + version: "19.0.0-native-fb-3d95c43b-20240913", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromTag, - reconcilerVersion: "19.0.0-native-fb-d3d4d3a4-20240913" + reconcilerVersion: "19.0.0-native-fb-3d95c43b-20240913" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1315.rendererConfig = extraDevToolsConfig);