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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 virtual void Bind(); | 128 virtual void Bind(); |
129 virtual void Bind(Result* arg); | 129 virtual void Bind(Result* arg); |
130 void Bind(Result* arg0, Result* arg1); | 130 void Bind(Result* arg0, Result* arg1); |
131 | 131 |
132 // Emit a call to a jump target. There must be a current frame at | 132 // Emit a call to a jump target. There must be a current frame at |
133 // the call. The frame at the target is the same as the current | 133 // the call. The frame at the target is the same as the current |
134 // frame except for an extra return address on top of it. The frame | 134 // frame except for an extra return address on top of it. The frame |
135 // after the call is the same as the frame before the call. | 135 // after the call is the same as the frame before the call. |
136 void Call(); | 136 void Call(); |
137 | 137 |
138 static void set_compiling_deferred_code(bool flag) { | |
139 compiling_deferred_code_ = flag; | |
140 } | |
141 | |
142 protected: | 138 protected: |
143 // Directionality flag set at initialization time. | 139 // Directionality flag set at initialization time. |
144 Directionality direction_; | 140 Directionality direction_; |
145 | 141 |
146 // A list of frames reaching this block via forward jumps. | 142 // A list of frames reaching this block via forward jumps. |
147 ZoneList<VirtualFrame*> reaching_frames_; | 143 ZoneList<VirtualFrame*> reaching_frames_; |
148 | 144 |
149 // A parallel list of labels for merge code. | 145 // A parallel list of labels for merge code. |
150 ZoneList<Label> merge_labels_; | 146 ZoneList<Label> merge_labels_; |
151 | 147 |
152 // The frame used on entry to the block and expected at backward | 148 // The frame used on entry to the block and expected at backward |
153 // jumps to the block. Set when the jump target is bound, but may | 149 // jumps to the block. Set when the jump target is bound, but may |
154 // or may not be set for forward-only blocks. | 150 // or may not be set for forward-only blocks. |
155 VirtualFrame* entry_frame_; | 151 VirtualFrame* entry_frame_; |
156 | 152 |
157 // The actual entry label of the block. | 153 // The actual entry label of the block. |
158 Label entry_label_; | 154 Label entry_label_; |
159 | 155 |
160 // Implementations of Jump, Branch, and Bind with all arguments and | 156 // Implementations of Jump, Branch, and Bind with all arguments and |
161 // return values using the virtual frame. | 157 // return values using the virtual frame. |
162 void DoJump(); | 158 void DoJump(); |
163 void DoBranch(Condition cc, Hint hint); | 159 void DoBranch(Condition cc, Hint hint); |
164 void DoBind(); | 160 void DoBind(); |
165 | 161 |
166 private: | 162 private: |
167 static bool compiling_deferred_code_; | |
168 | |
169 // Add a virtual frame reaching this labeled block via a forward jump, | 163 // Add a virtual frame reaching this labeled block via a forward jump, |
170 // and a corresponding merge code label. | 164 // and a corresponding merge code label. |
171 void AddReachingFrame(VirtualFrame* frame); | 165 void AddReachingFrame(VirtualFrame* frame); |
172 | 166 |
173 // Perform initialization required during entry frame computation | 167 // Perform initialization required during entry frame computation |
174 // after setting the virtual frame element at index in frame to be | 168 // after setting the virtual frame element at index in frame to be |
175 // target. | 169 // target. |
176 inline void InitializeEntryElement(int index, FrameElement* target); | 170 inline void InitializeEntryElement(int index, FrameElement* target); |
177 | 171 |
178 // Compute a frame to use for entry to this block. | 172 // Compute a frame to use for entry to this block. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // The expected height of the expression stack where the target will | 229 // The expected height of the expression stack where the target will |
236 // be bound, statically known at initialization time. | 230 // be bound, statically known at initialization time. |
237 int expected_height_; | 231 int expected_height_; |
238 | 232 |
239 DISALLOW_COPY_AND_ASSIGN(BreakTarget); | 233 DISALLOW_COPY_AND_ASSIGN(BreakTarget); |
240 }; | 234 }; |
241 | 235 |
242 } } // namespace v8::internal | 236 } } // namespace v8::internal |
243 | 237 |
244 #endif // V8_JUMP_TARGET_HEAVY_H_ | 238 #endif // V8_JUMP_TARGET_HEAVY_H_ |
OLD | NEW |