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/compiler/type-cache.h" | 7 #include "src/compiler/type-cache.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 #include "src/handles-inl.h" | 10 #include "src/handles-inl.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); | 602 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); |
603 FieldAccess access = {kTaggedBase, | 603 FieldAccess access = {kTaggedBase, |
604 offset, | 604 offset, |
605 Handle<Name>(), | 605 Handle<Name>(), |
606 Type::Any(), | 606 Type::Any(), |
607 MachineType::AnyTagged(), | 607 MachineType::AnyTagged(), |
608 kFullWriteBarrier}; | 608 kFullWriteBarrier}; |
609 return access; | 609 return access; |
610 } | 610 } |
611 | 611 |
612 | |
613 // static | |
614 FieldAccess AccessBuilder::ForPropertyCellValue() { | |
615 return ForPropertyCellValue(Type::Tagged()); | |
616 } | |
617 | |
618 | |
619 // static | |
620 FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) { | |
621 // Extract representation dimension of {type} into MachineType {r}. | |
622 MachineType r = MachineType::AnyTagged(); | |
623 WriteBarrierKind w = kFullWriteBarrier; | |
624 if (type->Is(Type::TaggedSigned())) { | |
625 r = MachineType::TaggedSigned(); | |
626 w = kNoWriteBarrier; | |
627 } else if (type->Is(Type::TaggedPointer())) { | |
628 r = MachineType::TaggedPointer(); | |
629 } | |
630 FieldAccess access = { | |
631 kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), type, r, w}; | |
632 return access; | |
633 } | |
634 | |
635 // static | 612 // static |
636 ElementAccess AccessBuilder::ForFixedArrayElement() { | 613 ElementAccess AccessBuilder::ForFixedArrayElement() { |
637 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), | 614 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), |
638 MachineType::AnyTagged(), kFullWriteBarrier}; | 615 MachineType::AnyTagged(), kFullWriteBarrier}; |
639 return access; | 616 return access; |
640 } | 617 } |
641 | 618 |
642 // static | 619 // static |
643 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) { | 620 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) { |
644 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), | 621 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 } | 710 } |
734 UNREACHABLE(); | 711 UNREACHABLE(); |
735 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), | 712 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
736 kNoWriteBarrier}; | 713 kNoWriteBarrier}; |
737 return access; | 714 return access; |
738 } | 715 } |
739 | 716 |
740 } // namespace compiler | 717 } // namespace compiler |
741 } // namespace internal | 718 } // namespace internal |
742 } // namespace v8 | 719 } // namespace v8 |
OLD | NEW |