OLD | NEW |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 stack_pointer_ -= count; | 132 stack_pointer_ -= count; |
133 ForgetElements(count); | 133 ForgetElements(count); |
134 } | 134 } |
135 | 135 |
136 // Forget count elements from the top of the frame without adjusting | 136 // Forget count elements from the top of the frame without adjusting |
137 // the stack pointer downward. This is used, for example, before | 137 // the stack pointer downward. This is used, for example, before |
138 // merging frames at break, continue, and return targets. | 138 // merging frames at break, continue, and return targets. |
139 void ForgetElements(int count); | 139 void ForgetElements(int count); |
140 | 140 |
141 // Spill all values from the frame to memory. | 141 // Spill all values from the frame to memory. |
142 void SpillAll(); | 142 inline void SpillAll(); |
143 | 143 |
144 // Spill all occurrences of a specific register from the frame. | 144 // Spill all occurrences of a specific register from the frame. |
145 void Spill(Register reg) { | 145 void Spill(Register reg) { |
146 if (is_used(reg)) SpillElementAt(register_location(reg)); | 146 if (is_used(reg)) SpillElementAt(register_location(reg)); |
147 } | 147 } |
148 | 148 |
149 // Spill all occurrences of an arbitrary register if possible. Return the | 149 // Spill all occurrences of an arbitrary register if possible. Return the |
150 // register spilled or no_reg if it was not possible to free any register | 150 // register spilled or no_reg if it was not possible to free any register |
151 // (ie, they all have frame-external references). | 151 // (ie, they all have frame-external references). |
152 Register SpillAnyRegister(); | 152 Register SpillAnyRegister(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Emit code for the physical JS entry and exit frame sequences. After | 193 // Emit code for the physical JS entry and exit frame sequences. After |
194 // calling Enter, the virtual frame is ready for use; and after calling | 194 // calling Enter, the virtual frame is ready for use; and after calling |
195 // Exit it should not be used. Note that Enter does not allocate space in | 195 // Exit it should not be used. Note that Enter does not allocate space in |
196 // the physical frame for storing frame-allocated locals. | 196 // the physical frame for storing frame-allocated locals. |
197 void Enter(); | 197 void Enter(); |
198 void Exit(); | 198 void Exit(); |
199 | 199 |
200 // Prepare for returning from the frame by spilling locals. This | 200 // Prepare for returning from the frame by spilling locals. This |
201 // avoids generating unnecessary merge code when jumping to the | 201 // avoids generating unnecessary merge code when jumping to the |
202 // shared return site. Emits code for spills. | 202 // shared return site. Emits code for spills. |
203 void PrepareForReturn(); | 203 inline void PrepareForReturn(); |
204 | 204 |
205 // Number of local variables after when we use a loop for allocating. | 205 // Number of local variables after when we use a loop for allocating. |
206 static const int kLocalVarBound = 7; | 206 static const int kLocalVarBound = 7; |
207 | 207 |
208 // Allocate and initialize the frame-allocated locals. | 208 // Allocate and initialize the frame-allocated locals. |
209 void AllocateStackSlots(); | 209 void AllocateStackSlots(); |
210 | 210 |
211 // An element of the expression stack as an assembly operand. | 211 // An element of the expression stack as an assembly operand. |
212 Operand ElementAt(int index) const { | 212 Operand ElementAt(int index) const { |
213 return Operand(rsp, index * kPointerSize); | 213 return Operand(rsp, index * kPointerSize); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 564 |
565 // Classes that need raw access to the elements_ array. | 565 // Classes that need raw access to the elements_ array. |
566 friend class DeferredCode; | 566 friend class DeferredCode; |
567 friend class JumpTarget; | 567 friend class JumpTarget; |
568 }; | 568 }; |
569 | 569 |
570 | 570 |
571 } } // namespace v8::internal | 571 } } // namespace v8::internal |
572 | 572 |
573 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ | 573 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ |
OLD | NEW |