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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 2231813003: Make Variable::is_this always return the correct value (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/ast/variables.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index d72313e23baf3460a3dae9599d2a71195a74fd74..e5ff0cce27fcba3a13dcdb74efde8d27eed11f1d 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -2936,12 +2936,10 @@ void AstGraphBuilder::VisitIterationBody(IterationStatement* stmt,
void AstGraphBuilder::VisitDelete(UnaryOperation* expr) {
Node* value;
if (expr->expression()->IsVariableProxy()) {
- // Delete of an unqualified identifier is only allowed in classic mode but
- // deleting "this" is allowed in all language modes.
- Variable* variable = expr->expression()->AsVariableProxy()->var();
// Delete of an unqualified identifier is disallowed in strict mode but
// "delete this" is allowed.
- DCHECK(is_sloppy(language_mode()) || variable->HasThisName(isolate()));
+ Variable* variable = expr->expression()->AsVariableProxy()->var();
+ DCHECK(is_sloppy(language_mode()) || variable->is_this());
value = BuildVariableDelete(variable, expr->id(),
ast_context()->GetStateCombine());
} else if (expr->expression()->IsProperty()) {
@@ -3403,7 +3401,7 @@ Node* AstGraphBuilder::BuildVariableDelete(Variable* variable,
case VariableLocation::LOCAL:
case VariableLocation::CONTEXT: {
// Local var, const, or let variable or context variable.
- return jsgraph()->BooleanConstant(variable->HasThisName(isolate()));
+ return jsgraph()->BooleanConstant(variable->is_this());
}
case VariableLocation::LOOKUP: {
// Dynamic lookup of context variable (anywhere in the chain).
« no previous file with comments | « src/ast/variables.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698