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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1845223006: [Interpreter] Handles legacy constants in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed nits. 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 | « no previous file | src/interpreter/bytecode-generator.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 c59c8e5337afe750648fd5c50154e505f3fc672c..f7d2f1ed8a61ccfb9520dfdc17683255868304f3 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -7021,7 +7021,11 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
case CONST:
return Bailout(kNonInitializerAssignmentToConst);
case CONST_LEGACY:
- return ast_context()->ReturnValue(Pop());
+ if (is_strict(function_language_mode())) {
+ return Bailout(kNonInitializerAssignmentToConst);
+ } else {
+ return ast_context()->ReturnValue(Pop());
+ }
default:
mode = HStoreContextSlot::kNoCheck;
}
@@ -7089,7 +7093,9 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
return Bailout(kNonInitializerAssignmentToConst);
}
} else if (var->mode() == CONST_LEGACY) {
- if (expr->op() != Token::INIT) {
+ 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());
}
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698