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

Side by Side Diff: src/objects-inl.h

Issue 2015513002: [runtime] Ensure that all elements kind transitions are chained to the root map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 6 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/objects.cc ('k') | test/cctest/test-field-type-tracking.cc » ('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 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
11 11
12 #ifndef V8_OBJECTS_INL_H_ 12 #ifndef V8_OBJECTS_INL_H_
13 #define V8_OBJECTS_INL_H_ 13 #define V8_OBJECTS_INL_H_
14 14
15 #include "src/base/atomicops.h" 15 #include "src/base/atomicops.h"
16 #include "src/base/bits.h" 16 #include "src/base/bits.h"
17 #include "src/contexts-inl.h" 17 #include "src/contexts-inl.h"
18 #include "src/conversions-inl.h" 18 #include "src/conversions-inl.h"
19 #include "src/factory.h" 19 #include "src/factory.h"
20 #include "src/field-index-inl.h" 20 #include "src/field-index-inl.h"
21 #include "src/field-type.h"
21 #include "src/handles-inl.h" 22 #include "src/handles-inl.h"
22 #include "src/heap/heap-inl.h" 23 #include "src/heap/heap-inl.h"
23 #include "src/heap/heap.h" 24 #include "src/heap/heap.h"
24 #include "src/isolate-inl.h" 25 #include "src/isolate-inl.h"
25 #include "src/isolate.h" 26 #include "src/isolate.h"
26 #include "src/keys.h" 27 #include "src/keys.h"
27 #include "src/layout-descriptor-inl.h" 28 #include "src/layout-descriptor-inl.h"
28 #include "src/lookup.h" 29 #include "src/lookup.h"
29 #include "src/objects.h" 30 #include "src/objects.h"
30 #include "src/property.h" 31 #include "src/property.h"
(...skipping 2772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 FixedTypedArrayBase* empty_array = 2804 FixedTypedArrayBase* empty_array =
2804 GetHeap()->EmptyFixedTypedArrayForMap(this); 2805 GetHeap()->EmptyFixedTypedArrayForMap(this);
2805 DCHECK(!GetHeap()->InNewSpace(empty_array)); 2806 DCHECK(!GetHeap()->InNewSpace(empty_array));
2806 return empty_array; 2807 return empty_array;
2807 } else { 2808 } else {
2808 UNREACHABLE(); 2809 UNREACHABLE();
2809 } 2810 }
2810 return NULL; 2811 return NULL;
2811 } 2812 }
2812 2813
2814 // static
2815 Handle<Map> Map::ReconfigureProperty(Handle<Map> map, int modify_index,
2816 PropertyKind new_kind,
2817 PropertyAttributes new_attributes,
2818 Representation new_representation,
2819 Handle<FieldType> new_field_type,
2820 StoreMode store_mode) {
2821 return Reconfigure(map, map->elements_kind(), modify_index, new_kind,
2822 new_attributes, new_representation, new_field_type,
2823 store_mode);
2824 }
2825
2826 // static
2827 Handle<Map> Map::ReconfigureElementsKind(Handle<Map> map,
2828 ElementsKind new_elements_kind) {
2829 return Reconfigure(map, new_elements_kind, -1, kData, NONE,
2830 Representation::None(), FieldType::None(map->GetIsolate()),
2831 ALLOW_IN_DESCRIPTOR);
2832 }
2813 2833
2814 Object** DescriptorArray::GetKeySlot(int descriptor_number) { 2834 Object** DescriptorArray::GetKeySlot(int descriptor_number) {
2815 DCHECK(descriptor_number < number_of_descriptors()); 2835 DCHECK(descriptor_number < number_of_descriptors());
2816 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); 2836 return RawFieldOfElementAt(ToKeyIndex(descriptor_number));
2817 } 2837 }
2818 2838
2819 2839
2820 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { 2840 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) {
2821 return GetKeySlot(descriptor_number); 2841 return GetKeySlot(descriptor_number);
2822 } 2842 }
(...skipping 5023 matching lines...) Expand 10 before | Expand all | Expand 10 after
7846 #undef WRITE_INT64_FIELD 7866 #undef WRITE_INT64_FIELD
7847 #undef READ_BYTE_FIELD 7867 #undef READ_BYTE_FIELD
7848 #undef WRITE_BYTE_FIELD 7868 #undef WRITE_BYTE_FIELD
7849 #undef NOBARRIER_READ_BYTE_FIELD 7869 #undef NOBARRIER_READ_BYTE_FIELD
7850 #undef NOBARRIER_WRITE_BYTE_FIELD 7870 #undef NOBARRIER_WRITE_BYTE_FIELD
7851 7871
7852 } // namespace internal 7872 } // namespace internal
7853 } // namespace v8 7873 } // namespace v8
7854 7874
7855 #endif // V8_OBJECTS_INL_H_ 7875 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-field-type-tracking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698