OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef V8_COMPILER_JS_TYPE_FEEDBACK_LOWERING_H_ | |
6 #define V8_COMPILER_JS_TYPE_FEEDBACK_LOWERING_H_ | |
7 | |
8 #include "src/base/flags.h" | |
9 #include "src/compiler/graph-reducer.h" | |
10 | |
11 namespace v8 { | |
12 namespace internal { | |
13 | |
14 // Forward declarations. | |
15 class Factory; | |
16 | |
17 namespace compiler { | |
18 | |
19 // Forward declarations. | |
20 class CommonOperatorBuilder; | |
21 class JSGraph; | |
22 class MachineOperatorBuilder; | |
23 class SimplifiedOperatorBuilder; | |
24 | |
25 | |
26 // Lowers JS-level operators to simplified operators based on type feedback. | |
27 class JSTypeFeedbackLowering final : public AdvancedReducer { | |
28 public: | |
29 // Various configuration flags to control the operation of this lowering. | |
30 enum Flag { | |
31 kNoFlags = 0, | |
32 kDeoptimizationEnabled = 1 << 0, | |
33 }; | |
34 typedef base::Flags<Flag> Flags; | |
35 | |
36 JSTypeFeedbackLowering(Editor* editor, Flags flags, JSGraph* jsgraph); | |
37 ~JSTypeFeedbackLowering() final {} | |
38 | |
39 Reduction Reduce(Node* node) final; | |
40 | |
41 private: | |
42 Reduction ReduceJSLoadNamed(Node* node); | |
43 | |
44 Factory* factory() const; | |
45 Flags flags() const { return flags_; } | |
46 Graph* graph() const; | |
47 Isolate* isolate() const; | |
48 JSGraph* jsgraph() const { return jsgraph_; } | |
49 CommonOperatorBuilder* common() const; | |
50 MachineOperatorBuilder* machine() const; | |
51 SimplifiedOperatorBuilder* simplified() const; | |
52 | |
53 Flags const flags_; | |
54 JSGraph* const jsgraph_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(JSTypeFeedbackLowering); | |
57 }; | |
58 | |
59 DEFINE_OPERATORS_FOR_FLAGS(JSTypeFeedbackLowering::Flags) | |
60 | |
61 } // namespace compiler | |
62 } // namespace internal | |
63 } // namespace v8 | |
64 | |
65 #endif // V8_COMPILER_JS_TYPE_FEEDBACK_LOWERING_H_ | |
OLD | NEW |