deps: update v8 to 4.3.61.21
[platform/upstream/nodejs.git] / deps / v8 / src / compiler / typer.h
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
3 // found in the LICENSE file.
4
5 #ifndef V8_COMPILER_TYPER_H_
6 #define V8_COMPILER_TYPER_H_
7
8 #include "src/compiler/graph.h"
9 #include "src/types.h"
10
11 namespace v8 {
12 namespace internal {
13 namespace compiler {
14
15 // Forward declarations.
16 class LazyTypeCache;
17
18
19 class Typer {
20  public:
21   Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context);
22   ~Typer();
23
24   void Run();
25
26   Graph* graph() { return graph_; }
27   MaybeHandle<Context> context() { return context_; }
28   Zone* zone() { return graph_->zone(); }
29   Isolate* isolate() { return isolate_; }
30
31  private:
32   class Visitor;
33   class Decorator;
34
35   Isolate* isolate_;
36   Graph* graph_;
37   MaybeHandle<Context> context_;
38   Decorator* decorator_;
39
40   Zone* zone_;
41   Type* boolean_or_number;
42   Type* undefined_or_null;
43   Type* undefined_or_number;
44   Type* negative_signed32;
45   Type* non_negative_signed32;
46   Type* singleton_false;
47   Type* singleton_true;
48   Type* singleton_zero;
49   Type* singleton_one;
50   Type* zero_or_one;
51   Type* zeroish;
52   Type* signed32ish;
53   Type* unsigned32ish;
54   Type* falsish;
55   Type* truish;
56   Type* integer;
57   Type* weakint;
58   Type* number_fun0_;
59   Type* number_fun1_;
60   Type* number_fun2_;
61   Type* weakint_fun1_;
62   Type* random_fun_;
63   LazyTypeCache* cache_;
64
65   DISALLOW_COPY_AND_ASSIGN(Typer);
66 };
67
68 }  // namespace compiler
69 }  // namespace internal
70 }  // namespace v8
71
72 #endif  // V8_COMPILER_TYPER_H_