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

Side by Side Diff: src/ia32/virtual-frame-ia32.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/virtual-frame-arm.h ('k') | src/register-allocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Make this virtual frame have a state identical to an expected virtual 124 // Make this virtual frame have a state identical to an expected virtual
125 // frame. As a side effect, code may be emitted to make this frame match 125 // frame. As a side effect, code may be emitted to make this frame match
126 // the expected one. 126 // the expected one.
127 void MergeTo(VirtualFrame* expected); 127 void MergeTo(VirtualFrame* expected);
128 128
129 // Detach a frame from its code generator, perhaps temporarily. This 129 // Detach a frame from its code generator, perhaps temporarily. This
130 // tells the register allocator that it is free to use frame-internal 130 // tells the register allocator that it is free to use frame-internal
131 // registers. Used when the code generator's frame is switched from this 131 // registers. Used when the code generator's frame is switched from this
132 // one to NULL by an unconditional jump. 132 // one to NULL by an unconditional jump.
133 void DetachFromCodeGenerator(); 133 void DetachFromCodeGenerator() {
134 RegisterAllocator* cgen_allocator = cgen_->allocator();
135 for (int i = 0; i < kNumRegisters; i++) {
136 if (is_used(i)) {
137 Register temp = { i };
138 cgen_allocator->Unuse(temp);
139 }
140 }
141 }
134 142
135 // (Re)attach a frame to its code generator. This informs the register 143 // (Re)attach a frame to its code generator. This informs the register
136 // allocator that the frame-internal register references are active again. 144 // allocator that the frame-internal register references are active again.
137 // Used when a code generator's frame is switched from NULL to this one by 145 // Used when a code generator's frame is switched from NULL to this one by
138 // binding a label. 146 // binding a label.
139 void AttachToCodeGenerator(); 147 void AttachToCodeGenerator() {
148 RegisterAllocator* cgen_allocator = cgen_->allocator();
149 for (int i = 0; i < kNumRegisters; i++) {
150 if (is_used(i)) {
151 Register temp = { i };
152 cgen_allocator->Use(temp);
153 }
154 }
155 }
140 156
141 // Emit code for the physical JS entry and exit frame sequences. After 157 // Emit code for the physical JS entry and exit frame sequences. After
142 // calling Enter, the virtual frame is ready for use; and after calling 158 // calling Enter, the virtual frame is ready for use; and after calling
143 // Exit it should not be used. Note that Enter does not allocate space in 159 // Exit it should not be used. Note that Enter does not allocate space in
144 // the physical frame for storing frame-allocated locals. 160 // the physical frame for storing frame-allocated locals.
145 void Enter(); 161 void Enter();
146 void Exit(); 162 void Exit();
147 163
148 // Prepare for returning from the frame by spilling locals. This 164 // Prepare for returning from the frame by spilling locals. This
149 // avoids generating unnecessary merge code when jumping to the 165 // avoids generating unnecessary merge code when jumping to the
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); 500 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);
485 501
486 bool Equals(VirtualFrame* other); 502 bool Equals(VirtualFrame* other);
487 503
488 friend class JumpTarget; 504 friend class JumpTarget;
489 }; 505 };
490 506
491 } } // namespace v8::internal 507 } } // namespace v8::internal
492 508
493 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_ 509 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_
OLDNEW
« no previous file with comments | « src/arm/virtual-frame-arm.h ('k') | src/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698