OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_JS_GLOBAL_SPECIALIZATION_H_ | 5 #ifndef V8_COMPILER_JS_GLOBAL_SPECIALIZATION_H_ |
6 #define V8_COMPILER_JS_GLOBAL_SPECIALIZATION_H_ | 6 #define V8_COMPILER_JS_GLOBAL_SPECIALIZATION_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.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 | 17 |
18 | 18 |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 // Forward declarations. | 21 // Forward declarations. |
| 22 class CommonOperatorBuilder; |
22 class JSGraph; | 23 class JSGraph; |
23 class JSOperatorBuilder; | 24 class JSOperatorBuilder; |
24 | 25 |
25 | 26 |
26 // Specializes a given JSGraph to a given GlobalObject, potentially constant | 27 // Specializes a given JSGraph to a given GlobalObject, potentially constant |
27 // folding some {LoadGlobal} nodes or strength reducing some {StoreGlobal} | 28 // folding some {LoadGlobal} nodes or strength reducing some {StoreGlobal} |
28 // nodes. | 29 // nodes. |
29 class JSGlobalSpecialization final : public AdvancedReducer { | 30 class JSGlobalSpecialization final : public AdvancedReducer { |
30 public: | 31 public: |
31 // Flags that control the mode of operation. | 32 // Flags that control the mode of operation. |
(...skipping 21 matching lines...) Expand all Loading... |
53 Reduction Replace(Node* node, Node* value, Node* effect = nullptr, | 54 Reduction Replace(Node* node, Node* value, Node* effect = nullptr, |
54 Node* control = nullptr) { | 55 Node* control = nullptr) { |
55 ReplaceWithValue(node, value, effect, control); | 56 ReplaceWithValue(node, value, effect, control); |
56 return Changed(value); | 57 return Changed(value); |
57 } | 58 } |
58 Reduction Replace(Node* node, Handle<Object> value); | 59 Reduction Replace(Node* node, Handle<Object> value); |
59 | 60 |
60 Graph* graph() const; | 61 Graph* graph() const; |
61 JSGraph* jsgraph() const { return jsgraph_; } | 62 JSGraph* jsgraph() const { return jsgraph_; } |
62 Isolate* isolate() const; | 63 Isolate* isolate() const; |
| 64 CommonOperatorBuilder* common() const; |
63 JSOperatorBuilder* javascript() const; | 65 JSOperatorBuilder* javascript() const; |
64 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 66 SimplifiedOperatorBuilder* simplified() { return &simplified_; } |
65 Flags flags() const { return flags_; } | 67 Flags flags() const { return flags_; } |
66 Handle<GlobalObject> global_object() const { return global_object_; } | 68 Handle<GlobalObject> global_object() const { return global_object_; } |
67 CompilationDependencies* dependencies() const { return dependencies_; } | 69 CompilationDependencies* dependencies() const { return dependencies_; } |
68 | 70 |
69 JSGraph* const jsgraph_; | 71 JSGraph* const jsgraph_; |
70 Flags const flags_; | 72 Flags const flags_; |
71 Handle<GlobalObject> global_object_; | 73 Handle<GlobalObject> global_object_; |
72 CompilationDependencies* const dependencies_; | 74 CompilationDependencies* const dependencies_; |
73 SimplifiedOperatorBuilder simplified_; | 75 SimplifiedOperatorBuilder simplified_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(JSGlobalSpecialization); | 77 DISALLOW_COPY_AND_ASSIGN(JSGlobalSpecialization); |
76 }; | 78 }; |
77 | 79 |
78 DEFINE_OPERATORS_FOR_FLAGS(JSGlobalSpecialization::Flags) | 80 DEFINE_OPERATORS_FOR_FLAGS(JSGlobalSpecialization::Flags) |
79 | 81 |
80 } // namespace compiler | 82 } // namespace compiler |
81 } // namespace internal | 83 } // namespace internal |
82 } // namespace v8 | 84 } // namespace v8 |
83 | 85 |
84 #endif // V8_COMPILER_JS_GLOBAL_SPECIALIZATION_H_ | 86 #endif // V8_COMPILER_JS_GLOBAL_SPECIALIZATION_H_ |
OLD | NEW |