Index: src/ppc/full-codegen-ppc.cc |
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc |
index 455cc1e3fc7f6ac64e5543452f1b170d3368315d..9aa58a0bfe99d863158051d22af0b61487a7549a 100644 |
--- a/src/ppc/full-codegen-ppc.cc |
+++ b/src/ppc/full-codegen-ppc.cc |
@@ -1980,7 +1980,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
- DCHECK(expr->target()->IsValidReferenceExpression()); |
+ DCHECK(expr->target()->IsValidReferenceExpressionOrThis()); |
Comment cmnt(masm_, "[ Assignment"); |
SetExpressionPosition(expr, INSERT_BREAK); |
@@ -2697,7 +2697,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
void FullCodeGenerator::EmitAssignment(Expression* expr, |
FeedbackVectorICSlot slot) { |
- DCHECK(expr->IsValidReferenceExpression()); |
+ DCHECK(expr->IsValidReferenceExpressionOrThis()); |
Property* prop = expr->AsProperty(); |
LhsKind assign_type = Property::GetAssignType(prop); |
@@ -2845,6 +2845,20 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ bind(&const_error); |
__ CallRuntime(Runtime::kThrowConstAssignError, 0); |
+ } else if (var->is_this() && op == Token::INIT_CONST) { |
+ // Initializing assignment to const {this} needs a write barrier. |
+ DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
+ Label uninitialized_this; |
+ MemOperand location = VarOperand(var, r4); |
+ __ LoadP(r6, location); |
+ __ CompareRoot(r6, Heap::kTheHoleValueRootIndex); |
+ __ beq(&uninitialized_this); |
+ __ mov(r4, Operand(var->name())); |
+ __ push(r4); |
+ __ CallRuntime(Runtime::kThrowReferenceError, 1); |
+ __ bind(&uninitialized_this); |
+ EmitStoreToStackLocalOrContextSlot(var, location); |
+ |
} else if (!var->is_const_mode() || op == Token::INIT_CONST) { |
if (var->IsLookupSlot()) { |
// Assignment to var. |
@@ -3187,22 +3201,6 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
} |
-void FullCodeGenerator::EmitInitializeThisAfterSuper( |
- SuperCallReference* super_ref, FeedbackVectorICSlot slot) { |
- Variable* this_var = super_ref->this_var()->var(); |
- GetVar(r4, this_var); |
- __ CompareRoot(r4, Heap::kTheHoleValueRootIndex); |
- Label uninitialized_this; |
- __ beq(&uninitialized_this); |
- __ mov(r4, Operand(this_var->name())); |
- __ push(r4); |
- __ CallRuntime(Runtime::kThrowReferenceError, 1); |
- __ bind(&uninitialized_this); |
- |
- EmitVariableAssignment(this_var, Token::INIT_CONST, slot); |
-} |
- |
- |
// See http://www.ecma-international.org/ecma-262/6.0/#sec-function-calls. |
void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) { |
VariableProxy* callee = expr->expression()->AsVariableProxy(); |
@@ -3425,7 +3423,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
RecordJSReturnSite(expr); |
- EmitInitializeThisAfterSuper(super_call_ref, expr->CallFeedbackICSlot()); |
context()->Plug(r3); |
} |
@@ -4783,9 +4780,6 @@ void FullCodeGenerator::EmitCallSuperWithSpread(CallRuntime* expr) { |
// Restore context register. |
__ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
context()->DropAndPlug(1, r3); |
- |
- // TODO(mvstanton): with FLAG_vector_stores this needs a slot id. |
- EmitInitializeThisAfterSuper(super_call_ref); |
} |
@@ -4979,7 +4973,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
- DCHECK(expr->expression()->IsValidReferenceExpression()); |
+ DCHECK(expr->expression()->IsValidReferenceExpressionOrThis()); |
Comment cmnt(masm_, "[ CountOperation"); |