Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index 0a9716f8fc5d3ca85a1399dfff263a20a84c4139..a6ff338ad302ebf8d25ee0673dce0aa5ca11eedb 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -1210,7 +1210,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" |
: "[ Stack variable"); |
- if (proxy->needs_hole_check()) { |
+ if (proxy->hole_check_mode() == HoleCheckMode::kRequired) { |
// Throw a reference error when using an uninitialized let/const |
// binding in harmony mode. |
Label done; |
@@ -1643,12 +1643,14 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
// Store the value. |
switch (assign_type) { |
- case VARIABLE: |
- EmitVariableAssignment(expr->target()->AsVariableProxy()->var(), |
- expr->op(), expr->AssignmentSlot()); |
+ case VARIABLE: { |
+ VariableProxy* proxy = expr->target()->AsVariableProxy(); |
+ EmitVariableAssignment(proxy->var(), expr->op(), expr->AssignmentSlot(), |
+ proxy->hole_check_mode()); |
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
context()->Plug(eax); |
break; |
+ } |
case NAMED_PROPERTY: |
EmitNamedPropertyAssignment(expr); |
break; |
@@ -1927,9 +1929,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, |
switch (assign_type) { |
case VARIABLE: { |
- Variable* var = expr->AsVariableProxy()->var(); |
+ VariableProxy* proxy = expr->AsVariableProxy(); |
EffectContext context(this); |
- EmitVariableAssignment(var, Token::ASSIGN, slot); |
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, slot, |
+ proxy->hole_check_mode()); |
break; |
} |
case NAMED_PROPERTY: { |
@@ -2002,9 +2005,9 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
} |
} |
- |
void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
- FeedbackVectorSlot slot) { |
+ FeedbackVectorSlot slot, |
+ HoleCheckMode hole_check_mode) { |
if (var->IsUnallocated()) { |
// Global var, const, or let. |
__ mov(StoreDescriptor::ReceiverRegister(), NativeContextOperand()); |
@@ -2018,7 +2021,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
MemOperand location = VarOperand(var, ecx); |
// Perform an initialization check for lexically declared variables. |
- if (var->binding_needs_init()) { |
+ if (hole_check_mode == HoleCheckMode::kRequired) { |
Label assign; |
__ mov(edx, location); |
__ cmp(edx, isolate()->factory()->the_hole_value()); |
@@ -3084,12 +3087,13 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Store the value returned in eax. |
switch (assign_type) { |
- case VARIABLE: |
+ case VARIABLE: { |
+ VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
if (expr->is_postfix()) { |
// Perform the assignment as if via '='. |
{ EffectContext context(this); |
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
- Token::ASSIGN, expr->CountSlot()); |
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, expr->CountSlot(), |
+ proxy->hole_check_mode()); |
PrepareForBailoutForId(expr->AssignmentId(), |
BailoutState::TOS_REGISTER); |
context.Plug(eax); |
@@ -3101,13 +3105,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
} |
} else { |
// Perform the assignment as if via '='. |
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
- Token::ASSIGN, expr->CountSlot()); |
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, expr->CountSlot(), |
+ proxy->hole_check_mode()); |
PrepareForBailoutForId(expr->AssignmentId(), |
BailoutState::TOS_REGISTER); |
context()->Plug(eax); |
} |
break; |
+ } |
case NAMED_PROPERTY: { |
PopOperand(StoreDescriptor::ReceiverRegister()); |
CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); |