Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / 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/v8.h"
9
10 #include "src/compiler/graph.h"
11 #include "src/compiler/opcodes.h"
12 #include "src/types.h"
13
14 namespace v8 {
15 namespace internal {
16 namespace compiler {
17
18 class Typer {
19  public:
20   explicit Typer(Graph* graph, MaybeHandle<Context> context);
21   ~Typer();
22
23   void Run();
24
25   Graph* graph() { return graph_; }
26   MaybeHandle<Context> context() { return context_; }
27   Zone* zone() { return graph_->zone(); }
28   Isolate* isolate() { return zone()->isolate(); }
29
30  private:
31   class Visitor;
32   class RunVisitor;
33   class WidenVisitor;
34   class Decorator;
35
36   Graph* graph_;
37   MaybeHandle<Context> context_;
38   Decorator* decorator_;
39
40   Zone* zone_;
41   Type* negative_signed32;
42   Type* non_negative_signed32;
43   Type* undefined_or_null;
44   Type* singleton_false;
45   Type* singleton_true;
46   Type* singleton_zero;
47   Type* singleton_one;
48   Type* zero_or_one;
49   Type* zeroish;
50   Type* falsish;
51   Type* integer;
52   Type* weakint;
53   Type* number_fun0_;
54   Type* number_fun1_;
55   Type* number_fun2_;
56   Type* weakint_fun1_;
57   Type* imul_fun_;
58   Type* clz32_fun_;
59   Type* random_fun_;
60   Type* array_buffer_fun_;
61   Type* int8_array_fun_;
62   Type* int16_array_fun_;
63   Type* int32_array_fun_;
64   Type* uint8_array_fun_;
65   Type* uint16_array_fun_;
66   Type* uint32_array_fun_;
67   Type* float32_array_fun_;
68   Type* float64_array_fun_;
69
70   ZoneVector<Handle<Object> > weaken_min_limits_;
71   ZoneVector<Handle<Object> > weaken_max_limits_;
72   DISALLOW_COPY_AND_ASSIGN(Typer);
73 };
74 }
75 }
76 }  // namespace v8::internal::compiler
77
78 #endif  // V8_COMPILER_TYPER_H_