Fix ARM and x64 compilation.

Fix compilation on ARM and x64 due to a change in the architecture-shared
API of the nonoptimizing code generator.  Also added new PrepareForBailout
to ARM (they are not yet fully implemented on x64).

Review URL: http://codereview.chromium.org/5794002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b1c71408
...@@ -890,7 +890,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -890,7 +890,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ bind(&update_each); __ bind(&update_each);
__ mov(result_register(), r3); __ mov(result_register(), r3);
// Perform the assignment as if via '='. // Perform the assignment as if via '='.
EmitAssignment(stmt->each()); { EffectContext context(this);
EmitAssignment(stmt->each(), stmt->AssignmentId());
}
// Generate code for the body of the loop. // Generate code for the body of the loop.
Visit(stmt->body()); Visit(stmt->body());
...@@ -1444,7 +1446,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { ...@@ -1444,7 +1446,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
// For property compound assignments we need another deoptimization // For property compound assignments we need another deoptimization
// point after the property load. // point after the property load.
if (property != NULL) { if (property != NULL) {
PrepareForBailoutForId(expr->compound_bailout_id(), TOS_REG); PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
} }
Token::Value op = expr->binary_op(); Token::Value op = expr->binary_op();
...@@ -1536,7 +1538,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, ...@@ -1536,7 +1538,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
} }
void FullCodeGenerator::EmitAssignment(Expression* expr) { void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
// Invalid left-hand sides are rewritten to have a 'throw // Invalid left-hand sides are rewritten to have a 'throw
// ReferenceError' on the left-hand side. // ReferenceError' on the left-hand side.
if (!expr->IsValidLeftHandSide()) { if (!expr->IsValidLeftHandSide()) {
...@@ -1584,6 +1586,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { ...@@ -1584,6 +1586,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
break; break;
} }
} }
PrepareForBailoutForId(bailout_ast_id, TOS_REG);
context()->Plug(r0);
} }
...@@ -1657,8 +1661,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, ...@@ -1657,8 +1661,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
} }
__ bind(&done); __ bind(&done);
} }
context()->Plug(result_register());
} }
...@@ -1701,10 +1703,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { ...@@ -1701,10 +1703,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
__ push(ip); __ push(ip);
__ CallRuntime(Runtime::kToFastProperties, 1); __ CallRuntime(Runtime::kToFastProperties, 1);
__ pop(r0); __ pop(r0);
context()->DropAndPlug(1, r0); __ Drop(1);
} else {
context()->Plug(r0);
} }
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
context()->Plug(r0);
} }
...@@ -1745,10 +1747,10 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { ...@@ -1745,10 +1747,10 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
__ push(ip); __ push(ip);
__ CallRuntime(Runtime::kToFastProperties, 1); __ CallRuntime(Runtime::kToFastProperties, 1);
__ pop(r0); __ pop(r0);
context()->DropAndPlug(1, r0); __ Drop(1);
} else {
context()->Plug(r0);
} }
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
context()->Plug(r0);
} }
...@@ -3200,6 +3202,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3200,6 +3202,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
{ EffectContext context(this); { EffectContext context(this);
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
Token::ASSIGN); Token::ASSIGN);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
context.Plug(r0);
} }
// For all contexts except EffectConstant We have the result on // For all contexts except EffectConstant We have the result on
// top of the stack. // top of the stack.
...@@ -3209,6 +3213,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3209,6 +3213,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
} else { } else {
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
Token::ASSIGN); Token::ASSIGN);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
context()->Plug(r0);
} }
break; break;
case NAMED_PROPERTY: { case NAMED_PROPERTY: {
...@@ -3216,6 +3222,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3216,6 +3222,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ pop(r1); __ pop(r1);
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET); EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
context()->PlugTOS(); context()->PlugTOS();
...@@ -3230,6 +3237,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3230,6 +3237,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ pop(r2); // Receiver. __ pop(r2); // Receiver.
Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET); EmitCallIC(ic, RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) { if (expr->is_postfix()) {
if (!context()->IsEffect()) { if (!context()->IsEffect()) {
context()->PlugTOS(); context()->PlugTOS();
......
...@@ -839,7 +839,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -839,7 +839,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ bind(&update_each); __ bind(&update_each);
__ movq(result_register(), rbx); __ movq(result_register(), rbx);
// Perform the assignment as if via '='. // Perform the assignment as if via '='.
EmitAssignment(stmt->each()); { EffectContext context(this);
EmitAssignment(stmt->each(), stmt->AssignmentId());
}
// Generate code for the body of the loop. // Generate code for the body of the loop.
Visit(stmt->body()); Visit(stmt->body());
...@@ -1521,7 +1523,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, ...@@ -1521,7 +1523,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
} }
void FullCodeGenerator::EmitAssignment(Expression* expr) { void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_id) {
// Invalid left-hand sides are rewritten to have a 'throw // Invalid left-hand sides are rewritten to have a 'throw
// ReferenceError' on the left-hand side. // ReferenceError' on the left-hand side.
if (!expr->IsValidLeftHandSide()) { if (!expr->IsValidLeftHandSide()) {
...@@ -1569,6 +1571,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { ...@@ -1569,6 +1571,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
break; break;
} }
} }
context()->Plug(rax);
} }
...@@ -1641,8 +1644,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, ...@@ -1641,8 +1644,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
} }
__ bind(&done); __ bind(&done);
} }
context()->Plug(rax);
} }
...@@ -1679,10 +1680,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { ...@@ -1679,10 +1680,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
__ push(Operand(rsp, kPointerSize)); // Receiver is under value. __ push(Operand(rsp, kPointerSize)); // Receiver is under value.
__ CallRuntime(Runtime::kToFastProperties, 1); __ CallRuntime(Runtime::kToFastProperties, 1);
__ pop(rax); __ pop(rax);
context()->DropAndPlug(1, rax); __ Drop(1);
} else {
context()->Plug(rax);
} }
context()->Plug(rax);
} }
...@@ -3127,6 +3127,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3127,6 +3127,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
{ EffectContext context(this); { EffectContext context(this);
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
Token::ASSIGN); Token::ASSIGN);
context.Plug(rax);
} }
// For all contexts except kEffect: We have the result on // For all contexts except kEffect: We have the result on
// top of the stack. // top of the stack.
...@@ -3137,6 +3138,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -3137,6 +3138,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Perform the assignment as if via '='. // Perform the assignment as if via '='.
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
Token::ASSIGN); Token::ASSIGN);
context()->Plug(rax);
} }
break; break;
case NAMED_PROPERTY: { case NAMED_PROPERTY: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment