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