| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index 61c433821aae88837d34064bb3782e30f95b8d81..77ad611b70c8d49da7804dfdf381bb15f09ec086 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -3893,10 +3893,15 @@ Node* AstGraphBuilder::TryLoadDynamicVariable(
|
| fast_block.BreakUnless(check, BranchHint::kTrue);
|
| }
|
|
|
| - // Fast case, because variable is not shadowed. Perform global slot load.
|
| - Node* fast = BuildGlobalLoad(name, feedback, typeof_mode);
|
| - states.AddToNode(fast, bailout_id, combine);
|
| - environment()->Push(fast);
|
| + // Fast case, because variable is not shadowed.
|
| + if (Node* constant = TryLoadGlobalConstant(name)) {
|
| + environment()->Push(constant);
|
| + } else {
|
| + // Perform global slot load.
|
| + Node* fast = BuildGlobalLoad(name, feedback, typeof_mode);
|
| + states.AddToNode(fast, bailout_id, combine);
|
| + environment()->Push(fast);
|
| + }
|
| slow_block.Break();
|
| environment()->Pop();
|
| fast_block.EndBlock();
|
|
|