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

Unified Diff: src/interpreter/bytecode-generator.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/full-codegen/x87/full-codegen-x87.cc ('k') | test/cctest/asmjs/test-asm-typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index a267a7553d8a872021632465a05c8a54b84d7f79..d5305fa84f9cfde746c437c3c0c86e96b7097163 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2761,9 +2761,7 @@ void BytecodeGenerator::VisitDelete(UnaryOperation* expr) {
// not allowed in strict mode. Deleting 'this' is allowed in both modes.
VariableProxy* proxy = expr->expression()->AsVariableProxy();
Variable* variable = proxy->var();
- DCHECK(
- is_sloppy(language_mode()) ||
- variable->HasThisName(isolate(), HandleDereferenceMode::kDisallowed));
+ DCHECK(is_sloppy(language_mode()) || variable->is_this());
switch (variable->location()) {
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED: {
@@ -2785,8 +2783,7 @@ void BytecodeGenerator::VisitDelete(UnaryOperation* expr) {
case VariableLocation::CONTEXT: {
// Deleting local var/let/const, context variables, and arguments
// does not have any effect.
- if (variable->HasThisName(isolate(),
- HandleDereferenceMode::kDisallowed)) {
+ if (variable->is_this()) {
builder()->LoadTrue();
} else {
builder()->LoadFalse();
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | test/cctest/asmjs/test-asm-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698