Figure out where the register allocator's increments and decrements happen when register elements are added to and dropped from the frame. We are currently thinking in the constructor and destructor of register elements, but this requires a back pointer in the elements. The frame copy code, push, pop, and drop code all need to agree on this.
http://codereview.chromium.org/11396/diff/1/9 File src/codegen-ia32.cc (right): http://codereview.chromium.org/11396/diff/1/9#newcode290 Line 290: allocator_ = NULL; // Insert a comment for dumb people like me: allocator_ points to a stack-allocated local. http://codereview.chromium.org/11396/diff/1/6 File src/virtual-frame-ia32.cc (right): http://codereview.chromium.org/11396/diff/1/6#newcode67 Line 67: frame_registers_(original->frame_registers_) { If the register_elements have pointers to the frame, or to the frame's register allocator, so that their destructors can decrement the allocator counts, then these pointers need to be redirected to the new copy when the list is copied. Actually, the problem is in the loop following, that copies the elements. http://codereview.chromium.org/11396/diff/1/6#newcode156 Line 156: // register whose internal reference count matches its internal reference matches its external reference count? http://codereview.chromium.org/11396/diff/1/6#newcode177 Line 177: if (elements_[i].is_register() & && not &, right? http://codereview.chromium.org/11396/diff/1/6#newcode202 Line 202: // above the stack pointer. UNclear about "We can only..." Comment or assert precondition: index <= stack pointer + 1 http://codereview.chromium.org/11396/diff/1/6#newcode391 Line 391: void VirtualFrame::Drop(int count) { Drop needs to update the register allocator. We will do this in the destructor of the frame elements. http://codereview.chromium.org/11396/diff/1/6#newcode426 Line 426: void VirtualFrame::EmitPush(Register reg) { Should this ever be used with regs? Assert that it is not? http://codereview.chromium.org/11396/diff/1/6#newcode451 Line 451: Use(reg); Change Use(reg) to be in the constructor of the FrameElement(reg, this) and Unuse(reg) to be in its destructor. http://codereview.chromium.org/11396 --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---