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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 int mergable_elements = kAllElements); | 154 int mergable_elements = kAllElements); |
155 | 155 |
156 // Emit a call to a jump target. There must be a current frame at | 156 // Emit a call to a jump target. There must be a current frame at |
157 // the call. The frame at the target is the same as the current | 157 // the call. The frame at the target is the same as the current |
158 // frame except for an extra return address on top of it. The frame | 158 // frame except for an extra return address on top of it. The frame |
159 // after the call is the same as the frame before the call. | 159 // after the call is the same as the frame before the call. |
160 void Call(); | 160 void Call(); |
161 | 161 |
162 static const int kAllElements = -1; // Not a valid number of elements. | 162 static const int kAllElements = -1; // Not a valid number of elements. |
163 | 163 |
| 164 static void set_compiling_deferred_code(bool flag) { |
| 165 compiling_deferred_code_ = flag; |
| 166 } |
| 167 |
164 protected: | 168 protected: |
165 // The code generator gives access to its current frame. | 169 // The code generator gives access to its current frame. |
166 CodeGenerator* cgen_; | 170 CodeGenerator* cgen_; |
167 | 171 |
168 // Used to emit code. | 172 // Used to emit code. |
169 MacroAssembler* masm_; | 173 MacroAssembler* masm_; |
170 | 174 |
171 // Directionality flag set at initialization time. | 175 // Directionality flag set at initialization time. |
172 Directionality direction_; | 176 Directionality direction_; |
173 | 177 |
(...skipping 17 matching lines...) Expand all Loading... |
191 bool is_bound_; | 195 bool is_bound_; |
192 bool is_linked_; | 196 bool is_linked_; |
193 | 197 |
194 // Implementations of Jump, Branch, and Bind with all arguments and | 198 // Implementations of Jump, Branch, and Bind with all arguments and |
195 // return values using the virtual frame. | 199 // return values using the virtual frame. |
196 void DoJump(); | 200 void DoJump(); |
197 void DoBranch(Condition cc, Hint hint); | 201 void DoBranch(Condition cc, Hint hint); |
198 void DoBind(int mergable_elements); | 202 void DoBind(int mergable_elements); |
199 | 203 |
200 private: | 204 private: |
201 // Add a virtual frame reaching this labeled block via a forward | 205 static bool compiling_deferred_code_; |
202 // jump, and a fresh label for its merge code. | 206 |
| 207 // Add a virtual frame reaching this labeled block via a forward jump, |
| 208 // and a corresponding merge code label. |
203 void AddReachingFrame(VirtualFrame* frame); | 209 void AddReachingFrame(VirtualFrame* frame); |
204 | 210 |
205 // Compute a frame to use for entry to this block. Mergable | 211 // Compute a frame to use for entry to this block. Mergable elements |
206 // elements is as described for the Bind function. | 212 // is as described for the Bind function. |
207 void ComputeEntryFrame(int mergable_elements); | 213 void ComputeEntryFrame(int mergable_elements); |
208 | 214 |
209 DISALLOW_COPY_AND_ASSIGN(JumpTarget); | 215 DISALLOW_COPY_AND_ASSIGN(JumpTarget); |
210 }; | 216 }; |
211 | 217 |
212 | 218 |
213 // ------------------------------------------------------------------------- | 219 // ------------------------------------------------------------------------- |
214 // Break targets | 220 // Break targets |
215 // | 221 // |
216 // A break target is a jump target that can be used to break out of a | 222 // A break target is a jump target that can be used to break out of a |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 bool is_shadowing_; | 318 bool is_shadowing_; |
313 #endif | 319 #endif |
314 | 320 |
315 DISALLOW_COPY_AND_ASSIGN(ShadowTarget); | 321 DISALLOW_COPY_AND_ASSIGN(ShadowTarget); |
316 }; | 322 }; |
317 | 323 |
318 | 324 |
319 } } // namespace v8::internal | 325 } } // namespace v8::internal |
320 | 326 |
321 #endif // V8_JUMP_TARGET_H_ | 327 #endif // V8_JUMP_TARGET_H_ |
OLD | NEW |