mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[patch] Gate EliminatePhi fix behind feature flag
This commit is contained in:
1 parent
adfae63f20
commit
ff2f2e0685
1 file changed
+10
-9
+10
-9
@@ -106,19 +106,20 @@ export function eliminateRedundantPhi(
|
||||
for (const place of eachInstructionOperand(instr)) {
|
||||
rewritePlace(place, rewrites);
|
||||
}
|
||||
if (instr.value.kind === "FunctionExpression") {
|
||||
|
||||
if (
|
||||
instr.value.kind === "FunctionExpression" &&
|
||||
fn.env.enableOptimizeFunctionExpressions
|
||||
) {
|
||||
const { context } = instr.value.loweredFunc;
|
||||
for (const place of context) {
|
||||
rewritePlace(place, rewrites);
|
||||
}
|
||||
}
|
||||
// visit function expressions on first iteration of each block
|
||||
if (
|
||||
isFirstIteration &&
|
||||
instr.value.kind === "FunctionExpression" &&
|
||||
fn.env.enableOptimizeFunctionExpressions
|
||||
) {
|
||||
eliminateRedundantPhi(instr.value.loweredFunc, rewrites);
|
||||
|
||||
// visit function expressions on first iteration of each block
|
||||
if (isFirstIteration) {
|
||||
eliminateRedundantPhi(instr.value.loweredFunc, rewrites);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user