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_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/compiler/bytecode-branch-analysis.h" | 8 #include "src/compiler/bytecode-branch-analysis.h" |
9 #include "src/compiler/bytecode-loop-analysis.h" | 9 #include "src/compiler/bytecode-loop-analysis.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
11 #include "src/compiler/liveness-analyzer.h" | 11 #include "src/compiler/liveness-analyzer.h" |
12 #include "src/compiler/state-values-utils.h" | 12 #include "src/compiler/state-values-utils.h" |
13 #include "src/compiler/type-hint-analyzer.h" | 13 #include "src/compiler/type-hint-analyzer.h" |
14 #include "src/interpreter/bytecode-array-iterator.h" | 14 #include "src/interpreter/bytecode-array-iterator.h" |
15 #include "src/interpreter/bytecode-flags.h" | 15 #include "src/interpreter/bytecode-flags.h" |
16 #include "src/interpreter/bytecodes.h" | 16 #include "src/interpreter/bytecodes.h" |
17 | 17 |
18 namespace v8 { | 18 namespace v8 { |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 class CompilationInfo; | 21 class CompilationInfo; |
22 | 22 |
23 namespace compiler { | 23 namespace compiler { |
24 | 24 |
25 // The BytecodeGraphBuilder produces a high-level IR graph based on | 25 // The BytecodeGraphBuilder produces a high-level IR graph based on |
26 // interpreter bytecodes. | 26 // interpreter bytecodes. |
27 class BytecodeGraphBuilder { | 27 class BytecodeGraphBuilder { |
28 public: | 28 public: |
29 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info, | 29 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info, |
30 JSGraph* jsgraph); | 30 JSGraph* jsgraph, float invocation_frequency); |
31 | 31 |
32 // Creates a graph by visiting bytecodes. | 32 // Creates a graph by visiting bytecodes. |
33 bool CreateGraph(); | 33 bool CreateGraph(); |
34 | 34 |
35 private: | 35 private: |
36 class Environment; | 36 class Environment; |
37 class FrameStateBeforeAndAfter; | 37 class FrameStateBeforeAndAfter; |
38 | 38 |
39 void VisitBytecodes(); | 39 void VisitBytecodes(); |
40 | 40 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 bool IsLivenessAnalysisEnabled() const { | 250 bool IsLivenessAnalysisEnabled() const { |
251 return this->is_liveness_analysis_enabled_; | 251 return this->is_liveness_analysis_enabled_; |
252 } | 252 } |
253 | 253 |
254 #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name(); | 254 #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name(); |
255 BYTECODE_LIST(DECLARE_VISIT_BYTECODE) | 255 BYTECODE_LIST(DECLARE_VISIT_BYTECODE) |
256 #undef DECLARE_VISIT_BYTECODE | 256 #undef DECLARE_VISIT_BYTECODE |
257 | 257 |
258 Zone* local_zone_; | 258 Zone* local_zone_; |
259 JSGraph* jsgraph_; | 259 JSGraph* jsgraph_; |
| 260 float const invocation_frequency_; |
260 Handle<BytecodeArray> bytecode_array_; | 261 Handle<BytecodeArray> bytecode_array_; |
261 Handle<HandlerTable> exception_handler_table_; | 262 Handle<HandlerTable> exception_handler_table_; |
262 Handle<TypeFeedbackVector> feedback_vector_; | 263 Handle<TypeFeedbackVector> feedback_vector_; |
263 const FrameStateFunctionInfo* frame_state_function_info_; | 264 const FrameStateFunctionInfo* frame_state_function_info_; |
264 const interpreter::BytecodeArrayIterator* bytecode_iterator_; | 265 const interpreter::BytecodeArrayIterator* bytecode_iterator_; |
265 const BytecodeBranchAnalysis* branch_analysis_; | 266 const BytecodeBranchAnalysis* branch_analysis_; |
266 const BytecodeLoopAnalysis* loop_analysis_; | 267 const BytecodeLoopAnalysis* loop_analysis_; |
267 Environment* environment_; | 268 Environment* environment_; |
268 BailoutId osr_ast_id_; | 269 BailoutId osr_ast_id_; |
269 | 270 |
(...skipping 30 matching lines...) Expand all Loading... |
300 static int const kBinaryOperationSmiHintIndex = 2; | 301 static int const kBinaryOperationSmiHintIndex = 2; |
301 | 302 |
302 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 303 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
303 }; | 304 }; |
304 | 305 |
305 } // namespace compiler | 306 } // namespace compiler |
306 } // namespace internal | 307 } // namespace internal |
307 } // namespace v8 | 308 } // namespace v8 |
308 | 309 |
309 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 310 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |