Index: src/full-codegen/mips/full-codegen-mips.cc |
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc |
index f45719eddd707092cfc225c1acc1cd636abe11cc..290c27401899fc1c49cf8bbaf41ae59abba9a363 100644 |
--- a/src/full-codegen/mips/full-codegen-mips.cc |
+++ b/src/full-codegen/mips/full-codegen-mips.cc |
@@ -1287,7 +1287,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
DCHECK_EQ(NOT_INSIDE_TYPEOF, typeof_mode); |
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; |
@@ -1731,12 +1731,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(v0); |
break; |
+ } |
case NAMED_PROPERTY: |
EmitNamedPropertyAssignment(expr); |
break; |
@@ -2025,9 +2027,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: { |
@@ -2102,9 +2105,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::ValueRegister(), result_register()); |
@@ -2116,7 +2119,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
MemOperand location = VarOperand(var, a1); |
// Perform an initialization check for lexically declared variables. |
- if (var->binding_needs_init()) { |
+ if (hole_check_mode == HoleCheckMode::kRequired) { |
Label assign; |
__ lw(a3, location); |
__ LoadRoot(t0, Heap::kTheHoleValueRootIndex); |
@@ -3195,11 +3198,12 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Store the value returned in v0. |
switch (assign_type) { |
- case VARIABLE: |
+ case VARIABLE: { |
+ VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
if (expr->is_postfix()) { |
{ 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(v0); |
@@ -3210,13 +3214,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
context()->PlugTOS(); |
} |
} else { |
- 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(v0); |
} |
break; |
+ } |
case NAMED_PROPERTY: { |
__ mov(StoreDescriptor::ValueRegister(), result_register()); |
PopOperand(StoreDescriptor::ReceiverRegister()); |