| Index: src/ia32/fast-codegen-ia32.cc
|
| ===================================================================
|
| --- src/ia32/fast-codegen-ia32.cc (revision 3073)
|
| +++ src/ia32/fast-codegen-ia32.cc (working copy)
|
| @@ -95,7 +95,6 @@
|
| void FastCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
|
| Comment cmnt(masm_, "[ ExpressionStatement");
|
| Visit(stmt->expression());
|
| - __ pop(eax);
|
| }
|
|
|
|
|
| @@ -114,13 +113,21 @@
|
|
|
| void FastCodeGenerator::VisitSlot(Slot* expr) {
|
| Comment cmnt(masm_, "[ Slot");
|
| - __ push(Operand(ebp, SlotOffset(expr)));
|
| + if (expr->location().is_temporary()) {
|
| + __ push(Operand(ebp, SlotOffset(expr)));
|
| + } else {
|
| + ASSERT(expr->location().is_nowhere());
|
| + }
|
| }
|
|
|
|
|
| void FastCodeGenerator::VisitLiteral(Literal* expr) {
|
| Comment cmnt(masm_, "[ Literal");
|
| - __ push(Immediate(expr->handle()));
|
| + if (expr->location().is_temporary()) {
|
| + __ push(Immediate(expr->handle()));
|
| + } else {
|
| + ASSERT(expr->location().is_nowhere());
|
| + }
|
| }
|
|
|
|
|
| @@ -132,8 +139,14 @@
|
|
|
| Variable* var = expr->target()->AsVariableProxy()->AsVariable();
|
| ASSERT(var != NULL && var->slot() != NULL);
|
| - __ mov(eax, Operand(esp, 0));
|
| - __ mov(Operand(ebp, SlotOffset(var->slot())), eax);
|
| +
|
| + if (expr->location().is_temporary()) {
|
| + __ mov(eax, Operand(esp, 0));
|
| + __ mov(Operand(ebp, SlotOffset(var->slot())), eax);
|
| + } else {
|
| + ASSERT(expr->location().is_nowhere());
|
| + __ pop(Operand(ebp, SlotOffset(var->slot())));
|
| + }
|
| }
|
|
|
|
|
|
|