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_CALL_REDUCER_H_ | 5 #ifndef V8_COMPILER_JS_CALL_REDUCER_H_ |
6 #define V8_COMPILER_JS_CALL_REDUCER_H_ | 6 #define V8_COMPILER_JS_CALL_REDUCER_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 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 class CallFrequency; | 21 class CallFrequency; |
22 class CommonOperatorBuilder; | 22 class CommonOperatorBuilder; |
23 class JSGraph; | 23 class JSGraph; |
24 class JSOperatorBuilder; | 24 class JSOperatorBuilder; |
25 class SimplifiedOperatorBuilder; | 25 class SimplifiedOperatorBuilder; |
26 | 26 |
27 // Performs strength reduction on {JSConstruct} and {JSCall} nodes, | 27 // Performs strength reduction on {JSConstruct} and {JSCall} nodes, |
28 // which might allow inlining or other optimizations to be performed afterwards. | 28 // which might allow inlining or other optimizations to be performed afterwards. |
29 class JSCallReducer final : public AdvancedReducer { | 29 class JSCallReducer final : public AdvancedReducer { |
30 public: | 30 public: |
31 JSCallReducer(Editor* editor, JSGraph* jsgraph, | 31 // Flags that control the mode of operation. |
| 32 enum Flag { kNoFlags = 0u, kBailoutOnUninitialized = 1u << 0 }; |
| 33 typedef base::Flags<Flag> Flags; |
| 34 |
| 35 JSCallReducer(Editor* editor, JSGraph* jsgraph, Flags flags, |
32 Handle<Context> native_context, | 36 Handle<Context> native_context, |
33 CompilationDependencies* dependencies) | 37 CompilationDependencies* dependencies) |
34 : AdvancedReducer(editor), | 38 : AdvancedReducer(editor), |
35 jsgraph_(jsgraph), | 39 jsgraph_(jsgraph), |
| 40 flags_(flags), |
36 native_context_(native_context), | 41 native_context_(native_context), |
37 dependencies_(dependencies) {} | 42 dependencies_(dependencies) {} |
38 | 43 |
39 Reduction Reduce(Node* node) final; | 44 Reduction Reduce(Node* node) final; |
40 | 45 |
41 private: | 46 private: |
42 Reduction ReduceArrayConstructor(Node* node); | 47 Reduction ReduceArrayConstructor(Node* node); |
43 Reduction ReduceBooleanConstructor(Node* node); | 48 Reduction ReduceBooleanConstructor(Node* node); |
44 Reduction ReduceCallApiFunction( | 49 Reduction ReduceCallApiFunction( |
45 Node* node, Handle<FunctionTemplateInfo> function_template_info); | 50 Node* node, Handle<FunctionTemplateInfo> function_template_info); |
(...skipping 21 matching lines...) Expand all Loading... |
67 | 72 |
68 Graph* graph() const; | 73 Graph* graph() const; |
69 JSGraph* jsgraph() const { return jsgraph_; } | 74 JSGraph* jsgraph() const { return jsgraph_; } |
70 Isolate* isolate() const; | 75 Isolate* isolate() const; |
71 Factory* factory() const; | 76 Factory* factory() const; |
72 Handle<Context> native_context() const { return native_context_; } | 77 Handle<Context> native_context() const { return native_context_; } |
73 Handle<JSGlobalProxy> global_proxy() const; | 78 Handle<JSGlobalProxy> global_proxy() const; |
74 CommonOperatorBuilder* common() const; | 79 CommonOperatorBuilder* common() const; |
75 JSOperatorBuilder* javascript() const; | 80 JSOperatorBuilder* javascript() const; |
76 SimplifiedOperatorBuilder* simplified() const; | 81 SimplifiedOperatorBuilder* simplified() const; |
| 82 Flags flags() const { return flags_; } |
77 CompilationDependencies* dependencies() const { return dependencies_; } | 83 CompilationDependencies* dependencies() const { return dependencies_; } |
78 | 84 |
79 JSGraph* const jsgraph_; | 85 JSGraph* const jsgraph_; |
| 86 Flags const flags_; |
80 Handle<Context> const native_context_; | 87 Handle<Context> const native_context_; |
81 CompilationDependencies* const dependencies_; | 88 CompilationDependencies* const dependencies_; |
82 }; | 89 }; |
83 | 90 |
84 } // namespace compiler | 91 } // namespace compiler |
85 } // namespace internal | 92 } // namespace internal |
86 } // namespace v8 | 93 } // namespace v8 |
87 | 94 |
88 #endif // V8_COMPILER_JS_CALL_REDUCER_H_ | 95 #endif // V8_COMPILER_JS_CALL_REDUCER_H_ |
OLD | NEW |