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/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | |
14 | 13 |
15 // Forward declarations. | 14 // Forward declarations. |
16 class TyperCache; | 15 class ZoneTypeCache; |
| 16 |
| 17 namespace compiler { |
17 | 18 |
18 | 19 |
19 class Typer { | 20 class Typer { |
20 public: | 21 public: |
21 Typer(Isolate* isolate, Graph* graph, | 22 Typer(Isolate* isolate, Graph* graph, |
22 Type::FunctionType* function_type = nullptr); | 23 Type::FunctionType* function_type = nullptr); |
23 ~Typer(); | 24 ~Typer(); |
24 | 25 |
25 void Run(); | 26 void Run(); |
26 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. | 27 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. |
27 void Run(const ZoneVector<Node*>& roots); | 28 void Run(const ZoneVector<Node*>& roots); |
28 | 29 |
29 private: | 30 private: |
30 class Visitor; | 31 class Visitor; |
31 class Decorator; | 32 class Decorator; |
32 | 33 |
33 Graph* graph() const { return graph_; } | 34 Graph* graph() const { return graph_; } |
34 Zone* zone() const { return graph()->zone(); } | 35 Zone* zone() const { return graph()->zone(); } |
35 Isolate* isolate() const { return isolate_; } | 36 Isolate* isolate() const { return isolate_; } |
36 Type::FunctionType* function_type() const { return function_type_; } | 37 Type::FunctionType* function_type() const { return function_type_; } |
37 | 38 |
38 Isolate* const isolate_; | 39 Isolate* const isolate_; |
39 Graph* const graph_; | 40 Graph* const graph_; |
40 Type::FunctionType* function_type_; | 41 Type::FunctionType* function_type_; |
41 Decorator* decorator_; | 42 Decorator* decorator_; |
42 TyperCache const& cache_; | 43 ZoneTypeCache const& cache_; |
43 | 44 |
44 Type* singleton_false_; | 45 Type* singleton_false_; |
45 Type* singleton_true_; | 46 Type* singleton_true_; |
46 Type* signed32ish_; | 47 Type* signed32ish_; |
47 Type* unsigned32ish_; | 48 Type* unsigned32ish_; |
48 Type* falsish_; | 49 Type* falsish_; |
49 Type* truish_; | 50 Type* truish_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(Typer); | 52 DISALLOW_COPY_AND_ASSIGN(Typer); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace compiler | 55 } // namespace compiler |
55 } // namespace internal | 56 } // namespace internal |
56 } // namespace v8 | 57 } // namespace v8 |
57 | 58 |
58 #endif // V8_COMPILER_TYPER_H_ | 59 #endif // V8_COMPILER_TYPER_H_ |
OLD | NEW |