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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 class ControlScope; | 44 class ControlScope; |
45 class ControlScopeForBreakable; | 45 class ControlScopeForBreakable; |
46 class ControlScopeForIteration; | 46 class ControlScopeForIteration; |
47 class ControlScopeForTopLevel; | 47 class ControlScopeForTopLevel; |
48 class ControlScopeForTryCatch; | 48 class ControlScopeForTryCatch; |
49 class ControlScopeForTryFinally; | 49 class ControlScopeForTryFinally; |
50 class CurrentScope; | 50 class CurrentScope; |
51 class ExpressionResultScope; | 51 class ExpressionResultScope; |
52 class EffectResultScope; | 52 class EffectResultScope; |
53 class GlobalDeclarationsBuilder; | 53 class GlobalDeclarationsBuilder; |
54 class BlockCoverageBuilder; | |
54 class RegisterAllocationScope; | 55 class RegisterAllocationScope; |
55 class TestResultScope; | 56 class TestResultScope; |
56 class ValueResultScope; | 57 class ValueResultScope; |
57 | 58 |
58 using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode; | 59 using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode; |
59 | 60 |
60 enum class TestFallthrough { kThen, kElse, kNone }; | 61 enum class TestFallthrough { kThen, kElse, kNone }; |
61 enum class TypeHint { kAny, kString, kBoolean }; | 62 enum class TypeHint { kAny, kString, kBoolean }; |
62 | 63 |
63 void GenerateBytecodeBody(); | 64 void GenerateBytecodeBody(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 return builder()->register_allocator(); | 230 return builder()->register_allocator(); |
230 } | 231 } |
231 | 232 |
232 GlobalDeclarationsBuilder* globals_builder() { | 233 GlobalDeclarationsBuilder* globals_builder() { |
233 DCHECK_NOT_NULL(globals_builder_); | 234 DCHECK_NOT_NULL(globals_builder_); |
234 return globals_builder_; | 235 return globals_builder_; |
235 } | 236 } |
236 inline LanguageMode language_mode() const; | 237 inline LanguageMode language_mode() const; |
237 int feedback_index(FeedbackSlot slot) const; | 238 int feedback_index(FeedbackSlot slot) const; |
238 | 239 |
240 int AllocateBlockCoverageSlot(SourceRange range); | |
241 void IncBlockCounter(int coverage_array_slot); | |
rmcilroy
2017/06/02 09:35:59
nit - move above "getters" (maybe below BuildLoadP
jgruber
2017/06/02 11:38:49
Done.
| |
242 | |
239 Zone* zone_; | 243 Zone* zone_; |
240 BytecodeArrayBuilder* builder_; | 244 BytecodeArrayBuilder* builder_; |
241 CompilationInfo* info_; | 245 CompilationInfo* info_; |
242 const AstStringConstants* ast_string_constants_; | 246 const AstStringConstants* ast_string_constants_; |
243 DeclarationScope* closure_scope_; | 247 DeclarationScope* closure_scope_; |
244 Scope* current_scope_; | 248 Scope* current_scope_; |
245 | 249 |
246 GlobalDeclarationsBuilder* globals_builder_; | 250 GlobalDeclarationsBuilder* globals_builder_; |
251 BlockCoverageBuilder* block_coverage_builder_; | |
247 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_; | 252 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_; |
248 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_; | 253 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_; |
249 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>> | 254 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>> |
250 native_function_literals_; | 255 native_function_literals_; |
251 ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_; | 256 ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_; |
252 ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_; | 257 ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_; |
253 | 258 |
254 ControlScope* execution_control_; | 259 ControlScope* execution_control_; |
255 ContextScope* execution_context_; | 260 ContextScope* execution_context_; |
256 ExpressionResultScope* execution_result_; | 261 ExpressionResultScope* execution_result_; |
257 | 262 |
258 BytecodeJumpTable* generator_jump_table_; | 263 BytecodeJumpTable* generator_jump_table_; |
259 Register generator_state_; | 264 Register generator_state_; |
260 int loop_depth_; | 265 int loop_depth_; |
261 }; | 266 }; |
262 | 267 |
263 } // namespace interpreter | 268 } // namespace interpreter |
264 } // namespace internal | 269 } // namespace internal |
265 } // namespace v8 | 270 } // namespace v8 |
266 | 271 |
267 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 272 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
OLD | NEW |