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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 Name##Operator() \ | 435 Name##Operator() \ |
436 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ | 436 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ |
437 value_input_count, 0, control_input_count, output_count, 0, \ | 437 value_input_count, 0, control_input_count, output_count, 0, \ |
438 0) {} \ | 438 0) {} \ |
439 }; \ | 439 }; \ |
440 Name##Operator k##Name; | 440 Name##Operator k##Name; |
441 PURE_OP_LIST(PURE) | 441 PURE_OP_LIST(PURE) |
442 PURE_OPTIONAL_OP_LIST(PURE) | 442 PURE_OPTIONAL_OP_LIST(PURE) |
443 #undef PURE | 443 #undef PURE |
444 | 444 |
445 #define LOAD(Type) \ | 445 #define LOAD(Type) \ |
446 struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \ | 446 struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \ |
447 Load##Type##Operator() \ | 447 Load##Type##Operator() \ |
448 : Operator1<LoadRepresentation>( \ | 448 : Operator1<LoadRepresentation>( \ |
449 IrOpcode::kLoad, Operator::kNoThrow | Operator::kNoWrite, \ | 449 IrOpcode::kLoad, \ |
450 "Load", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ | 450 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
451 }; \ | 451 "Load", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ |
452 struct CheckedLoad##Type##Operator final \ | 452 }; \ |
453 : public Operator1<CheckedLoadRepresentation> { \ | 453 struct CheckedLoad##Type##Operator final \ |
454 CheckedLoad##Type##Operator() \ | 454 : public Operator1<CheckedLoadRepresentation> { \ |
455 : Operator1<CheckedLoadRepresentation>( \ | 455 CheckedLoad##Type##Operator() \ |
456 IrOpcode::kCheckedLoad, Operator::kNoThrow | Operator::kNoWrite, \ | 456 : Operator1<CheckedLoadRepresentation>( \ |
457 "CheckedLoad", 3, 1, 1, 1, 1, 0, MachineType::Type()) {} \ | 457 IrOpcode::kCheckedLoad, \ |
458 }; \ | 458 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
459 Load##Type##Operator kLoad##Type; \ | 459 "CheckedLoad", 3, 1, 1, 1, 1, 0, MachineType::Type()) {} \ |
| 460 }; \ |
| 461 Load##Type##Operator kLoad##Type; \ |
460 CheckedLoad##Type##Operator kCheckedLoad##Type; | 462 CheckedLoad##Type##Operator kCheckedLoad##Type; |
461 MACHINE_TYPE_LIST(LOAD) | 463 MACHINE_TYPE_LIST(LOAD) |
462 #undef LOAD | 464 #undef LOAD |
463 | 465 |
464 #define STACKSLOT(Type) \ | 466 #define STACKSLOT(Type) \ |
465 struct StackSlot##Type##Operator final \ | 467 struct StackSlot##Type##Operator final \ |
466 : public Operator1<MachineRepresentation> { \ | 468 : public Operator1<MachineRepresentation> { \ |
467 StackSlot##Type##Operator() \ | 469 StackSlot##Type##Operator() \ |
468 : Operator1<MachineRepresentation>( \ | 470 : Operator1<MachineRepresentation>( \ |
469 IrOpcode::kStackSlot, Operator::kNoThrow, "StackSlot", 0, 0, 0, \ | 471 IrOpcode::kStackSlot, Operator::kNoDeopt | Operator::kNoThrow, \ |
470 1, 0, 0, MachineType::Type().representation()) {} \ | 472 "StackSlot", 0, 0, 0, 1, 0, 0, \ |
471 }; \ | 473 MachineType::Type().representation()) {} \ |
| 474 }; \ |
472 StackSlot##Type##Operator kStackSlot##Type; | 475 StackSlot##Type##Operator kStackSlot##Type; |
473 MACHINE_TYPE_LIST(STACKSLOT) | 476 MACHINE_TYPE_LIST(STACKSLOT) |
474 #undef STACKSLOT | 477 #undef STACKSLOT |
475 | 478 |
476 #define STORE(Type) \ | 479 #define STORE(Type) \ |
477 struct Store##Type##Operator : public Operator1<StoreRepresentation> { \ | 480 struct Store##Type##Operator : public Operator1<StoreRepresentation> { \ |
478 explicit Store##Type##Operator(WriteBarrierKind write_barrier_kind) \ | 481 explicit Store##Type##Operator(WriteBarrierKind write_barrier_kind) \ |
479 : Operator1<StoreRepresentation>( \ | 482 : Operator1<StoreRepresentation>( \ |
480 IrOpcode::kStore, Operator::kNoRead | Operator::kNoThrow, \ | 483 IrOpcode::kStore, \ |
| 484 Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \ |
481 "Store", 3, 1, 1, 0, 1, 0, \ | 485 "Store", 3, 1, 1, 0, 1, 0, \ |
482 StoreRepresentation(MachineRepresentation::Type, \ | 486 StoreRepresentation(MachineRepresentation::Type, \ |
483 write_barrier_kind)) {} \ | 487 write_barrier_kind)) {} \ |
484 }; \ | 488 }; \ |
485 struct Store##Type##NoWriteBarrier##Operator final \ | 489 struct Store##Type##NoWriteBarrier##Operator final \ |
486 : public Store##Type##Operator { \ | 490 : public Store##Type##Operator { \ |
487 Store##Type##NoWriteBarrier##Operator() \ | 491 Store##Type##NoWriteBarrier##Operator() \ |
488 : Store##Type##Operator(kNoWriteBarrier) {} \ | 492 : Store##Type##Operator(kNoWriteBarrier) {} \ |
489 }; \ | 493 }; \ |
490 struct Store##Type##MapWriteBarrier##Operator final \ | 494 struct Store##Type##MapWriteBarrier##Operator final \ |
491 : public Store##Type##Operator { \ | 495 : public Store##Type##Operator { \ |
492 Store##Type##MapWriteBarrier##Operator() \ | 496 Store##Type##MapWriteBarrier##Operator() \ |
493 : Store##Type##Operator(kMapWriteBarrier) {} \ | 497 : Store##Type##Operator(kMapWriteBarrier) {} \ |
494 }; \ | 498 }; \ |
495 struct Store##Type##PointerWriteBarrier##Operator final \ | 499 struct Store##Type##PointerWriteBarrier##Operator final \ |
496 : public Store##Type##Operator { \ | 500 : public Store##Type##Operator { \ |
497 Store##Type##PointerWriteBarrier##Operator() \ | 501 Store##Type##PointerWriteBarrier##Operator() \ |
498 : Store##Type##Operator(kPointerWriteBarrier) {} \ | 502 : Store##Type##Operator(kPointerWriteBarrier) {} \ |
499 }; \ | 503 }; \ |
500 struct Store##Type##FullWriteBarrier##Operator final \ | 504 struct Store##Type##FullWriteBarrier##Operator final \ |
501 : public Store##Type##Operator { \ | 505 : public Store##Type##Operator { \ |
502 Store##Type##FullWriteBarrier##Operator() \ | 506 Store##Type##FullWriteBarrier##Operator() \ |
503 : Store##Type##Operator(kFullWriteBarrier) {} \ | 507 : Store##Type##Operator(kFullWriteBarrier) {} \ |
504 }; \ | 508 }; \ |
505 struct CheckedStore##Type##Operator final \ | 509 struct CheckedStore##Type##Operator final \ |
506 : public Operator1<CheckedStoreRepresentation> { \ | 510 : public Operator1<CheckedStoreRepresentation> { \ |
507 CheckedStore##Type##Operator() \ | 511 CheckedStore##Type##Operator() \ |
508 : Operator1<CheckedStoreRepresentation>( \ | 512 : Operator1<CheckedStoreRepresentation>( \ |
509 IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, \ | 513 IrOpcode::kCheckedStore, \ |
| 514 Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \ |
510 "CheckedStore", 4, 1, 1, 0, 1, 0, MachineRepresentation::Type) { \ | 515 "CheckedStore", 4, 1, 1, 0, 1, 0, MachineRepresentation::Type) { \ |
511 } \ | 516 } \ |
512 }; \ | 517 }; \ |
513 Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \ | 518 Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \ |
514 Store##Type##MapWriteBarrier##Operator kStore##Type##MapWriteBarrier; \ | 519 Store##Type##MapWriteBarrier##Operator kStore##Type##MapWriteBarrier; \ |
515 Store##Type##PointerWriteBarrier##Operator \ | 520 Store##Type##PointerWriteBarrier##Operator \ |
516 kStore##Type##PointerWriteBarrier; \ | 521 kStore##Type##PointerWriteBarrier; \ |
517 Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \ | 522 Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \ |
518 CheckedStore##Type##Operator kCheckedStore##Type; | 523 CheckedStore##Type##Operator kCheckedStore##Type; |
519 MACHINE_REPRESENTATION_LIST(STORE) | 524 MACHINE_REPRESENTATION_LIST(STORE) |
520 #undef STORE | 525 #undef STORE |
521 | 526 |
522 #define ATOMIC_LOAD(Type) \ | 527 #define ATOMIC_LOAD(Type) \ |
523 struct AtomicLoad##Type##Operator final \ | 528 struct AtomicLoad##Type##Operator final \ |
524 : public Operator1<LoadRepresentation> { \ | 529 : public Operator1<LoadRepresentation> { \ |
525 AtomicLoad##Type##Operator() \ | 530 AtomicLoad##Type##Operator() \ |
526 : Operator1<LoadRepresentation>( \ | 531 : Operator1<LoadRepresentation>( \ |
527 IrOpcode::kAtomicLoad, Operator::kNoThrow | Operator::kNoWrite, \ | 532 IrOpcode::kAtomicLoad, \ |
528 "AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ | 533 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
529 }; \ | 534 "AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ |
| 535 }; \ |
530 AtomicLoad##Type##Operator kAtomicLoad##Type; | 536 AtomicLoad##Type##Operator kAtomicLoad##Type; |
531 ATOMIC_TYPE_LIST(ATOMIC_LOAD) | 537 ATOMIC_TYPE_LIST(ATOMIC_LOAD) |
532 #undef ATOMIC_LOAD | 538 #undef ATOMIC_LOAD |
533 | 539 |
534 #define ATOMIC_STORE(Type) \ | 540 #define ATOMIC_STORE(Type) \ |
535 struct AtomicStore##Type##Operator \ | 541 struct AtomicStore##Type##Operator \ |
536 : public Operator1<MachineRepresentation> { \ | 542 : public Operator1<MachineRepresentation> { \ |
537 AtomicStore##Type##Operator() \ | 543 AtomicStore##Type##Operator() \ |
538 : Operator1<MachineRepresentation>( \ | 544 : Operator1<MachineRepresentation>( \ |
539 IrOpcode::kAtomicStore, Operator::kNoRead | Operator::kNoThrow, \ | 545 IrOpcode::kAtomicStore, \ |
| 546 Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \ |
540 "AtomicStore", 3, 1, 1, 0, 1, 0, MachineRepresentation::Type) {} \ | 547 "AtomicStore", 3, 1, 1, 0, 1, 0, MachineRepresentation::Type) {} \ |
541 }; \ | 548 }; \ |
542 AtomicStore##Type##Operator kAtomicStore##Type; | 549 AtomicStore##Type##Operator kAtomicStore##Type; |
543 ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE) | 550 ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE) |
544 #undef STORE | 551 #undef STORE |
545 | 552 |
546 struct DebugBreakOperator : public Operator { | 553 struct DebugBreakOperator : public Operator { |
547 DebugBreakOperator() | 554 DebugBreakOperator() |
548 : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, | 555 : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, |
549 0, 0, 0, 0, 0) {} | 556 0, 0, 0, 0, 0) {} |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 } | 711 } |
705 ATOMIC_REPRESENTATION_LIST(STORE) | 712 ATOMIC_REPRESENTATION_LIST(STORE) |
706 #undef STORE | 713 #undef STORE |
707 UNREACHABLE(); | 714 UNREACHABLE(); |
708 return nullptr; | 715 return nullptr; |
709 } | 716 } |
710 | 717 |
711 } // namespace compiler | 718 } // namespace compiler |
712 } // namespace internal | 719 } // namespace internal |
713 } // namespace v8 | 720 } // namespace v8 |
OLD | NEW |