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