mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
0d3f3884b871088c92a76822dd221d06bad40df6
Fixes for the previous PR. What was happening is that our inference was inferring the correct mutable ranges and reactive scopes, but the inlining process left the instructions from the IIFEs inside a separate block, with a 'label' terminal preceding it. When we converted to ReactiveFunction this was preserved as a ReactiveLabelTerminal, which meant that the first instruction for the mutable range could be nested inside one LabelTerminal, while more would be in a subsequent LabelTerminal. But we close blocks based on the block scope! This meant that we'd have leftover instructions (in the second LabelTerminal) that got left out of the block. Furthermore, because inlining was happening after EnterSSA we weren't creating phis correctly. This PR fixes a bunch of these issues, and a subsequent PR handles the remaining cases: * We move DropManualMemo and InlineIIFEs before EnterSSA. This means we lose the ability to use type information, but we ensure that we create proper SSA ids and phis for any reassignments within the IIFE * We also update PruneUnusedLabels to not just remove the unused labels, but to actually remove LabelTerminals that don't need them.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%