Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1475)

Side by Side Diff: src/compiler/access-builder.cc

Issue 2622723003: [compiler] Support Object.create(null) inlining in TF (Closed)
Patch Set: initializing all object fields Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, 77 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map,
78 int index) { 78 int index) {
79 int const offset = map->GetInObjectPropertyOffset(index); 79 int const offset = map->GetInObjectPropertyOffset(index);
80 FieldAccess access = {kTaggedBase, offset, 80 FieldAccess access = {kTaggedBase, offset,
81 MaybeHandle<Name>(), MaybeHandle<Map>(), 81 MaybeHandle<Name>(), MaybeHandle<Map>(),
82 Type::NonInternal(), MachineType::AnyTagged(), 82 Type::NonInternal(), MachineType::AnyTagged(),
83 kFullWriteBarrier}; 83 kFullWriteBarrier};
84 return access; 84 return access;
85 } 85 }
86 86
87 // static
88 FieldAccess AccessBuilder::ForJSObjectOffset(
89 int offset, WriteBarrierKind write_barrier_kind) {
90 FieldAccess access = {kTaggedBase, offset,
91 MaybeHandle<Name>(), MaybeHandle<Map>(),
92 Type::NonInternal(), MachineType::AnyTagged(),
93 write_barrier_kind};
94 return access;
95 }
87 96
88 // static 97 // static
89 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() { 98 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
90 FieldAccess access = { 99 FieldAccess access = {
91 kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset, 100 kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset,
92 MaybeHandle<Name>(), MaybeHandle<Map>(), 101 MaybeHandle<Name>(), MaybeHandle<Map>(),
93 Type::Any(), MachineType::AnyTagged(), 102 Type::Any(), MachineType::AnyTagged(),
94 kFullWriteBarrier}; 103 kFullWriteBarrier};
95 return access; 104 return access;
96 } 105 }
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 FieldAccess access = { 690 FieldAccess access = {
682 kTaggedBase, JSSloppyArgumentsObject::kCalleeOffset, 691 kTaggedBase, JSSloppyArgumentsObject::kCalleeOffset,
683 Handle<Name>(), MaybeHandle<Map>(), 692 Handle<Name>(), MaybeHandle<Map>(),
684 Type::NonInternal(), MachineType::AnyTagged(), 693 Type::NonInternal(), MachineType::AnyTagged(),
685 kPointerWriteBarrier}; 694 kPointerWriteBarrier};
686 return access; 695 return access;
687 } 696 }
688 697
689 698
690 // static 699 // static
691 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { 700 FieldAccess AccessBuilder::ForFixedArraySlot(
701 size_t index, WriteBarrierKind write_barrier_kind) {
692 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); 702 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index));
693 FieldAccess access = {kTaggedBase, offset, 703 FieldAccess access = {kTaggedBase, offset,
694 Handle<Name>(), MaybeHandle<Map>(), 704 Handle<Name>(), MaybeHandle<Map>(),
695 Type::NonInternal(), MachineType::AnyTagged(), 705 Type::NonInternal(), MachineType::AnyTagged(),
696 kFullWriteBarrier}; 706 write_barrier_kind};
697 return access; 707 return access;
698 } 708 }
699 709
700 710
701 // static 711 // static
702 FieldAccess AccessBuilder::ForCellValue() { 712 FieldAccess AccessBuilder::ForCellValue() {
703 FieldAccess access = {kTaggedBase, Cell::kValueOffset, 713 FieldAccess access = {kTaggedBase, Cell::kValueOffset,
704 Handle<Name>(), MaybeHandle<Map>(), 714 Handle<Name>(), MaybeHandle<Map>(),
705 Type::Any(), MachineType::AnyTagged(), 715 Type::Any(), MachineType::AnyTagged(),
706 kFullWriteBarrier}; 716 kFullWriteBarrier};
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 MachineType::Float64(), kNoWriteBarrier}; 846 MachineType::Float64(), kNoWriteBarrier};
837 return access; 847 return access;
838 } 848 }
839 } 849 }
840 UNREACHABLE(); 850 UNREACHABLE();
841 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), 851 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(),
842 kNoWriteBarrier}; 852 kNoWriteBarrier};
843 return access; 853 return access;
844 } 854 }
845 855
856 // static
857 FieldAccess AccessBuilder::ForHashTableBaseNumberOfElements() {
858 FieldAccess access = {
859 kTaggedBase,
860 FixedArray::OffsetOfElementAt(HashTableBase::kNumberOfElementsIndex),
861 MaybeHandle<Name>(),
862 MaybeHandle<Map>(),
863 Type::SignedSmall(),
864 MachineType::TaggedSigned(),
865 kNoWriteBarrier};
866 return access;
867 }
868
869 // static
870 FieldAccess AccessBuilder::ForHashTableBaseNumberOfDeletedElement() {
871 FieldAccess access = {
872 kTaggedBase, FixedArray::OffsetOfElementAt(
873 HashTableBase::kNumberOfDeletedElementsIndex),
874 MaybeHandle<Name>(), MaybeHandle<Map>(), Type::SignedSmall(),
875 MachineType::TaggedSigned(), kNoWriteBarrier};
876 return access;
877 }
878
879 // static
880 FieldAccess AccessBuilder::ForHashTableBaseCapacity() {
881 FieldAccess access = {
882 kTaggedBase,
883 FixedArray::OffsetOfElementAt(HashTableBase::kCapacityIndex),
884 MaybeHandle<Name>(),
885 MaybeHandle<Map>(),
886 Type::SignedSmall(),
887 MachineType::TaggedSigned(),
888 kNoWriteBarrier};
889 return access;
890 }
891
892 // static
893 FieldAccess AccessBuilder::ForDictionaryMaxNumberKey() {
894 FieldAccess access = {
895 kTaggedBase,
896 FixedArray::OffsetOfElementAt(NameDictionary::kMaxNumberKeyIndex),
897 MaybeHandle<Name>(),
898 MaybeHandle<Map>(),
899 Type::Any(),
900 MachineType::AnyTagged(),
901 kNoWriteBarrier};
902 return access;
903 }
904
905 // static
906 FieldAccess AccessBuilder::ForDictionaryNextEnumerationIndex() {
907 FieldAccess access = {
908 kTaggedBase,
909 FixedArray::OffsetOfElementAt(NameDictionary::kNextEnumerationIndexIndex),
910 MaybeHandle<Name>(),
911 MaybeHandle<Map>(),
912 Type::SignedSmall(),
913 MachineType::TaggedSigned(),
914 kNoWriteBarrier};
915 return access;
916 }
917
846 } // namespace compiler 918 } // namespace compiler
847 } // namespace internal 919 } // namespace internal
848 } // namespace v8 920 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698