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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 V(RepWord32) \ | 169 V(RepWord32) \ |
170 V(RepWord64) \ | 170 V(RepWord64) \ |
171 V(RepFloat32) \ | 171 V(RepFloat32) \ |
172 V(RepFloat64) \ | 172 V(RepFloat64) \ |
173 V(RepTagged) | 173 V(RepTagged) |
174 | 174 |
175 | 175 |
176 struct MachineOperatorGlobalCache { | 176 struct MachineOperatorGlobalCache { |
177 #define PURE(Name, properties, value_input_count, control_input_count, \ | 177 #define PURE(Name, properties, value_input_count, control_input_count, \ |
178 output_count) \ | 178 output_count) \ |
179 struct Name##Operator FINAL : public Operator { \ | 179 struct Name##Operator final : public Operator { \ |
180 Name##Operator() \ | 180 Name##Operator() \ |
181 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ | 181 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ |
182 value_input_count, 0, control_input_count, output_count, 0, \ | 182 value_input_count, 0, control_input_count, output_count, 0, \ |
183 0) {} \ | 183 0) {} \ |
184 }; \ | 184 }; \ |
185 Name##Operator k##Name; | 185 Name##Operator k##Name; |
186 PURE_OP_LIST(PURE) | 186 PURE_OP_LIST(PURE) |
187 #undef PURE | 187 #undef PURE |
188 | 188 |
189 #define LOAD(Type) \ | 189 #define LOAD(Type) \ |
190 struct Load##Type##Operator FINAL : public Operator1<LoadRepresentation> { \ | 190 struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \ |
191 Load##Type##Operator() \ | 191 Load##Type##Operator() \ |
192 : Operator1<LoadRepresentation>( \ | 192 : Operator1<LoadRepresentation>( \ |
193 IrOpcode::kLoad, Operator::kNoThrow | Operator::kNoWrite, \ | 193 IrOpcode::kLoad, Operator::kNoThrow | Operator::kNoWrite, \ |
194 "Load", 2, 1, 1, 1, 1, 0, k##Type) {} \ | 194 "Load", 2, 1, 1, 1, 1, 0, k##Type) {} \ |
195 }; \ | 195 }; \ |
196 struct CheckedLoad##Type##Operator FINAL \ | 196 struct CheckedLoad##Type##Operator final \ |
197 : public Operator1<CheckedLoadRepresentation> { \ | 197 : public Operator1<CheckedLoadRepresentation> { \ |
198 CheckedLoad##Type##Operator() \ | 198 CheckedLoad##Type##Operator() \ |
199 : Operator1<CheckedLoadRepresentation>( \ | 199 : Operator1<CheckedLoadRepresentation>( \ |
200 IrOpcode::kCheckedLoad, Operator::kNoThrow | Operator::kNoWrite, \ | 200 IrOpcode::kCheckedLoad, Operator::kNoThrow | Operator::kNoWrite, \ |
201 "CheckedLoad", 3, 1, 1, 1, 1, 0, k##Type) {} \ | 201 "CheckedLoad", 3, 1, 1, 1, 1, 0, k##Type) {} \ |
202 }; \ | 202 }; \ |
203 Load##Type##Operator kLoad##Type; \ | 203 Load##Type##Operator kLoad##Type; \ |
204 CheckedLoad##Type##Operator kCheckedLoad##Type; | 204 CheckedLoad##Type##Operator kCheckedLoad##Type; |
205 MACHINE_TYPE_LIST(LOAD) | 205 MACHINE_TYPE_LIST(LOAD) |
206 #undef LOAD | 206 #undef LOAD |
207 | 207 |
208 #define STORE(Type) \ | 208 #define STORE(Type) \ |
209 struct Store##Type##Operator : public Operator1<StoreRepresentation> { \ | 209 struct Store##Type##Operator : public Operator1<StoreRepresentation> { \ |
210 explicit Store##Type##Operator(WriteBarrierKind write_barrier_kind) \ | 210 explicit Store##Type##Operator(WriteBarrierKind write_barrier_kind) \ |
211 : Operator1<StoreRepresentation>( \ | 211 : Operator1<StoreRepresentation>( \ |
212 IrOpcode::kStore, Operator::kNoRead | Operator::kNoThrow, \ | 212 IrOpcode::kStore, Operator::kNoRead | Operator::kNoThrow, \ |
213 "Store", 3, 1, 1, 0, 1, 0, \ | 213 "Store", 3, 1, 1, 0, 1, 0, \ |
214 StoreRepresentation(k##Type, write_barrier_kind)) {} \ | 214 StoreRepresentation(k##Type, write_barrier_kind)) {} \ |
215 }; \ | 215 }; \ |
216 struct Store##Type##NoWriteBarrier##Operator FINAL \ | 216 struct Store##Type##NoWriteBarrier##Operator final \ |
217 : public Store##Type##Operator { \ | 217 : public Store##Type##Operator { \ |
218 Store##Type##NoWriteBarrier##Operator() \ | 218 Store##Type##NoWriteBarrier##Operator() \ |
219 : Store##Type##Operator(kNoWriteBarrier) {} \ | 219 : Store##Type##Operator(kNoWriteBarrier) {} \ |
220 }; \ | 220 }; \ |
221 struct Store##Type##FullWriteBarrier##Operator FINAL \ | 221 struct Store##Type##FullWriteBarrier##Operator final \ |
222 : public Store##Type##Operator { \ | 222 : public Store##Type##Operator { \ |
223 Store##Type##FullWriteBarrier##Operator() \ | 223 Store##Type##FullWriteBarrier##Operator() \ |
224 : Store##Type##Operator(kFullWriteBarrier) {} \ | 224 : Store##Type##Operator(kFullWriteBarrier) {} \ |
225 }; \ | 225 }; \ |
226 struct CheckedStore##Type##Operator FINAL \ | 226 struct CheckedStore##Type##Operator final \ |
227 : public Operator1<CheckedStoreRepresentation> { \ | 227 : public Operator1<CheckedStoreRepresentation> { \ |
228 CheckedStore##Type##Operator() \ | 228 CheckedStore##Type##Operator() \ |
229 : Operator1<CheckedStoreRepresentation>( \ | 229 : Operator1<CheckedStoreRepresentation>( \ |
230 IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, \ | 230 IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, \ |
231 "CheckedStore", 4, 1, 1, 0, 1, 0, k##Type) {} \ | 231 "CheckedStore", 4, 1, 1, 0, 1, 0, k##Type) {} \ |
232 }; \ | 232 }; \ |
233 Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \ | 233 Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \ |
234 Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \ | 234 Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \ |
235 CheckedStore##Type##Operator kCheckedStore##Type; | 235 CheckedStore##Type##Operator kCheckedStore##Type; |
236 MACHINE_TYPE_LIST(STORE) | 236 MACHINE_TYPE_LIST(STORE) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 328 } |
329 // Uncached. | 329 // Uncached. |
330 return new (zone_) Operator1<CheckedStoreRepresentation>( | 330 return new (zone_) Operator1<CheckedStoreRepresentation>( |
331 IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, | 331 IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, |
332 "CheckedStore", 4, 1, 1, 0, 1, 0, rep); | 332 "CheckedStore", 4, 1, 1, 0, 1, 0, rep); |
333 } | 333 } |
334 | 334 |
335 } // namespace compiler | 335 } // namespace compiler |
336 } // namespace internal | 336 } // namespace internal |
337 } // namespace v8 | 337 } // namespace v8 |
OLD | NEW |