OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 int register_count(Register reg) { | 74 int register_count(Register reg) { |
75 return frame_registers_.count(reg); | 75 return frame_registers_.count(reg); |
76 } | 76 } |
77 | 77 |
78 // Add extra in-memory elements to the top of the frame to match an actual | 78 // Add extra in-memory elements to the top of the frame to match an actual |
79 // frame (eg, the frame after an exception handler is pushed). No code is | 79 // frame (eg, the frame after an exception handler is pushed). No code is |
80 // emitted. | 80 // emitted. |
81 void Adjust(int count); | 81 void Adjust(int count); |
82 | 82 |
83 // Forget elements from the top of the frame to match an actual frame (eg, | 83 // Forget count elements from the top of the frame all in-memory |
84 // the frame after a runtime call). No code is emitted. | 84 // (including synced) and adjust the stack pointer downward, to |
| 85 // match an external frame effect (examples include a call removing |
| 86 // its arguments, and exiting a try/catch removing an exception |
| 87 // handler). No code will be emitted. |
85 void Forget(int count); | 88 void Forget(int count); |
86 | 89 |
| 90 // Forget count elements from the top of the frame without adjusting |
| 91 // the stack pointer downward. This is used, for example, before |
| 92 // merging frames at break, continue, and return targets. |
| 93 void ForgetElements(int count); |
| 94 |
87 // Spill all values from the frame to memory. | 95 // Spill all values from the frame to memory. |
88 void SpillAll(); | 96 void SpillAll(); |
89 | 97 |
90 // Spill all occurrences of a specific register from the frame. | 98 // Spill all occurrences of a specific register from the frame. |
91 void Spill(Register reg); | 99 void Spill(Register reg); |
92 | 100 |
93 // Spill all occurrences of an arbitrary register if possible. Return the | 101 // Spill all occurrences of an arbitrary register if possible. Return the |
94 // register spilled or no_reg if it was not possible to free any register | 102 // register spilled or no_reg if it was not possible to free any register |
95 // (ie, they all have frame-external references). | 103 // (ie, they all have frame-external references). |
96 Register SpillAnyRegister(); | 104 Register SpillAnyRegister(); |
(...skipping 20 matching lines...) Expand all Loading... |
117 // binding a label. | 125 // binding a label. |
118 void AttachToCodeGenerator(); | 126 void AttachToCodeGenerator(); |
119 | 127 |
120 // Emit code for the physical JS entry and exit frame sequences. After | 128 // Emit code for the physical JS entry and exit frame sequences. After |
121 // calling Enter, the virtual frame is ready for use; and after calling | 129 // calling Enter, the virtual frame is ready for use; and after calling |
122 // Exit it should not be used. Note that Enter does not allocate space in | 130 // Exit it should not be used. Note that Enter does not allocate space in |
123 // the physical frame for storing frame-allocated locals. | 131 // the physical frame for storing frame-allocated locals. |
124 void Enter(); | 132 void Enter(); |
125 void Exit(); | 133 void Exit(); |
126 | 134 |
127 // Prepare for returning from the frame by spilling locals and | 135 // Prepare for returning from the frame by spilling locals. This |
128 // dropping all non-locals elements in the virtual frame. This | |
129 // avoids generating unnecessary merge code when jumping to the | 136 // avoids generating unnecessary merge code when jumping to the |
130 // shared return site. Emits code for spills. | 137 // shared return site. Emits code for spills. |
131 void PrepareForReturn(); | 138 void PrepareForReturn(); |
132 | 139 |
133 // Allocate and initialize the frame-allocated locals. | 140 // Allocate and initialize the frame-allocated locals. |
134 void AllocateStackSlots(int count); | 141 void AllocateStackSlots(int count); |
135 | 142 |
136 // An element of the expression stack as an assembly operand. | 143 // An element of the expression stack as an assembly operand. |
137 Operand ElementAt(int index) const { | 144 Operand ElementAt(int index) const { |
138 return Operand(esp, index * kPointerSize); | 145 return Operand(esp, index * kPointerSize); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); | 450 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); |
444 | 451 |
445 bool Equals(VirtualFrame* other); | 452 bool Equals(VirtualFrame* other); |
446 | 453 |
447 friend class JumpTarget; | 454 friend class JumpTarget; |
448 }; | 455 }; |
449 | 456 |
450 } } // namespace v8::internal | 457 } } // namespace v8::internal |
451 | 458 |
452 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 459 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
OLD | NEW |