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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // statement that keeps extra state on the stack (eg, for/in or | 189 // statement that keeps extra state on the stack (eg, for/in or |
190 // try/finally). They know the expected stack height at the target | 190 // try/finally). They know the expected stack height at the target |
191 // and will drop state from nested statements as part of merging. | 191 // and will drop state from nested statements as part of merging. |
192 // | 192 // |
193 // Break targets are used for return, break, and continue targets. | 193 // Break targets are used for return, break, and continue targets. |
194 | 194 |
195 class BreakTarget : public JumpTarget { | 195 class BreakTarget : public JumpTarget { |
196 public: | 196 public: |
197 // Construct a break target. | 197 // Construct a break target. |
198 BreakTarget() {} | 198 BreakTarget() {} |
| 199 BreakTarget(JumpTarget::Directionality direction) |
| 200 : JumpTarget(direction) { } |
199 | 201 |
200 virtual ~BreakTarget() {} | 202 virtual ~BreakTarget() {} |
201 | 203 |
202 // Set the direction of the break target. | 204 // Set the direction of the break target. |
203 virtual void set_direction(Directionality direction); | 205 virtual void set_direction(Directionality direction); |
204 | 206 |
205 // Copy the state of this break target to the destination. The | 207 // Copy the state of this break target to the destination. The |
206 // lists of forward-reaching frames and merge-point labels are | 208 // lists of forward-reaching frames and merge-point labels are |
207 // copied. All virtual frame pointers are copied, not the | 209 // copied. All virtual frame pointers are copied, not the |
208 // pointed-to frames. The previous state of the destination is | 210 // pointed-to frames. The previous state of the destination is |
(...skipping 24 matching lines...) Expand all Loading... |
233 // The expected height of the expression stack where the target will | 235 // The expected height of the expression stack where the target will |
234 // be bound, statically known at initialization time. | 236 // be bound, statically known at initialization time. |
235 int expected_height_; | 237 int expected_height_; |
236 | 238 |
237 DISALLOW_COPY_AND_ASSIGN(BreakTarget); | 239 DISALLOW_COPY_AND_ASSIGN(BreakTarget); |
238 }; | 240 }; |
239 | 241 |
240 } } // namespace v8::internal | 242 } } // namespace v8::internal |
241 | 243 |
242 #endif // V8_JUMP_TARGET_HEAVY_H_ | 244 #endif // V8_JUMP_TARGET_HEAVY_H_ |
OLD | NEW |