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

Side by Side Diff: src/arm/virtual-frame-arm.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 | « no previous file | src/ia32/virtual-frame-ia32.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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Make this virtual frame have a state identical to an expected virtual 121 // Make this virtual frame have a state identical to an expected virtual
122 // frame. As a side effect, code may be emitted to make this frame match 122 // frame. As a side effect, code may be emitted to make this frame match
123 // the expected one. 123 // the expected one.
124 void MergeTo(VirtualFrame* expected); 124 void MergeTo(VirtualFrame* expected);
125 125
126 // Detach a frame from its code generator, perhaps temporarily. This 126 // Detach a frame from its code generator, perhaps temporarily. This
127 // tells the register allocator that it is free to use frame-internal 127 // tells the register allocator that it is free to use frame-internal
128 // registers. Used when the code generator's frame is switched from this 128 // registers. Used when the code generator's frame is switched from this
129 // one to NULL by an unconditional jump. 129 // one to NULL by an unconditional jump.
130 void DetachFromCodeGenerator(); 130 void DetachFromCodeGenerator() {
131 RegisterAllocator* cgen_allocator = cgen_->allocator();
132 for (int i = 0; i < kNumRegisters; i++) {
133 if (is_used(i)) {
134 Register temp = { i };
135 cgen_allocator->Unuse(temp);
136 }
137 }
138 }
131 139
132 // (Re)attach a frame to its code generator. This informs the register 140 // (Re)attach a frame to its code generator. This informs the register
133 // allocator that the frame-internal register references are active again. 141 // allocator that the frame-internal register references are active again.
134 // Used when a code generator's frame is switched from NULL to this one by 142 // Used when a code generator's frame is switched from NULL to this one by
135 // binding a label. 143 // binding a label.
136 void AttachToCodeGenerator(); 144 void AttachToCodeGenerator() {
145 RegisterAllocator* cgen_allocator = cgen_->allocator();
146 for (int i = 0; i < kNumRegisters; i++) {
147 if (is_used(i)) {
148 Register temp = { i };
149 cgen_allocator->Use(temp);
150 }
151 }
152 }
137 153
138 // Emit code for the physical JS entry and exit frame sequences. After 154 // Emit code for the physical JS entry and exit frame sequences. After
139 // calling Enter, the virtual frame is ready for use; and after calling 155 // calling Enter, the virtual frame is ready for use; and after calling
140 // Exit it should not be used. Note that Enter does not allocate space in 156 // Exit it should not be used. Note that Enter does not allocate space in
141 // the physical frame for storing frame-allocated locals. 157 // the physical frame for storing frame-allocated locals.
142 void Enter(); 158 void Enter();
143 void Exit(); 159 void Exit();
144 160
145 // Prepare for returning from the frame by spilling locals and 161 // Prepare for returning from the frame by spilling locals and
146 // dropping all non-locals elements in the virtual frame. This 162 // dropping all non-locals elements in the virtual frame. This
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 487
472 bool Equals(VirtualFrame* other); 488 bool Equals(VirtualFrame* other);
473 489
474 friend class JumpTarget; 490 friend class JumpTarget;
475 }; 491 };
476 492
477 493
478 } } // namespace v8::internal 494 } } // namespace v8::internal
479 495
480 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ 496 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698