Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2201193004: Use Variable::binding_needs_init() to determine hole initialization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove one more comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>(
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698