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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2232313002: [interpreter] Simplify hole check condition for variable assignments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase on top of my other CL. 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 | « no previous file | no next file » | 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 3023e5d634b45d8d445fcce7d9006f447f0ecb47..a267a7553d8a872021632465a05c8a54b84d7f79 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1868,7 +1868,6 @@ void BytecodeGenerator::VisitVariableLoad(Variable* variable,
Register source(Register(variable->index()));
builder()->LoadAccumulatorWithRegister(source);
BuildHoleCheckForVariableLoad(variable);
- execution_result()->SetResultInAccumulator();
break;
}
case VariableLocation::PARAMETER: {
@@ -1877,13 +1876,11 @@ void BytecodeGenerator::VisitVariableLoad(Variable* variable,
Register source = builder()->Parameter(variable->index() + 1);
builder()->LoadAccumulatorWithRegister(source);
BuildHoleCheckForVariableLoad(variable);
- execution_result()->SetResultInAccumulator();
break;
}
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED: {
builder()->LoadGlobal(feedback_index(slot), typeof_mode);
- execution_result()->SetResultInAccumulator();
break;
}
case VariableLocation::CONTEXT: {
@@ -1911,17 +1908,16 @@ void BytecodeGenerator::VisitVariableLoad(Variable* variable,
builder()->LoadContextSlot(context_reg, variable->index());
BuildHoleCheckForVariableLoad(variable);
- execution_result()->SetResultInAccumulator();
break;
}
case VariableLocation::LOOKUP: {
builder()->LoadLookupSlot(variable->name(), typeof_mode);
- execution_result()->SetResultInAccumulator();
break;
}
case VariableLocation::MODULE:
UNREACHABLE();
}
+ execution_result()->SetResultInAccumulator();
}
void BytecodeGenerator::VisitVariableLoadForAccumulatorValue(
@@ -2035,8 +2031,7 @@ void BytecodeGenerator::VisitVariableAssignment(Variable* variable,
BytecodeLabel end_label;
bool hole_check_required =
variable->binding_needs_init() &&
- ((IsLexicalVariableMode(mode) && op != Token::INIT) ||
- (mode == CONST && op == Token::INIT && variable->is_this()));
+ (op != Token::INIT || (mode == CONST && variable->is_this()));
switch (variable->location()) {
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698