Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index d455140af9dc5342d44c8a523fa066a8e2d53087..b705c3be5eeb98593108fff89b391f7127e6beac 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -12162,9 +12162,7 @@ void HOptimizedGraphBuilder::VisitDeclarations( |
void HOptimizedGraphBuilder::VisitVariableDeclaration( |
VariableDeclaration* declaration) { |
VariableProxy* proxy = declaration->proxy(); |
- VariableMode mode = declaration->mode(); |
Variable* variable = proxy->var(); |
- bool hole_init = mode == LET || mode == CONST; |
switch (variable->location()) { |
case VariableLocation::GLOBAL: |
case VariableLocation::UNALLOCATED: { |
@@ -12177,13 +12175,13 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration( |
} |
case VariableLocation::PARAMETER: |
case VariableLocation::LOCAL: |
- if (hole_init) { |
+ if (variable->binding_needs_init()) { |
HValue* value = graph()->GetConstantHole(); |
environment()->Bind(variable, value); |
} |
break; |
case VariableLocation::CONTEXT: |
- if (hole_init) { |
+ if (variable->binding_needs_init()) { |
HValue* value = graph()->GetConstantHole(); |
HValue* context = environment()->context(); |
HStoreContextSlot* store = Add<HStoreContextSlot>( |