| 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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
| 6 | 6 |
| 7 #include "src/contexts.h" | 7 #include "src/contexts.h" |
| 8 #include "src/frames.h" | 8 #include "src/frames.h" |
| 9 #include "src/handles-inl.h" | 9 #include "src/handles-inl.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 return access; | 605 return access; |
| 606 } | 606 } |
| 607 | 607 |
| 608 // static | 608 // static |
| 609 ElementAccess AccessBuilder::ForFixedArrayElement() { | 609 ElementAccess AccessBuilder::ForFixedArrayElement() { |
| 610 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), | 610 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), |
| 611 MachineType::AnyTagged(), kFullWriteBarrier}; | 611 MachineType::AnyTagged(), kFullWriteBarrier}; |
| 612 return access; | 612 return access; |
| 613 } | 613 } |
| 614 | 614 |
| 615 // static |
| 616 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) { |
| 617 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), |
| 618 MachineType::AnyTagged(), kFullWriteBarrier}; |
| 619 switch (kind) { |
| 620 case FAST_SMI_ELEMENTS: |
| 621 access.type = TypeCache::Get().kSmi; |
| 622 access.write_barrier_kind = kNoWriteBarrier; |
| 623 break; |
| 624 case FAST_HOLEY_SMI_ELEMENTS: |
| 625 access.type = TypeCache::Get().kHoleySmi; |
| 626 break; |
| 627 case FAST_ELEMENTS: |
| 628 access.type = Type::NonInternal(); |
| 629 break; |
| 630 case FAST_HOLEY_ELEMENTS: |
| 631 break; |
| 632 default: |
| 633 UNREACHABLE(); |
| 634 break; |
| 635 } |
| 636 return access; |
| 637 } |
| 615 | 638 |
| 616 // static | 639 // static |
| 617 ElementAccess AccessBuilder::ForFixedDoubleArrayElement() { | 640 ElementAccess AccessBuilder::ForFixedDoubleArrayElement() { |
| 618 ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize, | 641 ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize, |
| 619 TypeCache::Get().kFloat64, MachineType::Float64(), | 642 TypeCache::Get().kFloat64, MachineType::Float64(), |
| 620 kNoWriteBarrier}; | 643 kNoWriteBarrier}; |
| 621 return access; | 644 return access; |
| 622 } | 645 } |
| 623 | 646 |
| 624 | 647 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 695 } |
| 673 UNREACHABLE(); | 696 UNREACHABLE(); |
| 674 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), | 697 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
| 675 kNoWriteBarrier}; | 698 kNoWriteBarrier}; |
| 676 return access; | 699 return access; |
| 677 } | 700 } |
| 678 | 701 |
| 679 } // namespace compiler | 702 } // namespace compiler |
| 680 } // namespace internal | 703 } // namespace internal |
| 681 } // namespace v8 | 704 } // namespace v8 |
| OLD | NEW |