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 // 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.h" | 25 #include "src/isolate.h" |
25 #include "src/isolate-inl.h" | 26 #include "src/isolate-inl.h" |
26 #include "src/layout-descriptor-inl.h" | 27 #include "src/layout-descriptor-inl.h" |
27 #include "src/lookup.h" | 28 #include "src/lookup.h" |
28 #include "src/objects.h" | 29 #include "src/objects.h" |
29 #include "src/property.h" | 30 #include "src/property.h" |
30 #include "src/prototype.h" | 31 #include "src/prototype.h" |
(...skipping 2765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2796 FixedTypedArrayBase* empty_array = | 2797 FixedTypedArrayBase* empty_array = |
2797 GetHeap()->EmptyFixedTypedArrayForMap(this); | 2798 GetHeap()->EmptyFixedTypedArrayForMap(this); |
2798 DCHECK(!GetHeap()->InNewSpace(empty_array)); | 2799 DCHECK(!GetHeap()->InNewSpace(empty_array)); |
2799 return empty_array; | 2800 return empty_array; |
2800 } else { | 2801 } else { |
2801 UNREACHABLE(); | 2802 UNREACHABLE(); |
2802 } | 2803 } |
2803 return NULL; | 2804 return NULL; |
2804 } | 2805 } |
2805 | 2806 |
| 2807 // static |
| 2808 Handle<Map> Map::ReconfigureProperty(Handle<Map> map, int modify_index, |
| 2809 PropertyKind new_kind, |
| 2810 PropertyAttributes new_attributes, |
| 2811 Representation new_representation, |
| 2812 Handle<FieldType> new_field_type, |
| 2813 StoreMode store_mode) { |
| 2814 return Reconfigure(map, map->elements_kind(), modify_index, new_kind, |
| 2815 new_attributes, new_representation, new_field_type, |
| 2816 store_mode); |
| 2817 } |
| 2818 |
| 2819 // static |
| 2820 Handle<Map> Map::ReconfigureElementsKind(Handle<Map> map, |
| 2821 ElementsKind new_elements_kind) { |
| 2822 return Reconfigure(map, new_elements_kind, -1, kData, NONE, |
| 2823 Representation::None(), FieldType::None(map->GetIsolate()), |
| 2824 ALLOW_IN_DESCRIPTOR); |
| 2825 } |
2806 | 2826 |
2807 Object** DescriptorArray::GetKeySlot(int descriptor_number) { | 2827 Object** DescriptorArray::GetKeySlot(int descriptor_number) { |
2808 DCHECK(descriptor_number < number_of_descriptors()); | 2828 DCHECK(descriptor_number < number_of_descriptors()); |
2809 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); | 2829 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); |
2810 } | 2830 } |
2811 | 2831 |
2812 | 2832 |
2813 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { | 2833 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { |
2814 return GetKeySlot(descriptor_number); | 2834 return GetKeySlot(descriptor_number); |
2815 } | 2835 } |
(...skipping 5040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7856 #undef WRITE_INT64_FIELD | 7876 #undef WRITE_INT64_FIELD |
7857 #undef READ_BYTE_FIELD | 7877 #undef READ_BYTE_FIELD |
7858 #undef WRITE_BYTE_FIELD | 7878 #undef WRITE_BYTE_FIELD |
7859 #undef NOBARRIER_READ_BYTE_FIELD | 7879 #undef NOBARRIER_READ_BYTE_FIELD |
7860 #undef NOBARRIER_WRITE_BYTE_FIELD | 7880 #undef NOBARRIER_WRITE_BYTE_FIELD |
7861 | 7881 |
7862 } // namespace internal | 7882 } // namespace internal |
7863 } // namespace v8 | 7883 } // namespace v8 |
7864 | 7884 |
7865 #endif // V8_OBJECTS_INL_H_ | 7885 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |