Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: src/x64/virtual-frame-x64.h

Issue 113402: Improve algorithm for detaching and attaching a virtual frame to the code... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/virtual-frame.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/virtual-frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698