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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1895973002: Remove all non-function-name uses of CONST_LEGACY (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove now-unused bits in TF and CS Created 4 years, 8 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/contexts.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('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 6bc9ff4a19b0a5193685061fc2ffcca42dc1be00..8a637d8cd005f944e1476172d2005c4d18af935d 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -5916,9 +5916,6 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
case CONST:
mode = HLoadContextSlot::kCheckDeoptimize;
break;
- case CONST_LEGACY:
- mode = HLoadContextSlot::kCheckReturnUndefined;
- break;
default:
mode = HLoadContextSlot::kNoCheck;
break;
@@ -7244,13 +7241,17 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
return Bailout(kNonInitializerAssignmentToConst);
}
} else if (var->mode() == CONST_LEGACY) {
- if (expr->op() != Token::INIT && is_strict(function_language_mode())) {
- return Bailout(kNonInitializerAssignmentToConst);
- } else if (expr->op() != Token::INIT) {
- CHECK_ALIVE(VisitForValue(expr->value()));
- return ast_context()->ReturnValue(Pop());
+ if (expr->op() != Token::INIT) {
+ if (is_strict(function_language_mode())) {
+ return Bailout(kNonInitializerAssignmentToConst);
+ } else {
+ CHECK_ALIVE(VisitForValue(expr->value()));
+ return ast_context()->ReturnValue(Pop());
+ }
}
+ // TODO(adamk): Is this required? Legacy const variables are always
+ // initialized before use.
if (var->IsStackAllocated()) {
// We insert a use of the old value to detect unsupported uses of const
// variables (e.g. initialization inside a loop).
@@ -7322,11 +7323,7 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
}
} else {
DCHECK_EQ(Token::INIT, expr->op());
- if (var->mode() == CONST_LEGACY) {
- mode = HStoreContextSlot::kCheckIgnoreAssignment;
- } else {
- mode = HStoreContextSlot::kNoCheck;
- }
+ mode = HStoreContextSlot::kNoCheck;
}
HValue* context = BuildContextChainWalk(var);
@@ -12288,7 +12285,7 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration(
VariableProxy* proxy = declaration->proxy();
VariableMode mode = declaration->mode();
Variable* variable = proxy->var();
- bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY;
+ bool hole_init = mode == LET || mode == CONST;
switch (variable->location()) {
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED:
« no previous file with comments | « src/contexts.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698