Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index e07a7e6ba894a24c5b24b384888aec1cc06d09af..209a2badc6a6a171c81df3db8449983e6bed3c1c 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -1202,7 +1202,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; |
@@ -1635,12 +1635,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; |
@@ -1919,9 +1921,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: { |
@@ -1994,9 +1997,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()); |
@@ -2010,7 +2013,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()); |
@@ -3076,12 +3079,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); |
@@ -3093,13 +3097,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()); |