| 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(Float64RoundAwayFromZero, Operator::kNoProperties, 1, 1) \ |
| 116 V(Float64RoundToZero, 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( |
| 192 : impl_(kImpl.Get()), word_(word) { | 196 MachineType word, SupportedOperators supportedOperators) |
| 197 : impl_(kImpl.Get()), word_(word), supportedOperators_(supportedOperators) { |
| 193 DCHECK(word == kRepWord32 || word == kRepWord64); | 198 DCHECK(word == kRepWord32 || word == kRepWord64); |
| 194 } | 199 } |
| 195 | 200 |
| 196 | 201 |
| 197 #define PURE(Name, properties, input_count, output_count) \ | 202 #define PURE(Name, properties, input_count, output_count) \ |
| 198 const Operator* MachineOperatorBuilder::Name() { return &impl_.k##Name; } | 203 const Operator* MachineOperatorBuilder::Name() { return &impl_.k##Name; } |
| 199 PURE_OP_LIST(PURE) | 204 PURE_OP_LIST(PURE) |
| 200 #undef PURE | 205 #undef PURE |
| 201 | 206 |
| 202 | 207 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 229 break; | 234 break; |
| 230 MACHINE_TYPE_LIST(STORE) | 235 MACHINE_TYPE_LIST(STORE) |
| 231 #undef STORE | 236 #undef STORE |
| 232 | 237 |
| 233 default: | 238 default: |
| 234 break; | 239 break; |
| 235 } | 240 } |
| 236 UNREACHABLE(); | 241 UNREACHABLE(); |
| 237 return NULL; | 242 return NULL; |
| 238 } | 243 } |
| 239 | |
| 240 } // namespace compiler | 244 } // namespace compiler |
| 241 } // namespace internal | 245 } // namespace internal |
| 242 } // namespace v8 | 246 } // namespace v8 |
| OLD | NEW |