| 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 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2786 FixedTypedArrayBase* empty_array = | 2787 FixedTypedArrayBase* empty_array = |
| 2787 GetHeap()->EmptyFixedTypedArrayForMap(this); | 2788 GetHeap()->EmptyFixedTypedArrayForMap(this); |
| 2788 DCHECK(!GetHeap()->InNewSpace(empty_array)); | 2789 DCHECK(!GetHeap()->InNewSpace(empty_array)); |
| 2789 return empty_array; | 2790 return empty_array; |
| 2790 } else { | 2791 } else { |
| 2791 UNREACHABLE(); | 2792 UNREACHABLE(); |
| 2792 } | 2793 } |
| 2793 return NULL; | 2794 return NULL; |
| 2794 } | 2795 } |
| 2795 | 2796 |
| 2797 // static |
| 2798 Handle<Map> Map::ReconfigureProperty(Handle<Map> map, int modify_index, |
| 2799 PropertyKind new_kind, |
| 2800 PropertyAttributes new_attributes, |
| 2801 Representation new_representation, |
| 2802 Handle<FieldType> new_field_type, |
| 2803 StoreMode store_mode) { |
| 2804 return Reconfigure(map, map->elements_kind(), modify_index, new_kind, |
| 2805 new_attributes, new_representation, new_field_type, |
| 2806 store_mode); |
| 2807 } |
| 2808 |
| 2809 // static |
| 2810 Handle<Map> Map::ReconfigureElementsKind(Handle<Map> map, |
| 2811 ElementsKind new_elements_kind) { |
| 2812 return Reconfigure(map, new_elements_kind, -1, kData, NONE, |
| 2813 Representation::None(), FieldType::None(map->GetIsolate()), |
| 2814 ALLOW_IN_DESCRIPTOR); |
| 2815 } |
| 2796 | 2816 |
| 2797 Object** DescriptorArray::GetKeySlot(int descriptor_number) { | 2817 Object** DescriptorArray::GetKeySlot(int descriptor_number) { |
| 2798 DCHECK(descriptor_number < number_of_descriptors()); | 2818 DCHECK(descriptor_number < number_of_descriptors()); |
| 2799 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); | 2819 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); |
| 2800 } | 2820 } |
| 2801 | 2821 |
| 2802 | 2822 |
| 2803 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { | 2823 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { |
| 2804 return GetKeySlot(descriptor_number); | 2824 return GetKeySlot(descriptor_number); |
| 2805 } | 2825 } |
| (...skipping 5053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7859 #undef WRITE_INT64_FIELD | 7879 #undef WRITE_INT64_FIELD |
| 7860 #undef READ_BYTE_FIELD | 7880 #undef READ_BYTE_FIELD |
| 7861 #undef WRITE_BYTE_FIELD | 7881 #undef WRITE_BYTE_FIELD |
| 7862 #undef NOBARRIER_READ_BYTE_FIELD | 7882 #undef NOBARRIER_READ_BYTE_FIELD |
| 7863 #undef NOBARRIER_WRITE_BYTE_FIELD | 7883 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7864 | 7884 |
| 7865 } // namespace internal | 7885 } // namespace internal |
| 7866 } // namespace v8 | 7886 } // namespace v8 |
| 7867 | 7887 |
| 7868 #endif // V8_OBJECTS_INL_H_ | 7888 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |