OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_OPERATOR_H_ | 5 #ifndef V8_COMPILER_COMMON_OPERATOR_H_ |
6 #define V8_COMPILER_COMMON_OPERATOR_H_ | 6 #define V8_COMPILER_COMMON_OPERATOR_H_ |
7 | 7 |
8 #include "src/compiler/machine-type.h" | 8 #include "src/compiler/machine-type.h" |
9 #include "src/unique.h" | 9 #include "src/unique.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Prediction hint for branches. | 26 // Prediction hint for branches. |
27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; | 27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; |
28 | 28 |
29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } | 29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
30 | 30 |
31 std::ostream& operator<<(std::ostream&, BranchHint); | 31 std::ostream& operator<<(std::ostream&, BranchHint); |
32 | 32 |
33 BranchHint BranchHintOf(const Operator* const); | 33 BranchHint BranchHintOf(const Operator* const); |
34 | 34 |
35 | 35 |
36 class SelectParameters FINAL { | 36 class SelectParameters final { |
37 public: | 37 public: |
38 explicit SelectParameters(MachineType type, | 38 explicit SelectParameters(MachineType type, |
39 BranchHint hint = BranchHint::kNone) | 39 BranchHint hint = BranchHint::kNone) |
40 : type_(type), hint_(hint) {} | 40 : type_(type), hint_(hint) {} |
41 | 41 |
42 MachineType type() const { return type_; } | 42 MachineType type() const { return type_; } |
43 BranchHint hint() const { return hint_; } | 43 BranchHint hint() const { return hint_; } |
44 | 44 |
45 private: | 45 private: |
46 const MachineType type_; | 46 const MachineType type_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 }; | 115 }; |
116 | 116 |
117 | 117 |
118 // The type of stack frame that a FrameState node represents. | 118 // The type of stack frame that a FrameState node represents. |
119 enum FrameStateType { | 119 enum FrameStateType { |
120 JS_FRAME, // Represents an unoptimized JavaScriptFrame. | 120 JS_FRAME, // Represents an unoptimized JavaScriptFrame. |
121 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. | 121 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. |
122 }; | 122 }; |
123 | 123 |
124 | 124 |
125 class FrameStateCallInfo FINAL { | 125 class FrameStateCallInfo final { |
126 public: | 126 public: |
127 FrameStateCallInfo( | 127 FrameStateCallInfo( |
128 FrameStateType type, BailoutId bailout_id, | 128 FrameStateType type, BailoutId bailout_id, |
129 OutputFrameStateCombine state_combine, | 129 OutputFrameStateCombine state_combine, |
130 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()) | 130 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()) |
131 : type_(type), | 131 : type_(type), |
132 bailout_id_(bailout_id), | 132 bailout_id_(bailout_id), |
133 frame_state_combine_(state_combine), | 133 frame_state_combine_(state_combine), |
134 jsfunction_(jsfunction) {} | 134 jsfunction_(jsfunction) {} |
135 | 135 |
(...skipping 15 matching lines...) Expand all Loading... |
151 size_t hash_value(FrameStateCallInfo const&); | 151 size_t hash_value(FrameStateCallInfo const&); |
152 | 152 |
153 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); | 153 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); |
154 | 154 |
155 | 155 |
156 size_t ProjectionIndexOf(const Operator* const); | 156 size_t ProjectionIndexOf(const Operator* const); |
157 | 157 |
158 | 158 |
159 // Interface for building common operators that can be used at any level of IR, | 159 // Interface for building common operators that can be used at any level of IR, |
160 // including JavaScript, mid-level, and low-level. | 160 // including JavaScript, mid-level, and low-level. |
161 class CommonOperatorBuilder FINAL : public ZoneObject { | 161 class CommonOperatorBuilder final : public ZoneObject { |
162 public: | 162 public: |
163 explicit CommonOperatorBuilder(Zone* zone); | 163 explicit CommonOperatorBuilder(Zone* zone); |
164 | 164 |
165 // Special operator used only in Branches to mark them as always taken, but | 165 // Special operator used only in Branches to mark them as always taken, but |
166 // still unfoldable. This is required to properly connect non terminating | 166 // still unfoldable. This is required to properly connect non terminating |
167 // loops to end (in both the sea of nodes and the CFG). | 167 // loops to end (in both the sea of nodes and the CFG). |
168 const Operator* Always(); | 168 const Operator* Always(); |
169 | 169 |
170 const Operator* Dead(); | 170 const Operator* Dead(); |
171 const Operator* End(); | 171 const Operator* End(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Zone* const zone_; | 224 Zone* const zone_; |
225 | 225 |
226 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 226 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
227 }; | 227 }; |
228 | 228 |
229 } // namespace compiler | 229 } // namespace compiler |
230 } // namespace internal | 230 } // namespace internal |
231 } // namespace v8 | 231 } // namespace v8 |
232 | 232 |
233 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 233 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |