Index: src/x64/virtual-frame-x64.h |
=================================================================== |
--- src/x64/virtual-frame-x64.h (revision 1953) |
+++ src/x64/virtual-frame-x64.h (working copy) |
@@ -130,13 +130,28 @@ |
// tells the register allocator that it is free to use frame-internal |
// registers. Used when the code generator's frame is switched from this |
// one to NULL by an unconditional jump. |
- void DetachFromCodeGenerator(); |
- |
+ void DetachFromCodeGenerator() { |
+ RegisterAllocator* cgen_allocator = cgen_->allocator(); |
+ for (int i = 0; i < kNumRegisters; i++) { |
+ if (is_used(i)) { |
+ Register temp = { i }; |
+ cgen_allocator->Unuse(temp); |
+ } |
+ } |
+ } |
// (Re)attach a frame to its code generator. This informs the register |
// allocator that the frame-internal register references are active again. |
// Used when a code generator's frame is switched from NULL to this one by |
// binding a label. |
- void AttachToCodeGenerator(); |
+ void AttachToCodeGenerator() { |
+ RegisterAllocator* cgen_allocator = cgen_->allocator(); |
+ for (int i = 0; i < kNumRegisters; i++) { |
+ if (is_used(i)) { |
+ Register temp = { i }; |
+ cgen_allocator->Use(temp); |
+ } |
+ } |
+ } |
// Emit code for the physical JS entry and exit frame sequences. After |
// calling Enter, the virtual frame is ready for use; and after calling |