| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // statement that keeps extra state on the stack (eg, for/in or | 145 // statement that keeps extra state on the stack (eg, for/in or |
| 146 // try/finally). They know the expected stack height at the target | 146 // try/finally). They know the expected stack height at the target |
| 147 // and will drop state from nested statements as part of merging. | 147 // and will drop state from nested statements as part of merging. |
| 148 // | 148 // |
| 149 // Break targets are used for return, break, and continue targets. | 149 // Break targets are used for return, break, and continue targets. |
| 150 | 150 |
| 151 class BreakTarget : public JumpTarget { | 151 class BreakTarget : public JumpTarget { |
| 152 public: | 152 public: |
| 153 // Construct a break target. | 153 // Construct a break target. |
| 154 inline BreakTarget(); | 154 inline BreakTarget(); |
| 155 |
| 155 inline BreakTarget(JumpTarget::Directionality direction); | 156 inline BreakTarget(JumpTarget::Directionality direction); |
| 156 | 157 |
| 157 virtual ~BreakTarget() {} | 158 virtual ~BreakTarget() {} |
| 158 | 159 |
| 159 // Copy the state of this jump target to the destination. | 160 // Copy the state of this jump target to the destination. |
| 160 inline void CopyTo(BreakTarget* destination) { | 161 inline void CopyTo(BreakTarget* destination) { |
| 161 *destination = *this; | 162 *destination = *this; |
| 162 } | 163 } |
| 163 | 164 |
| 164 // Emit a jump to the target. There must be a current frame at the | 165 // Emit a jump to the target. There must be a current frame at the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 183 | 184 |
| 184 private: | 185 private: |
| 185 // The expected height of the expression stack where the target will | 186 // The expected height of the expression stack where the target will |
| 186 // be bound, statically known at initialization time. | 187 // be bound, statically known at initialization time. |
| 187 int expected_height_; | 188 int expected_height_; |
| 188 }; | 189 }; |
| 189 | 190 |
| 190 } } // namespace v8::internal | 191 } } // namespace v8::internal |
| 191 | 192 |
| 192 #endif // V8_JUMP_TARGET_LIGHT_H_ | 193 #endif // V8_JUMP_TARGET_LIGHT_H_ |
| OLD | NEW |