Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: src/compiler/typer.h

Issue 2084943002: [turbofan] Reuse the operation typer's logic in the typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/flags.h" 8 #include "src/base/flags.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/types.h" 10 #include "src/types.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 // Forward declarations. 15 // Forward declarations.
16 class CompilationDependencies; 16 class CompilationDependencies;
17 class TypeCache; 17 class TypeCache;
18 18
19 namespace compiler { 19 namespace compiler {
20 20
21 class OperationTyper;
21 22
22 class Typer { 23 class Typer {
23 public: 24 public:
24 // Flags that control the mode of operation. 25 // Flags that control the mode of operation.
25 enum Flag { 26 enum Flag {
26 kNoFlags = 0u, 27 kNoFlags = 0u,
27 kDeoptimizationEnabled = 1u << 0, 28 kDeoptimizationEnabled = 1u << 0,
28 }; 29 };
29 typedef base::Flags<Flag> Flags; 30 typedef base::Flags<Flag> Flags;
30 31
31 Typer(Isolate* isolate, Graph* graph, Flags flags = kNoFlags, 32 Typer(Isolate* isolate, Graph* graph, Flags flags = kNoFlags,
32 CompilationDependencies* dependencies = nullptr, 33 CompilationDependencies* dependencies = nullptr,
33 FunctionType* function_type = nullptr); 34 FunctionType* function_type = nullptr);
34 ~Typer(); 35 ~Typer();
35 36
36 void Run(); 37 void Run();
37 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph. 38 // TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph.
38 void Run(const ZoneVector<Node*>& roots); 39 void Run(const ZoneVector<Node*>& roots);
39 40
40 private: 41 private:
41 class Visitor; 42 class Visitor;
42 class Decorator; 43 class Decorator;
43 44
44 Graph* graph() const { return graph_; } 45 Graph* graph() const { return graph_; }
45 Zone* zone() const { return graph()->zone(); } 46 Zone* zone() const { return graph()->zone(); }
46 Isolate* isolate() const { return isolate_; } 47 Isolate* isolate() const { return isolate_; }
47 Flags flags() const { return flags_; } 48 Flags flags() const { return flags_; }
48 CompilationDependencies* dependencies() const { return dependencies_; } 49 CompilationDependencies* dependencies() const { return dependencies_; }
49 FunctionType* function_type() const { return function_type_; } 50 FunctionType* function_type() const { return function_type_; }
51 OperationTyper* operation_typer() const { return operation_typer_; }
50 52
51 Isolate* const isolate_; 53 Isolate* const isolate_;
52 Graph* const graph_; 54 Graph* const graph_;
53 Flags const flags_; 55 Flags const flags_;
54 CompilationDependencies* const dependencies_; 56 CompilationDependencies* const dependencies_;
55 FunctionType* function_type_; 57 FunctionType* function_type_;
56 Decorator* decorator_; 58 Decorator* decorator_;
57 TypeCache const& cache_; 59 TypeCache const& cache_;
60 OperationTyper* operation_typer_;
58 61
59 Type* singleton_false_; 62 Type* singleton_false_;
60 Type* singleton_true_; 63 Type* singleton_true_;
61 Type* singleton_the_hole_; 64 Type* singleton_the_hole_;
62 Type* signed32ish_; 65 Type* signed32ish_;
63 Type* unsigned32ish_; 66 Type* unsigned32ish_;
64 Type* falsish_; 67 Type* falsish_;
65 Type* truish_; 68 Type* truish_;
66 69
67 DISALLOW_COPY_AND_ASSIGN(Typer); 70 DISALLOW_COPY_AND_ASSIGN(Typer);
68 }; 71 };
69 72
70 DEFINE_OPERATORS_FOR_FLAGS(Typer::Flags) 73 DEFINE_OPERATORS_FOR_FLAGS(Typer::Flags)
71 74
72 } // namespace compiler 75 } // namespace compiler
73 } // namespace internal 76 } // namespace internal
74 } // namespace v8 77 } // namespace v8
75 78
76 #endif // V8_COMPILER_TYPER_H_ 79 #endif // V8_COMPILER_TYPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698