| Index: src/virtual-frame-ia32.cc
|
| ===================================================================
|
| --- src/virtual-frame-ia32.cc (revision 927)
|
| +++ src/virtual-frame-ia32.cc (working copy)
|
| @@ -219,6 +219,7 @@
|
| }
|
| }
|
|
|
| +
|
| // Make the type of all elements be MEMORY.
|
| void VirtualFrame::SpillAll() {
|
| for (int i = 0; i < elements_.length(); i++) {
|
| @@ -297,10 +298,6 @@
|
| if (element.is_synced()) {
|
| new_elements[i] = memory_element;
|
| } else {
|
| - // This code path is currently not triggered. UNIMPLEMENTED is
|
| - // temporarily used to trap when it becomes active so we can test
|
| - // it.
|
| - UNIMPLEMENTED();
|
| Register reg = cgen_->allocator()->AllocateWithoutSpilling();
|
| if (reg.is(no_reg)) {
|
| new_elements[i] = memory_element;
|
| @@ -411,17 +408,36 @@
|
| stack_pointer_--;
|
| __ pop(target.reg());
|
| }
|
| - Use(target.reg());
|
| - } else if (source.is_constant()) {
|
| - // Not yet implemented. When done, code in common with the
|
| - // memory-to-register just above case can be factored out.
|
| - UNIMPLEMENTED();
|
| + } else {
|
| + // Source is constant.
|
| + __ Set(target.reg(), Immediate(source.handle()));
|
| }
|
| + Use(target.reg());
|
| elements_[i] = target;
|
| }
|
| }
|
|
|
| + // At this point, the frames should be identical.
|
| ASSERT(stack_pointer_ == expected->stack_pointer_);
|
| +#ifdef DEBUG
|
| + for (int i = 0; i < elements_.length(); i++) {
|
| + FrameElement expect = expected->elements_[i];
|
| + if (expect.is_memory()) {
|
| + ASSERT(elements_[i].is_memory());
|
| + ASSERT(elements_[i].is_synced() && expect.is_synced());
|
| + } else if (expect.is_register()) {
|
| + ASSERT(elements_[i].is_register());
|
| + ASSERT(elements_[i].reg().is(expect.reg()));
|
| + ASSERT(elements_[i].is_synced() == expect.is_synced());
|
| + } else {
|
| + ASSERT(expect.is_constant());
|
| + ASSERT(elements_[i].is_constant());
|
| + ASSERT(elements_[i].handle().location() ==
|
| + expect.handle().location());
|
| + ASSERT(elements_[i].is_synced() == expect.is_synced());
|
| + }
|
| + }
|
| +#endif
|
| }
|
|
|
|
|
| @@ -433,11 +449,14 @@
|
| frame_pointer_ = stack_pointer_;
|
| __ mov(ebp, Operand(esp));
|
|
|
| - // Store the context and the function in the frame.
|
| - Push(esi);
|
| - // The frame owns the register reference now.
|
| - cgen_->allocator()->Unuse(esi);
|
| + // Store the context in the frame. The context is kept in esi, so the
|
| + // register reference is not owned by the frame (ie, the frame is not free
|
| + // to spill it). This is implemented by making the in-frame value be
|
| + // memory.
|
| + EmitPush(esi);
|
|
|
| + // Store the function in the frame. The frame owns the register reference
|
| + // now (ie, it can keep it in edi or spill it later).
|
| Push(edi);
|
| cgen_->allocator()->Unuse(edi);
|
| }
|
|
|