Commit 94e4aca
authored
[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.1 parent 206df66 commit 94e4aca
File tree
2 files changed
+17
-24
lines changed- packages/react-reconciler/src
2 files changed
+17
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
202 | 195 | | |
203 | 196 | | |
204 | 197 | | |
| |||
286 | 279 | | |
287 | 280 | | |
288 | 281 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
293 | 286 | | |
294 | 287 | | |
295 | 288 | | |
| |||
382 | 375 | | |
383 | 376 | | |
384 | 377 | | |
385 | | - | |
386 | | - | |
| 378 | + | |
| 379 | + | |
387 | 380 | | |
388 | 381 | | |
389 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2430 | 2430 | | |
2431 | 2431 | | |
2432 | 2432 | | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2437 | 2437 | | |
2438 | 2438 | | |
2439 | 2439 | | |
| |||
2560 | 2560 | | |
2561 | 2561 | | |
2562 | 2562 | | |
2563 | | - | |
2564 | | - | |
| 2563 | + | |
| 2564 | + | |
2565 | 2565 | | |
2566 | 2566 | | |
2567 | 2567 | | |
| |||
0 commit comments