OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_TYPER_H_ | 5 #ifndef V8_COMPILER_TYPER_H_ |
6 #define V8_COMPILER_TYPER_H_ | 6 #define V8_COMPILER_TYPER_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 #include "src/compiler/operation-typer.h" | 10 #include "src/compiler/operation-typer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class Typer { | 24 class Typer { |
25 public: | 25 public: |
26 // Flags that control the mode of operation. | 26 // Flags that control the mode of operation. |
27 enum Flag { | 27 enum Flag { |
28 kNoFlags = 0u, | 28 kNoFlags = 0u, |
29 kDeoptimizationEnabled = 1u << 0, | 29 kDeoptimizationEnabled = 1u << 0, |
30 }; | 30 }; |
31 typedef base::Flags<Flag> Flags; | 31 typedef base::Flags<Flag> Flags; |
32 | 32 |
33 Typer(Isolate* isolate, Graph* graph, Flags flags = kNoFlags, | 33 Typer(Isolate* isolate, Graph* graph, Flags flags = kNoFlags, |
34 CompilationDependencies* dependencies = nullptr, | 34 CompilationDependencies* dependencies = nullptr); |
35 FunctionType* function_type = nullptr); | |
36 ~Typer(); | 35 ~Typer(); |
37 | 36 |
38 void Run(); | 37 void Run(); |
39 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. | 38 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. |
40 void Run(const ZoneVector<Node*>& roots); | 39 void Run(const ZoneVector<Node*>& roots); |
41 | 40 |
42 private: | 41 private: |
43 class Visitor; | 42 class Visitor; |
44 class Decorator; | 43 class Decorator; |
45 | 44 |
46 Graph* graph() const { return graph_; } | 45 Graph* graph() const { return graph_; } |
47 Zone* zone() const { return graph()->zone(); } | 46 Zone* zone() const { return graph()->zone(); } |
48 Isolate* isolate() const { return isolate_; } | 47 Isolate* isolate() const { return isolate_; } |
49 Flags flags() const { return flags_; } | 48 Flags flags() const { return flags_; } |
50 CompilationDependencies* dependencies() const { return dependencies_; } | 49 CompilationDependencies* dependencies() const { return dependencies_; } |
51 FunctionType* function_type() const { return function_type_; } | |
52 OperationTyper* operation_typer() { return &operation_typer_; } | 50 OperationTyper* operation_typer() { return &operation_typer_; } |
53 | 51 |
54 Isolate* const isolate_; | 52 Isolate* const isolate_; |
55 Graph* const graph_; | 53 Graph* const graph_; |
56 Flags const flags_; | 54 Flags const flags_; |
57 CompilationDependencies* const dependencies_; | 55 CompilationDependencies* const dependencies_; |
58 FunctionType* function_type_; | |
59 Decorator* decorator_; | 56 Decorator* decorator_; |
60 TypeCache const& cache_; | 57 TypeCache const& cache_; |
61 OperationTyper operation_typer_; | 58 OperationTyper operation_typer_; |
62 | 59 |
63 Type* singleton_false_; | 60 Type* singleton_false_; |
64 Type* singleton_true_; | 61 Type* singleton_true_; |
65 Type* singleton_the_hole_; | 62 Type* singleton_the_hole_; |
66 Type* signed32ish_; | 63 Type* signed32ish_; |
67 Type* unsigned32ish_; | 64 Type* unsigned32ish_; |
68 Type* falsish_; | 65 Type* falsish_; |
69 Type* truish_; | 66 Type* truish_; |
70 | 67 |
71 DISALLOW_COPY_AND_ASSIGN(Typer); | 68 DISALLOW_COPY_AND_ASSIGN(Typer); |
72 }; | 69 }; |
73 | 70 |
74 DEFINE_OPERATORS_FOR_FLAGS(Typer::Flags) | 71 DEFINE_OPERATORS_FOR_FLAGS(Typer::Flags) |
75 | 72 |
76 } // namespace compiler | 73 } // namespace compiler |
77 } // namespace internal | 74 } // namespace internal |
78 } // namespace v8 | 75 } // namespace v8 |
79 | 76 |
80 #endif // V8_COMPILER_TYPER_H_ | 77 #endif // V8_COMPILER_TYPER_H_ |
OLD | NEW |