| Index: src/ia32/codegen-ia32.cc
|
| ===================================================================
|
| --- src/ia32/codegen-ia32.cc (revision 1913)
|
| +++ src/ia32/codegen-ia32.cc (working copy)
|
| @@ -83,8 +83,10 @@
|
| allocator_(NULL),
|
| state_(NULL),
|
| loop_nesting_(0),
|
| - function_return_is_shadowed_(false),
|
| - in_spilled_code_(false) {
|
| + function_return_is_shadowed_(false) {
|
| +#ifdef DEBUG
|
| + in_spilled_code_ = false;
|
| +#endif
|
| }
|
|
|
|
|
| @@ -108,7 +110,7 @@
|
| allocator_ = ®ister_allocator;
|
| ASSERT(frame_ == NULL);
|
| frame_ = new VirtualFrame(this);
|
| - set_in_spilled_code(false);
|
| + ASSERT(!in_spilled_code());
|
|
|
| // Adjust for function-level loop nesting.
|
| loop_nesting_ += fun->loop_nesting();
|
| @@ -446,16 +448,6 @@
|
| }
|
|
|
|
|
| -void CodeGenerator::LoadAndSpill(Expression* expression,
|
| - TypeofState typeof_state) {
|
| - ASSERT(in_spilled_code());
|
| - set_in_spilled_code(false);
|
| - Load(expression, typeof_state);
|
| - frame_->SpillAll();
|
| - set_in_spilled_code(true);
|
| -}
|
| -
|
| -
|
| void CodeGenerator::Load(Expression* x, TypeofState typeof_state) {
|
| #ifdef DEBUG
|
| int original_height = frame_->height();
|
| @@ -520,13 +512,10 @@
|
|
|
|
|
| void CodeGenerator::LoadGlobal() {
|
| - if (in_spilled_code()) {
|
| - frame_->EmitPush(GlobalObject());
|
| - } else {
|
| - Result temp = allocator_->Allocate();
|
| - __ mov(temp.reg(), GlobalObject());
|
| - frame_->Push(&temp);
|
| - }
|
| + ASSERT(!in_spilled_code());
|
| + Result temp = allocator_->Allocate();
|
| + __ mov(temp.reg(), GlobalObject());
|
| + frame_->Push(&temp);
|
| }
|
|
|
|
|
| @@ -572,11 +561,13 @@
|
|
|
|
|
| void CodeGenerator::LoadReference(Reference* ref) {
|
| +#ifdef DEBUG
|
| // References are loaded from both spilled and unspilled code. Set the
|
| // state to unspilled to allow that (and explicitly spill after
|
| - // construction at the construction sites).
|
| + // construction at the construction sites, if necessary).
|
| bool was_in_spilled_code = in_spilled_code_;
|
| in_spilled_code_ = false;
|
| +#endif
|
|
|
| Comment cmnt(masm_, "[ LoadReference");
|
| Expression* e = ref->expression();
|
| @@ -617,7 +608,9 @@
|
| frame_->CallRuntime(Runtime::kThrowReferenceError, 1);
|
| }
|
|
|
| +#ifdef DEBUG
|
| in_spilled_code_ = was_in_spilled_code;
|
| +#endif
|
| }
|
|
|
|
|
| @@ -1716,28 +1709,6 @@
|
| }
|
|
|
|
|
| -void CodeGenerator::VisitAndSpill(Statement* statement) {
|
| - ASSERT(in_spilled_code());
|
| - set_in_spilled_code(false);
|
| - Visit(statement);
|
| - if (frame_ != NULL) {
|
| - frame_->SpillAll();
|
| - }
|
| - set_in_spilled_code(true);
|
| -}
|
| -
|
| -
|
| -void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
|
| - ASSERT(in_spilled_code());
|
| - set_in_spilled_code(false);
|
| - VisitStatements(statements);
|
| - if (frame_ != NULL) {
|
| - frame_->SpillAll();
|
| - }
|
| - set_in_spilled_code(true);
|
| -}
|
| -
|
| -
|
| void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) {
|
| ASSERT(!in_spilled_code());
|
| for (int i = 0; has_valid_frame() && i < statements->length(); i++) {
|
|
|