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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/virtual-frame.cc ('k') | no next file » | 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 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 }
135 // (Re)attach a frame to its code generator. This informs the register 142 // (Re)attach a frame to its code generator. This informs the register
136 // allocator that the frame-internal register references are active again. 143 // 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 144 // Used when a code generator's frame is switched from NULL to this one by
138 // binding a label. 145 // binding a label.
139 void AttachToCodeGenerator(); 146 void AttachToCodeGenerator() {
147 RegisterAllocator* cgen_allocator = cgen_->allocator();
148 for (int i = 0; i < kNumRegisters; i++) {
149 if (is_used(i)) {
150 Register temp = { i };
151 cgen_allocator->Use(temp);
152 }
153 }
154 }
140 155
141 // Emit code for the physical JS entry and exit frame sequences. After 156 // 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 157 // 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 158 // Exit it should not be used. Note that Enter does not allocate space in
144 // the physical frame for storing frame-allocated locals. 159 // the physical frame for storing frame-allocated locals.
145 void Enter(); 160 void Enter();
146 void Exit(); 161 void Exit();
147 162
148 // Prepare for returning from the frame by spilling locals. This 163 // Prepare for returning from the frame by spilling locals. This
149 // avoids generating unnecessary merge code when jumping to the 164 // 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); 499 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);
485 500
486 bool Equals(VirtualFrame* other); 501 bool Equals(VirtualFrame* other);
487 502
488 friend class JumpTarget; 503 friend class JumpTarget;
489 }; 504 };
490 505
491 } } // namespace v8::internal 506 } } // namespace v8::internal
492 507
493 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ 508 #endif // V8_X64_VIRTUAL_FRAME_X64_H_
OLDNEW
« 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