OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
6 | 6 |
7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 1) \ | 103 V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 1) \ |
104 V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 1) \ | 104 V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 1) \ |
105 V(TruncateFloat64ToInt32, Operator::kNoProperties, 1, 1) \ | 105 V(TruncateFloat64ToInt32, Operator::kNoProperties, 1, 1) \ |
106 V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 1) \ | 106 V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 1) \ |
107 V(Float64Add, Operator::kCommutative, 2, 1) \ | 107 V(Float64Add, Operator::kCommutative, 2, 1) \ |
108 V(Float64Sub, Operator::kNoProperties, 2, 1) \ | 108 V(Float64Sub, Operator::kNoProperties, 2, 1) \ |
109 V(Float64Mul, Operator::kCommutative, 2, 1) \ | 109 V(Float64Mul, Operator::kCommutative, 2, 1) \ |
110 V(Float64Div, Operator::kNoProperties, 2, 1) \ | 110 V(Float64Div, Operator::kNoProperties, 2, 1) \ |
111 V(Float64Mod, Operator::kNoProperties, 2, 1) \ | 111 V(Float64Mod, Operator::kNoProperties, 2, 1) \ |
112 V(Float64Sqrt, Operator::kNoProperties, 1, 1) \ | 112 V(Float64Sqrt, Operator::kNoProperties, 1, 1) \ |
| 113 V(Float64Ceil, Operator::kNoProperties, 1, 1) \ |
| 114 V(Float64Floor, Operator::kNoProperties, 1, 1) \ |
| 115 V(Float64RoundTruncate, Operator::kNoProperties, 1, 1) \ |
| 116 V(Float64RoundTiesAway, Operator::kNoProperties, 1, 1) \ |
113 V(Float64Equal, Operator::kCommutative, 2, 1) \ | 117 V(Float64Equal, Operator::kCommutative, 2, 1) \ |
114 V(Float64LessThan, Operator::kNoProperties, 2, 1) \ | 118 V(Float64LessThan, Operator::kNoProperties, 2, 1) \ |
115 V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 1) \ | 119 V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 1) \ |
116 V(LoadStackPointer, Operator::kNoProperties, 0, 1) | 120 V(LoadStackPointer, Operator::kNoProperties, 0, 1) |
117 | 121 |
118 | 122 |
119 #define MACHINE_TYPE_LIST(V) \ | 123 #define MACHINE_TYPE_LIST(V) \ |
120 V(MachFloat32) \ | 124 V(MachFloat32) \ |
121 V(MachFloat64) \ | 125 V(MachFloat64) \ |
122 V(MachInt8) \ | 126 V(MachInt8) \ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 Store##Type##FullWriteBarrier##Operator k##Store##Type##FullWriteBarrier; | 185 Store##Type##FullWriteBarrier##Operator k##Store##Type##FullWriteBarrier; |
182 MACHINE_TYPE_LIST(STORE) | 186 MACHINE_TYPE_LIST(STORE) |
183 #undef STORE | 187 #undef STORE |
184 }; | 188 }; |
185 | 189 |
186 | 190 |
187 static base::LazyInstance<MachineOperatorBuilderImpl>::type kImpl = | 191 static base::LazyInstance<MachineOperatorBuilderImpl>::type kImpl = |
188 LAZY_INSTANCE_INITIALIZER; | 192 LAZY_INSTANCE_INITIALIZER; |
189 | 193 |
190 | 194 |
191 MachineOperatorBuilder::MachineOperatorBuilder(MachineType word) | 195 MachineOperatorBuilder::MachineOperatorBuilder(MachineType word, Flags flags) |
192 : impl_(kImpl.Get()), word_(word) { | 196 : impl_(kImpl.Get()), word_(word), flags_(flags) { |
193 DCHECK(word == kRepWord32 || word == kRepWord64); | 197 DCHECK(word == kRepWord32 || word == kRepWord64); |
194 } | 198 } |
195 | 199 |
196 | 200 |
197 #define PURE(Name, properties, input_count, output_count) \ | 201 #define PURE(Name, properties, input_count, output_count) \ |
198 const Operator* MachineOperatorBuilder::Name() { return &impl_.k##Name; } | 202 const Operator* MachineOperatorBuilder::Name() { return &impl_.k##Name; } |
199 PURE_OP_LIST(PURE) | 203 PURE_OP_LIST(PURE) |
200 #undef PURE | 204 #undef PURE |
201 | 205 |
202 | 206 |
(...skipping 26 matching lines...) Expand all Loading... |
229 break; | 233 break; |
230 MACHINE_TYPE_LIST(STORE) | 234 MACHINE_TYPE_LIST(STORE) |
231 #undef STORE | 235 #undef STORE |
232 | 236 |
233 default: | 237 default: |
234 break; | 238 break; |
235 } | 239 } |
236 UNREACHABLE(); | 240 UNREACHABLE(); |
237 return NULL; | 241 return NULL; |
238 } | 242 } |
239 | |
240 } // namespace compiler | 243 } // namespace compiler |
241 } // namespace internal | 244 } // namespace internal |
242 } // namespace v8 | 245 } // namespace v8 |
OLD | NEW |