Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index 6778fbd2990e6caf16778c0692dfd5a65e0ba4a5..3bac8d5627b2839ee819dcf96c8eec3f54fefd19 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -1257,7 +1257,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; |
@@ -1696,12 +1696,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(r3); |
break; |
+ } |
case NAMED_PROPERTY: |
EmitNamedPropertyAssignment(expr); |
break; |
@@ -2029,9 +2031,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: { |
@@ -2106,9 +2109,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. |
__ LoadGlobalObject(StoreDescriptor::ReceiverRegister()); |
@@ -2119,7 +2122,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
MemOperand location = VarOperand(var, r4); |
// Perform an initialization check for lexically declared variables. |
- if (var->binding_needs_init()) { |
+ if (hole_check_mode == HoleCheckMode::kRequired) { |
Label assign; |
__ LoadP(r6, location); |
__ CompareRoot(r6, Heap::kTheHoleValueRootIndex); |
@@ -3187,12 +3190,13 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Store the value returned in r3. |
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(r3); |
@@ -3203,13 +3207,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(r3); |
} |
break; |
+ } |
case NAMED_PROPERTY: { |
PopOperand(StoreDescriptor::ReceiverRegister()); |
CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value()); |