| 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 LazyTypeCache; |
| 17 | 17 |
| 18 | 18 |
| 19 class Typer { | 19 class Typer { |
| 20 public: | 20 public: |
| 21 Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context); | 21 Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context); |
| 22 ~Typer(); | 22 ~Typer(); |
| 23 | 23 |
| 24 void Run(); | 24 void Run(); |
| 25 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. | 25 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. |
| 26 void Run(const ZoneVector<Node*>& roots); | 26 void Run(const ZoneVector<Node*>& roots); |
| 27 | 27 |
| 28 Graph* graph() { return graph_; } | |
| 29 MaybeHandle<Context> context() { return context_; } | |
| 30 Zone* zone() { return graph_->zone(); } | |
| 31 Isolate* isolate() { return isolate_; } | |
| 32 | |
| 33 private: | 28 private: |
| 34 class Visitor; | 29 class Visitor; |
| 35 class Decorator; | 30 class Decorator; |
| 36 | 31 |
| 37 Isolate* isolate_; | 32 Graph* graph() const { return graph_; } |
| 38 Graph* graph_; | 33 MaybeHandle<Context> context() const { return context_; } |
| 39 MaybeHandle<Context> context_; | 34 Zone* zone() const { return graph()->zone(); } |
| 35 Isolate* isolate() const { return isolate_; } |
| 36 |
| 37 Isolate* const isolate_; |
| 38 Graph* const graph_; |
| 39 MaybeHandle<Context> const context_; |
| 40 Decorator* decorator_; | 40 Decorator* decorator_; |
| 41 | 41 |
| 42 Zone* zone_; | 42 Type* singleton_false_; |
| 43 Type* boolean_or_number; | 43 Type* singleton_true_; |
| 44 Type* undefined_or_null; | 44 Type* singleton_zero_; |
| 45 Type* undefined_or_number; | 45 Type* singleton_one_; |
| 46 Type* negative_signed32; | 46 Type* zero_or_one_; |
| 47 Type* non_negative_signed32; | 47 Type* zeroish_; |
| 48 Type* singleton_false; | 48 Type* signed32ish_; |
| 49 Type* singleton_true; | 49 Type* unsigned32ish_; |
| 50 Type* singleton_zero; | 50 Type* falsish_; |
| 51 Type* singleton_one; | 51 Type* truish_; |
| 52 Type* zero_or_one; | 52 LazyTypeCache* const cache_; |
| 53 Type* zeroish; | |
| 54 Type* signed32ish; | |
| 55 Type* unsigned32ish; | |
| 56 Type* falsish; | |
| 57 Type* truish; | |
| 58 Type* integer; | |
| 59 Type* weakint; | |
| 60 Type* number_fun0_; | |
| 61 Type* number_fun1_; | |
| 62 Type* number_fun2_; | |
| 63 Type* weakint_fun1_; | |
| 64 Type* random_fun_; | |
| 65 LazyTypeCache* cache_; | |
| 66 | 53 |
| 67 DISALLOW_COPY_AND_ASSIGN(Typer); | 54 DISALLOW_COPY_AND_ASSIGN(Typer); |
| 68 }; | 55 }; |
| 69 | 56 |
| 70 } // namespace compiler | 57 } // namespace compiler |
| 71 } // namespace internal | 58 } // namespace internal |
| 72 } // namespace v8 | 59 } // namespace v8 |
| 73 | 60 |
| 74 #endif // V8_COMPILER_TYPER_H_ | 61 #endif // V8_COMPILER_TYPER_H_ |
| OLD | NEW |