| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" |
| 10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void VisitForAccumulatorValue(Expression* expr); | 158 void VisitForAccumulatorValue(Expression* expr); |
| 159 void VisitForAccumulatorValueOrTheHole(Expression* expr); | 159 void VisitForAccumulatorValueOrTheHole(Expression* expr); |
| 160 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); | 160 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); |
| 161 void VisitForRegisterValue(Expression* expr, Register destination); | 161 void VisitForRegisterValue(Expression* expr, Register destination); |
| 162 void VisitForEffect(Expression* expr); | 162 void VisitForEffect(Expression* expr); |
| 163 | 163 |
| 164 // Methods for tracking and remapping register. | 164 // Methods for tracking and remapping register. |
| 165 void RecordStoreToRegister(Register reg); | 165 void RecordStoreToRegister(Register reg); |
| 166 Register LoadFromAliasedRegister(Register reg); | 166 Register LoadFromAliasedRegister(Register reg); |
| 167 | 167 |
| 168 // Methods for tracking try-block nesting. | |
| 169 bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; } | |
| 170 bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; } | |
| 171 | |
| 172 // Initialize an array of temporary registers with consecutive registers. | 168 // Initialize an array of temporary registers with consecutive registers. |
| 173 template <size_t N> | 169 template <size_t N> |
| 174 void InitializeWithConsecutiveRegisters(Register (®isters)[N]); | 170 void InitializeWithConsecutiveRegisters(Register (®isters)[N]); |
| 175 | 171 |
| 176 inline BytecodeArrayBuilder* builder() const { return builder_; } | 172 inline BytecodeArrayBuilder* builder() const { return builder_; } |
| 177 inline Isolate* isolate() const { return isolate_; } | 173 inline Isolate* isolate() const { return isolate_; } |
| 178 inline Zone* zone() const { return zone_; } | 174 inline Zone* zone() const { return zone_; } |
| 179 inline Scope* scope() const { return scope_; } | 175 inline Scope* scope() const { return scope_; } |
| 180 inline CompilationInfo* info() const { return info_; } | 176 inline CompilationInfo* info() const { return info_; } |
| 181 | 177 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 208 BytecodeArrayBuilder* builder_; | 204 BytecodeArrayBuilder* builder_; |
| 209 CompilationInfo* info_; | 205 CompilationInfo* info_; |
| 210 Scope* scope_; | 206 Scope* scope_; |
| 211 ZoneVector<Handle<Object>> globals_; | 207 ZoneVector<Handle<Object>> globals_; |
| 212 ControlScope* execution_control_; | 208 ControlScope* execution_control_; |
| 213 ContextScope* execution_context_; | 209 ContextScope* execution_context_; |
| 214 ExpressionResultScope* execution_result_; | 210 ExpressionResultScope* execution_result_; |
| 215 RegisterAllocationScope* register_allocator_; | 211 RegisterAllocationScope* register_allocator_; |
| 216 ZoneVector<BytecodeLabel> generator_resume_points_; | 212 ZoneVector<BytecodeLabel> generator_resume_points_; |
| 217 Register generator_state_; | 213 Register generator_state_; |
| 218 int try_catch_nesting_level_; | |
| 219 int try_finally_nesting_level_; | |
| 220 }; | 214 }; |
| 221 | 215 |
| 222 } // namespace interpreter | 216 } // namespace interpreter |
| 223 } // namespace internal | 217 } // namespace internal |
| 224 } // namespace v8 | 218 } // namespace v8 |
| 225 | 219 |
| 226 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 220 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| OLD | NEW |