mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
7c38b1507805ad6db61702d52e5bdcd2d4859760
Aligns the data model for `Instruction` closer to JS: * Adds an `lvalue: IdentifierOperand` property (Identifier + Effect) * Changes rvalues from being a reference to the definining instruction by instruction offset (InstrIx) to be a variable reference (IdentifierOperand) There are pros and cons to the previous offset-based approach. It's definitely convenient to be able to jump directly to the instruction that defined an operand value. However: * Many passes need to track things like basic reassignments, which mean they need to build up mappings of IdentifierId to some data. When all operands are IdentifierOperands, this can be a single mapping. * It aligns closer to JS, which makes porting a bit easier. But most of all: porting the `ReactiveFunction` data type — which is in tree form - is non-trivial with the offset-based approach. As we map HIR to the tree form, we'd have to remap every operand offset. Using identifiers for operands simplifies this. We can always revisit this design choice later.
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%