Skip to content

Commit 037b2e3

Browse files
committed
[Fiber] Set profiler values to doubles (#30942)
At some point this trick was added to initialize the value first to NaN and then replace them with zeros and negative ones. This is to address the issue noted in #14365 where these hidden classes can be initialized to SMIs at first and then deopt when we realize they're actually doubles. However, this fix has been long broken and has deopted the profiling build for years because closure compiler optimizes out the first write. I'm not sure because I haven't A/B-tested this in the JIT yet but I think we can use negative zero and -1.1 as the initial values instead since they're not simple integers. Negative zero `===` zero (but not Object.is) so is the same as far as our code is concerned. The negative value is just `< 0` comparisons. DiffTrain build for [94e4aca](94e4aca)
1 parent fadd1ee commit 037b2e3

34 files changed

+216
-216
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
473522093d3dd95582729d01cd5c0d15dcc9cd3b
1+
94e4acaa1477e65cac02ba86058cde0afe4c8f1f
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
473522093d3dd95582729d01cd5c0d15dcc9cd3b
1+
94e4acaa1477e65cac02ba86058cde0afe4c8f1f

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ __DEV__ &&
20012001
exports.useTransition = function () {
20022002
return resolveDispatcher().useTransition();
20032003
};
2004-
exports.version = "19.0.0-www-classic-47352209-20240912";
2004+
exports.version = "19.0.0-www-classic-94e4acaa-20240913";
20052005
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20062006
"function" ===
20072007
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ __DEV__ &&
19811981
exports.useTransition = function () {
19821982
return resolveDispatcher().useTransition();
19831983
};
1984-
exports.version = "19.0.0-www-modern-47352209-20240912";
1984+
exports.version = "19.0.0-www-modern-94e4acaa-20240913";
19851985
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19861986
"function" ===
19871987
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-classic-47352209-20240912";
668+
exports.version = "19.0.0-www-classic-94e4acaa-20240913";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-modern-47352209-20240912";
668+
exports.version = "19.0.0-www-modern-94e4acaa-20240913";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-47352209-20240912";
672+
exports.version = "19.0.0-www-classic-94e4acaa-20240913";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-47352209-20240912";
672+
exports.version = "19.0.0-www-modern-94e4acaa-20240913";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7385,8 +7385,8 @@ __DEV__ &&
73857385
(nextProps.childLanes = 0),
73867386
(nextProps.pendingProps = primaryChildProps),
73877387
workInProgress.mode & 2 &&
7388-
((nextProps.actualDuration = 0),
7389-
(nextProps.actualStartTime = -1),
7388+
((nextProps.actualDuration = -0),
7389+
(nextProps.actualStartTime = -1.1),
73907390
(nextProps.selfBaseDuration = didSuspend.selfBaseDuration),
73917391
(nextProps.treeBaseDuration = didSuspend.treeBaseDuration)),
73927392
(workInProgress.deletions = null));
@@ -7516,10 +7516,10 @@ __DEV__ &&
75167516
: ((progressedPrimaryFragment.childLanes = 0),
75177517
(progressedPrimaryFragment.pendingProps = primaryChildren),
75187518
workInProgress.mode & 2 &&
7519-
((progressedPrimaryFragment.actualDuration = 0),
7520-
(progressedPrimaryFragment.actualStartTime = -1),
7521-
(progressedPrimaryFragment.selfBaseDuration = 0),
7522-
(progressedPrimaryFragment.treeBaseDuration = 0)));
7519+
((progressedPrimaryFragment.actualDuration = -0),
7520+
(progressedPrimaryFragment.actualStartTime = -1.1),
7521+
(progressedPrimaryFragment.selfBaseDuration = -0),
7522+
(progressedPrimaryFragment.treeBaseDuration = -0)));
75237523
fallbackChildren = createFiberFromFragment(
75247524
fallbackChildren,
75257525
mode,
@@ -14250,9 +14250,9 @@ __DEV__ &&
1425014250
this.deletions = null;
1425114251
this.childLanes = this.lanes = 0;
1425214252
this.alternate = null;
14253-
this.actualDuration = 0;
14254-
this.actualStartTime = -1;
14255-
this.treeBaseDuration = this.selfBaseDuration = 0;
14253+
this.actualDuration = -0;
14254+
this.actualStartTime = -1.1;
14255+
this.treeBaseDuration = this.selfBaseDuration = -0;
1425614256
this._debugOwner = this._debugInfo = null;
1425714257
this._debugNeedsRemount = !1;
1425814258
this._debugHookTypes = null;
@@ -14288,10 +14288,10 @@ __DEV__ &&
1428814288
key: key,
1428914289
pendingProps: pendingProps,
1429014290
mode: mode,
14291-
actualDuration: 0,
14292-
actualStartTime: -1,
14293-
selfBaseDuration: 0,
14294-
treeBaseDuration: 0,
14291+
actualDuration: -0,
14292+
actualStartTime: -1.1,
14293+
selfBaseDuration: -0,
14294+
treeBaseDuration: -0,
1429514295
_debugInfo: null,
1429614296
_debugOwner: null,
1429714297
_debugNeedsRemount: !1,
@@ -14327,8 +14327,8 @@ __DEV__ &&
1432714327
(workInProgress.flags = 0),
1432814328
(workInProgress.subtreeFlags = 0),
1432914329
(workInProgress.deletions = null),
14330-
(workInProgress.actualDuration = 0),
14331-
(workInProgress.actualStartTime = -1));
14330+
(workInProgress.actualDuration = -0),
14331+
(workInProgress.actualStartTime = -1.1));
1433214332
workInProgress.flags = current.flags & 31457280;
1433314333
workInProgress.childLanes = current.childLanes;
1433414334
workInProgress.lanes = current.lanes;
@@ -17062,11 +17062,11 @@ __DEV__ &&
1706217062
(function () {
1706317063
var internals = {
1706417064
bundleType: 1,
17065-
version: "19.0.0-www-classic-47352209-20240912",
17065+
version: "19.0.0-www-classic-94e4acaa-20240913",
1706617066
rendererPackageName: "react-art",
1706717067
currentDispatcherRef: ReactSharedInternals,
1706817068
findFiberByHostInstance: getInstanceFromNode,
17069-
reconcilerVersion: "19.0.0-www-classic-47352209-20240912"
17069+
reconcilerVersion: "19.0.0-www-classic-94e4acaa-20240913"
1707017070
};
1707117071
internals.overrideHookState = overrideHookState;
1707217072
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17100,7 +17100,7 @@ __DEV__ &&
1710017100
exports.Shape = Shape;
1710117101
exports.Surface = Surface;
1710217102
exports.Text = Text;
17103-
exports.version = "19.0.0-www-classic-47352209-20240912";
17103+
exports.version = "19.0.0-www-classic-94e4acaa-20240913";
1710417104
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1710517105
"function" ===
1710617106
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13747,9 +13747,9 @@ __DEV__ &&
1374713747
this.deletions = null;
1374813748
this.childLanes = this.lanes = 0;
1374913749
this.alternate = null;
13750-
this.actualDuration = 0;
13751-
this.actualStartTime = -1;
13752-
this.treeBaseDuration = this.selfBaseDuration = 0;
13750+
this.actualDuration = -0;
13751+
this.actualStartTime = -1.1;
13752+
this.treeBaseDuration = this.selfBaseDuration = -0;
1375313753
this._debugOwner = this._debugInfo = null;
1375413754
this._debugNeedsRemount = !1;
1375513755
this._debugHookTypes = null;
@@ -13785,10 +13785,10 @@ __DEV__ &&
1378513785
key: key,
1378613786
pendingProps: pendingProps,
1378713787
mode: mode,
13788-
actualDuration: 0,
13789-
actualStartTime: -1,
13790-
selfBaseDuration: 0,
13791-
treeBaseDuration: 0,
13788+
actualDuration: -0,
13789+
actualStartTime: -1.1,
13790+
selfBaseDuration: -0,
13791+
treeBaseDuration: -0,
1379213792
_debugInfo: null,
1379313793
_debugOwner: null,
1379413794
_debugNeedsRemount: !1,
@@ -13824,8 +13824,8 @@ __DEV__ &&
1382413824
(workInProgress.flags = 0),
1382513825
(workInProgress.subtreeFlags = 0),
1382613826
(workInProgress.deletions = null),
13827-
(workInProgress.actualDuration = 0),
13828-
(workInProgress.actualStartTime = -1));
13827+
(workInProgress.actualDuration = -0),
13828+
(workInProgress.actualStartTime = -1.1));
1382913829
workInProgress.flags = current.flags & 31457280;
1383013830
workInProgress.childLanes = current.childLanes;
1383113831
workInProgress.lanes = current.lanes;
@@ -16508,11 +16508,11 @@ __DEV__ &&
1650816508
(function () {
1650916509
var internals = {
1651016510
bundleType: 1,
16511-
version: "19.0.0-www-modern-47352209-20240912",
16511+
version: "19.0.0-www-modern-94e4acaa-20240913",
1651216512
rendererPackageName: "react-art",
1651316513
currentDispatcherRef: ReactSharedInternals,
1651416514
findFiberByHostInstance: getInstanceFromNode,
16515-
reconcilerVersion: "19.0.0-www-modern-47352209-20240912"
16515+
reconcilerVersion: "19.0.0-www-modern-94e4acaa-20240913"
1651616516
};
1651716517
internals.overrideHookState = overrideHookState;
1651816518
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16546,7 +16546,7 @@ __DEV__ &&
1654616546
exports.Shape = Shape;
1654716547
exports.Surface = Surface;
1654816548
exports.Text = Text;
16549-
exports.version = "19.0.0-www-modern-47352209-20240912";
16549+
exports.version = "19.0.0-www-modern-94e4acaa-20240913";
1655016550
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1655116551
"function" ===
1655216552
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)