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/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
11 #include "src/compiler/opcodes.h" | 11 #include "src/compiler/opcodes.h" |
12 #include "src/types.h" | 12 #include "src/types.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 namespace compiler { | 16 namespace compiler { |
17 | 17 |
18 class Typer { | 18 class Typer { |
19 public: | 19 public: |
20 explicit Typer(Zone* zone); | 20 explicit Typer(Graph* graph, MaybeHandle<Context> context); |
| 21 ~Typer(); |
21 | 22 |
22 void Init(Node* node); | 23 void Run(); |
23 void Run(Graph* graph, MaybeHandle<Context> context); | 24 void Narrow(Node* node); |
24 void Narrow(Graph* graph, Node* node, MaybeHandle<Context> context); | |
25 void Widen(Graph* graph, Node* node, MaybeHandle<Context> context); | |
26 | 25 |
27 void DecorateGraph(Graph* graph); | 26 Graph* graph() { return graph_; } |
28 | 27 MaybeHandle<Context> context() { return context_; } |
29 Zone* zone() { return zone_; } | 28 Zone* zone() { return graph_->zone(); } |
30 Isolate* isolate() { return zone_->isolate(); } | 29 Isolate* isolate() { return zone()->isolate(); } |
31 | 30 |
32 private: | 31 private: |
33 class Visitor; | 32 class Visitor; |
34 class RunVisitor; | 33 class RunVisitor; |
35 class NarrowVisitor; | 34 class NarrowVisitor; |
36 class WidenVisitor; | 35 class WidenVisitor; |
| 36 class Decorator; |
37 | 37 |
38 Zone* zone_; | 38 Graph* graph_; |
| 39 MaybeHandle<Context> context_; |
| 40 Decorator* decorator_; |
| 41 |
39 Type* number_fun0_; | 42 Type* number_fun0_; |
40 Type* number_fun1_; | 43 Type* number_fun1_; |
41 Type* number_fun2_; | 44 Type* number_fun2_; |
42 Type* imul_fun_; | 45 Type* imul_fun_; |
43 Type* array_buffer_fun_; | 46 Type* array_buffer_fun_; |
44 Type* int8_array_fun_; | 47 Type* int8_array_fun_; |
45 Type* int16_array_fun_; | 48 Type* int16_array_fun_; |
46 Type* int32_array_fun_; | 49 Type* int32_array_fun_; |
47 Type* uint8_array_fun_; | 50 Type* uint8_array_fun_; |
48 Type* uint16_array_fun_; | 51 Type* uint16_array_fun_; |
49 Type* uint32_array_fun_; | 52 Type* uint32_array_fun_; |
50 Type* float32_array_fun_; | 53 Type* float32_array_fun_; |
51 Type* float64_array_fun_; | 54 Type* float64_array_fun_; |
52 }; | 55 }; |
53 } | 56 } |
54 } | 57 } |
55 } // namespace v8::internal::compiler | 58 } // namespace v8::internal::compiler |
56 | 59 |
57 #endif // V8_COMPILER_TYPER_H_ | 60 #endif // V8_COMPILER_TYPER_H_ |
OLD | NEW |