OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-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 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 struct AllocateOperator final : public Operator1<PretenureFlag> { | 496 struct AllocateOperator final : public Operator1<PretenureFlag> { |
497 AllocateOperator() | 497 AllocateOperator() |
498 : Operator1<PretenureFlag>( | 498 : Operator1<PretenureFlag>( |
499 IrOpcode::kAllocate, | 499 IrOpcode::kAllocate, |
500 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, | 500 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, |
501 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} | 501 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} |
502 }; | 502 }; |
503 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; | 503 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; |
504 AllocateOperator<TENURED> kAllocateTenuredOperator; | 504 AllocateOperator<TENURED> kAllocateTenuredOperator; |
505 | 505 |
506 struct EnsureWritableFastElementsOperator final : public Operator { | |
507 EnsureWritableFastElementsOperator() | |
508 : Operator( // -- | |
509 IrOpcode::kEnsureWritableFastElements, // opcode | |
510 Operator::kNoDeopt | Operator::kNoThrow, // flags | |
511 "EnsureWritableFastElements", // name | |
512 2, 1, 1, 1, 1, 0) {} // counts | |
513 }; | |
514 EnsureWritableFastElementsOperator kEnsureWritableFastElements; | |
515 | |
516 #define BUFFER_ACCESS(Type, type, TYPE, ctype, size) \ | 506 #define BUFFER_ACCESS(Type, type, TYPE, ctype, size) \ |
517 struct LoadBuffer##Type##Operator final : public Operator1<BufferAccess> { \ | 507 struct LoadBuffer##Type##Operator final : public Operator1<BufferAccess> { \ |
518 LoadBuffer##Type##Operator() \ | 508 LoadBuffer##Type##Operator() \ |
519 : Operator1<BufferAccess>( \ | 509 : Operator1<BufferAccess>( \ |
520 IrOpcode::kLoadBuffer, \ | 510 IrOpcode::kLoadBuffer, \ |
521 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ | 511 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
522 "LoadBuffer", 3, 1, 1, 1, 1, 0, \ | 512 "LoadBuffer", 3, 1, 1, 1, 1, 0, \ |
523 BufferAccess(kExternal##Type##Array)) {} \ | 513 BufferAccess(kExternal##Type##Array)) {} \ |
524 }; \ | 514 }; \ |
525 struct StoreBuffer##Type##Operator final : public Operator1<BufferAccess> { \ | 515 struct StoreBuffer##Type##Operator final : public Operator1<BufferAccess> { \ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 UNREACHABLE(); | 611 UNREACHABLE(); |
622 return nullptr; | 612 return nullptr; |
623 } | 613 } |
624 | 614 |
625 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { | 615 const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) { |
626 return new (zone()) Operator(IrOpcode::kReferenceEqual, | 616 return new (zone()) Operator(IrOpcode::kReferenceEqual, |
627 Operator::kCommutative | Operator::kPure, | 617 Operator::kCommutative | Operator::kPure, |
628 "ReferenceEqual", 2, 0, 0, 1, 0, 0); | 618 "ReferenceEqual", 2, 0, 0, 1, 0, 0); |
629 } | 619 } |
630 | 620 |
631 const Operator* SimplifiedOperatorBuilder::EnsureWritableFastElements() { | |
632 return &cache_.kEnsureWritableFastElements; | |
633 } | |
634 | |
635 const Operator* SimplifiedOperatorBuilder::TransitionElementsKind( | 621 const Operator* SimplifiedOperatorBuilder::TransitionElementsKind( |
636 ElementsTransition transition) { | 622 ElementsTransition transition) { |
637 return new (zone()) Operator1<ElementsTransition>( // -- | 623 return new (zone()) Operator1<ElementsTransition>( // -- |
638 IrOpcode::kTransitionElementsKind, // opcode | 624 IrOpcode::kTransitionElementsKind, // opcode |
639 Operator::kNoDeopt | Operator::kNoThrow, // flags | 625 Operator::kNoDeopt | Operator::kNoThrow, // flags |
640 "TransitionElementsKind", // name | 626 "TransitionElementsKind", // name |
641 3, 1, 1, 0, 1, 0, // counts | 627 3, 1, 1, 0, 1, 0, // counts |
642 transition); // parameter | 628 transition); // parameter |
643 } | 629 } |
644 | 630 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 715 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
730 #Name, value_input_count, 1, control_input_count, \ | 716 #Name, value_input_count, 1, control_input_count, \ |
731 output_count, 1, 0, access); \ | 717 output_count, 1, 0, access); \ |
732 } | 718 } |
733 ACCESS_OP_LIST(ACCESS) | 719 ACCESS_OP_LIST(ACCESS) |
734 #undef ACCESS | 720 #undef ACCESS |
735 | 721 |
736 } // namespace compiler | 722 } // namespace compiler |
737 } // namespace internal | 723 } // namespace internal |
738 } // namespace v8 | 724 } // namespace v8 |
OLD | NEW |