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_NATIVE_CONTEXT_SPECIALIZATION_H_ | 5 #ifndef V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
6 #define V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 6 #define V8_COMPILER_JS_NATIVE_CONTEXT_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/property-access-info.h" | 10 #include "src/compiler/property-access-info.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class JSNativeContextSpecialization final : public AdvancedReducer { | 36 class JSNativeContextSpecialization final : public AdvancedReducer { |
37 public: | 37 public: |
38 // Flags that control the mode of operation. | 38 // Flags that control the mode of operation. |
39 enum Flag { | 39 enum Flag { |
40 kNoFlags = 0u, | 40 kNoFlags = 0u, |
41 kDeoptimizationEnabled = 1u << 0, | 41 kDeoptimizationEnabled = 1u << 0, |
42 }; | 42 }; |
43 typedef base::Flags<Flag> Flags; | 43 typedef base::Flags<Flag> Flags; |
44 | 44 |
45 JSNativeContextSpecialization(Editor* editor, JSGraph* jsgraph, Flags flags, | 45 JSNativeContextSpecialization(Editor* editor, JSGraph* jsgraph, Flags flags, |
46 Handle<GlobalObject> global_object, | 46 Handle<JSGlobalObject> global_object, |
47 CompilationDependencies* dependencies, | 47 CompilationDependencies* dependencies, |
48 Zone* zone); | 48 Zone* zone); |
49 | 49 |
50 Reduction Reduce(Node* node) final; | 50 Reduction Reduce(Node* node) final; |
51 | 51 |
52 private: | 52 private: |
53 Reduction ReduceJSCallFunction(Node* node); | 53 Reduction ReduceJSCallFunction(Node* node); |
54 Reduction ReduceJSLoadGlobal(Node* node); | 54 Reduction ReduceJSLoadGlobal(Node* node); |
55 Reduction ReduceJSStoreGlobal(Node* node); | 55 Reduction ReduceJSStoreGlobal(Node* node); |
56 Reduction ReduceJSLoadNamed(Node* node); | 56 Reduction ReduceJSLoadNamed(Node* node); |
(...skipping 28 matching lines...) Expand all Loading... |
85 | 85 |
86 Graph* graph() const; | 86 Graph* graph() const; |
87 JSGraph* jsgraph() const { return jsgraph_; } | 87 JSGraph* jsgraph() const { return jsgraph_; } |
88 Isolate* isolate() const; | 88 Isolate* isolate() const; |
89 Factory* factory() const; | 89 Factory* factory() const; |
90 CommonOperatorBuilder* common() const; | 90 CommonOperatorBuilder* common() const; |
91 JSOperatorBuilder* javascript() const; | 91 JSOperatorBuilder* javascript() const; |
92 SimplifiedOperatorBuilder* simplified() const; | 92 SimplifiedOperatorBuilder* simplified() const; |
93 MachineOperatorBuilder* machine() const; | 93 MachineOperatorBuilder* machine() const; |
94 Flags flags() const { return flags_; } | 94 Flags flags() const { return flags_; } |
95 Handle<GlobalObject> global_object() const { return global_object_; } | 95 Handle<JSGlobalObject> global_object() const { return global_object_; } |
96 Handle<Context> native_context() const { return native_context_; } | 96 Handle<Context> native_context() const { return native_context_; } |
97 CompilationDependencies* dependencies() const { return dependencies_; } | 97 CompilationDependencies* dependencies() const { return dependencies_; } |
98 Zone* zone() const { return zone_; } | 98 Zone* zone() const { return zone_; } |
99 PropertyAccessInfoFactory& access_info_factory() { | 99 PropertyAccessInfoFactory& access_info_factory() { |
100 return access_info_factory_; | 100 return access_info_factory_; |
101 } | 101 } |
102 | 102 |
103 JSGraph* const jsgraph_; | 103 JSGraph* const jsgraph_; |
104 Flags const flags_; | 104 Flags const flags_; |
105 Handle<GlobalObject> global_object_; | 105 Handle<JSGlobalObject> global_object_; |
106 Handle<Context> native_context_; | 106 Handle<Context> native_context_; |
107 CompilationDependencies* const dependencies_; | 107 CompilationDependencies* const dependencies_; |
108 Zone* const zone_; | 108 Zone* const zone_; |
109 TypeCache const& type_cache_; | 109 TypeCache const& type_cache_; |
110 PropertyAccessInfoFactory access_info_factory_; | 110 PropertyAccessInfoFactory access_info_factory_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); | 112 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); |
113 }; | 113 }; |
114 | 114 |
115 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) | 115 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) |
116 | 116 |
117 } // namespace compiler | 117 } // namespace compiler |
118 } // namespace internal | 118 } // namespace internal |
119 } // namespace v8 | 119 } // namespace v8 |
120 | 120 |
121 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 121 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
OLD | NEW |