OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Notify the statement that we are exiting it via break, continue, or | 135 // Notify the statement that we are exiting it via break, continue, or |
136 // return and give it a chance to generate cleanup code. Return the | 136 // return and give it a chance to generate cleanup code. Return the |
137 // next outer statement in the nesting stack. We accumulate in | 137 // next outer statement in the nesting stack. We accumulate in |
138 // *stack_depth the amount to drop the stack and in *context_length the | 138 // *stack_depth the amount to drop the stack and in *context_length the |
139 // number of context chain links to unwind as we traverse the nesting | 139 // number of context chain links to unwind as we traverse the nesting |
140 // stack from an exit to its target. | 140 // stack from an exit to its target. |
141 virtual NestedStatement* Exit(int* stack_depth, int* context_length) { | 141 virtual NestedStatement* Exit(int* stack_depth, int* context_length) { |
142 return previous_; | 142 return previous_; |
143 } | 143 } |
144 | 144 |
145 protected: | 145 protected: |
146 MacroAssembler* masm() { return codegen_->masm(); } | 146 MacroAssembler* masm() { return codegen_->masm(); } |
147 | 147 |
148 FullCodeGenerator* codegen_; | 148 FullCodeGenerator* codegen_; |
149 NestedStatement* previous_; | 149 NestedStatement* previous_; |
| 150 |
| 151 private: |
150 DISALLOW_COPY_AND_ASSIGN(NestedStatement); | 152 DISALLOW_COPY_AND_ASSIGN(NestedStatement); |
151 }; | 153 }; |
152 | 154 |
153 // A breakable statement such as a block. | 155 // A breakable statement such as a block. |
154 class Breakable : public NestedStatement { | 156 class Breakable : public NestedStatement { |
155 public: | 157 public: |
156 Breakable(FullCodeGenerator* codegen, BreakableStatement* statement) | 158 Breakable(FullCodeGenerator* codegen, BreakableStatement* statement) |
157 : NestedStatement(codegen), statement_(statement) { | 159 : NestedStatement(codegen), statement_(statement) { |
158 } | 160 } |
159 virtual ~Breakable() {} | 161 virtual ~Breakable() {} |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 763 |
762 friend class NestedStatement; | 764 friend class NestedStatement; |
763 | 765 |
764 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 766 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
765 }; | 767 }; |
766 | 768 |
767 | 769 |
768 } } // namespace v8::internal | 770 } } // namespace v8::internal |
769 | 771 |
770 #endif // V8_FULL_CODEGEN_H_ | 772 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |