| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 820d28ea6886e458894ea414943532ddf4578e00..d212eccd50b2d595ac81a1926e5444b72f301f06 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -1927,7 +1927,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|
|
|
|
| void FullCodeGenerator::VisitAssignment(Assignment* expr) {
|
| - DCHECK(expr->target()->IsValidReferenceExpression());
|
| + DCHECK(expr->target()->IsVariableProxyOrProperty());
|
|
|
| Comment cmnt(masm_, "[ Assignment");
|
| SetExpressionPosition(expr, INSERT_BREAK);
|
| @@ -2584,7 +2584,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
|
|
|
| void FullCodeGenerator::EmitAssignment(Expression* expr,
|
| FeedbackVectorICSlot slot) {
|
| - DCHECK(expr->IsValidReferenceExpression());
|
| + DCHECK(expr->IsVariableProxyOrProperty());
|
|
|
| Property* prop = expr->AsProperty();
|
| LhsKind assign_type = Property::GetAssignType(prop);
|
| @@ -2726,6 +2726,19 @@ 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, ecx);
|
| + __ mov(edx, location);
|
| + __ cmp(edx, isolate()->factory()->the_hole_value());
|
| + __ j(equal, &uninitialized_this);
|
| + __ push(Immediate(var->name()));
|
| + __ 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.
|
| @@ -3068,22 +3081,6 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitInitializeThisAfterSuper(
|
| - SuperCallReference* super_call_ref, FeedbackVectorICSlot slot) {
|
| - Variable* this_var = super_call_ref->this_var()->var();
|
| - GetVar(ecx, this_var);
|
| - __ cmp(ecx, isolate()->factory()->the_hole_value());
|
| -
|
| - Label uninitialized_this;
|
| - __ j(equal, &uninitialized_this);
|
| - __ push(Immediate(this_var->name()));
|
| - __ 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();
|
| @@ -3299,7 +3296,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
|
|
| RecordJSReturnSite(expr);
|
|
|
| - EmitInitializeThisAfterSuper(super_call_ref, expr->CallFeedbackICSlot());
|
| context()->Plug(eax);
|
| }
|
|
|
| @@ -4675,9 +4671,6 @@ void FullCodeGenerator::EmitCallSuperWithSpread(CallRuntime* expr) {
|
| // Restore context register.
|
| __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
| context()->DropAndPlug(1, eax);
|
| -
|
| - // TODO(mvstanton): with FLAG_vector_stores this needs a slot id.
|
| - EmitInitializeThisAfterSuper(super_call_ref);
|
| }
|
|
|
|
|
| @@ -4876,7 +4869,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
|
|
|
|
| void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| - DCHECK(expr->expression()->IsValidReferenceExpression());
|
| + DCHECK(expr->expression()->IsVariableProxyOrProperty());
|
|
|
| Comment cmnt(masm_, "[ CountOperation");
|
|
|
|
|