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