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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1431873006: Use a single Token::INIT for all variable initialization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm, simplify fvar code Created 5 years, 1 month 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 89689b21e01edbc9e26fa5f7785b52f7f84845dd..7c29c8de33bd91d475b6a0f1a8b7f03dcad451c6 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -7074,11 +7074,11 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
Variable* var = proxy->var();
if (var->mode() == CONST) {
- if (expr->op() != Token::INIT_CONST) {
+ if (expr->op() != Token::INIT) {
return Bailout(kNonInitializerAssignmentToConst);
}
} else if (var->mode() == CONST_LEGACY) {
- if (expr->op() != Token::INIT_CONST_LEGACY) {
+ if (expr->op() != Token::INIT) {
CHECK_ALIVE(VisitForValue(expr->value()));
return ast_context()->ReturnValue(Pop());
}
@@ -7152,14 +7152,13 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
default:
mode = HStoreContextSlot::kNoCheck;
}
- } else if (expr->op() == Token::INIT_VAR ||
- expr->op() == Token::INIT_LET ||
- expr->op() == Token::INIT_CONST) {
- mode = HStoreContextSlot::kNoCheck;
} else {
- DCHECK(expr->op() == Token::INIT_CONST_LEGACY);
-
- mode = HStoreContextSlot::kCheckIgnoreAssignment;
+ DCHECK_EQ(Token::INIT, expr->op());
+ if (var->mode() == CONST_LEGACY) {
+ mode = HStoreContextSlot::kCheckIgnoreAssignment;
+ } else {
+ mode = HStoreContextSlot::kNoCheck;
+ }
}
HValue* context = BuildContextChainWalk(var);
« 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