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/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/machine-type.h" | 10 #include "src/compiler/machine-type.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Operator* Loop(int controls) { | 107 Operator* Loop(int controls) { |
108 return new (zone_) ControlOperator(IrOpcode::kLoop, Operator::kFoldable, 0, | 108 return new (zone_) ControlOperator(IrOpcode::kLoop, Operator::kFoldable, 0, |
109 0, controls, "Loop"); | 109 0, controls, "Loop"); |
110 } | 110 } |
111 | 111 |
112 Operator* Parameter(int index) { | 112 Operator* Parameter(int index) { |
113 return new (zone_) Operator1<int>(IrOpcode::kParameter, Operator::kPure, 1, | 113 return new (zone_) Operator1<int>(IrOpcode::kParameter, Operator::kPure, 1, |
114 1, "Parameter", index); | 114 1, "Parameter", index); |
115 } | 115 } |
116 Operator* Int32Constant(int32_t value) { | 116 Operator* Int32Constant(int32_t value) { |
117 return new (zone_) Operator1<int>(IrOpcode::kInt32Constant, Operator::kPure, | 117 return new (zone_) |
118 0, 1, "Int32Constant", value); | 118 Operator1<int32_t>(IrOpcode::kInt32Constant, Operator::kPure, 0, 1, |
| 119 "Int32Constant", value); |
119 } | 120 } |
120 Operator* Int64Constant(int64_t value) { | 121 Operator* Int64Constant(int64_t value) { |
121 return new (zone_) | 122 return new (zone_) |
122 Operator1<int64_t>(IrOpcode::kInt64Constant, Operator::kPure, 0, 1, | 123 Operator1<int64_t>(IrOpcode::kInt64Constant, Operator::kPure, 0, 1, |
123 "Int64Constant", value); | 124 "Int64Constant", value); |
124 } | 125 } |
125 Operator* Float64Constant(double value) { | 126 Operator* Float64Constant(double value) { |
126 return new (zone_) | 127 return new (zone_) |
127 Operator1<double>(IrOpcode::kFloat64Constant, Operator::kPure, 0, 1, | 128 Operator1<double>(IrOpcode::kFloat64Constant, Operator::kPure, 0, 1, |
128 "Float64Constant", value); | 129 "Float64Constant", value); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 arguments, 1, "StateValues", arguments); | 171 arguments, 1, "StateValues", arguments); |
171 } | 172 } |
172 Operator* FrameState(BailoutId bailout_id, OutputFrameStateCombine combine) { | 173 Operator* FrameState(BailoutId bailout_id, OutputFrameStateCombine combine) { |
173 return new (zone_) Operator1<FrameStateCallInfo>( | 174 return new (zone_) Operator1<FrameStateCallInfo>( |
174 IrOpcode::kFrameState, Operator::kPure, 4, 1, "FrameState", | 175 IrOpcode::kFrameState, Operator::kPure, 4, 1, "FrameState", |
175 FrameStateCallInfo(bailout_id, combine)); | 176 FrameStateCallInfo(bailout_id, combine)); |
176 } | 177 } |
177 Operator* Call(CallDescriptor* descriptor) { | 178 Operator* Call(CallDescriptor* descriptor) { |
178 return new (zone_) CallOperator(descriptor, "Call"); | 179 return new (zone_) CallOperator(descriptor, "Call"); |
179 } | 180 } |
180 Operator* Projection(int index) { | 181 Operator* Projection(size_t index) { |
181 return new (zone_) Operator1<int>(IrOpcode::kProjection, Operator::kPure, 1, | 182 return new (zone_) Operator1<size_t>(IrOpcode::kProjection, Operator::kPure, |
182 1, "Projection", index); | 183 1, 1, "Projection", index); |
183 } | 184 } |
184 | 185 |
185 private: | 186 private: |
186 Zone* zone_; | 187 Zone* zone_; |
187 }; | 188 }; |
188 | 189 |
189 | 190 |
190 template <typename T> | 191 template <typename T> |
191 struct CommonOperatorTraits { | 192 struct CommonOperatorTraits { |
192 static inline bool Equals(T a, T b); | 193 static inline bool Equals(T a, T b); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 template <typename T> | 313 template <typename T> |
313 inline T ValueOf(const Operator* op) { | 314 inline T ValueOf(const Operator* op) { |
314 return CommonOperatorTraits<T>::ValueOf(op); | 315 return CommonOperatorTraits<T>::ValueOf(op); |
315 } | 316 } |
316 | 317 |
317 } // namespace compiler | 318 } // namespace compiler |
318 } // namespace internal | 319 } // namespace internal |
319 } // namespace v8 | 320 } // namespace v8 |
320 | 321 |
321 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 322 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |