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/layout-descriptor-inl.h" | 26 #include "src/layout-descriptor-inl.h" |
26 #include "src/lookup.h" | 27 #include "src/lookup.h" |
27 #include "src/objects.h" | 28 #include "src/objects.h" |
28 #include "src/property.h" | 29 #include "src/property.h" |
29 #include "src/prototype.h" | 30 #include "src/prototype.h" |
30 #include "src/transitions-inl.h" | 31 #include "src/transitions-inl.h" |
(...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 FixedTypedArrayBase* empty_array = | 2718 FixedTypedArrayBase* empty_array = |
2718 GetHeap()->EmptyFixedTypedArrayForMap(this); | 2719 GetHeap()->EmptyFixedTypedArrayForMap(this); |
2719 DCHECK(!GetHeap()->InNewSpace(empty_array)); | 2720 DCHECK(!GetHeap()->InNewSpace(empty_array)); |
2720 return empty_array; | 2721 return empty_array; |
2721 } else { | 2722 } else { |
2722 UNREACHABLE(); | 2723 UNREACHABLE(); |
2723 } | 2724 } |
2724 return NULL; | 2725 return NULL; |
2725 } | 2726 } |
2726 | 2727 |
| 2728 // static |
| 2729 Handle<Map> Map::ReconfigureProperty(Handle<Map> map, int modify_index, |
| 2730 PropertyKind new_kind, |
| 2731 PropertyAttributes new_attributes, |
| 2732 Representation new_representation, |
| 2733 Handle<FieldType> new_field_type, |
| 2734 StoreMode store_mode) { |
| 2735 return Reconfigure(map, map->elements_kind(), modify_index, new_kind, |
| 2736 new_attributes, new_representation, new_field_type, |
| 2737 store_mode); |
| 2738 } |
| 2739 |
| 2740 // static |
| 2741 Handle<Map> Map::ReconfigureElementsKind(Handle<Map> map, |
| 2742 ElementsKind new_elements_kind) { |
| 2743 return Reconfigure(map, new_elements_kind, -1, kData, NONE, |
| 2744 Representation::None(), FieldType::None(map->GetIsolate()), |
| 2745 ALLOW_IN_DESCRIPTOR); |
| 2746 } |
2727 | 2747 |
2728 Object** DescriptorArray::GetKeySlot(int descriptor_number) { | 2748 Object** DescriptorArray::GetKeySlot(int descriptor_number) { |
2729 DCHECK(descriptor_number < number_of_descriptors()); | 2749 DCHECK(descriptor_number < number_of_descriptors()); |
2730 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); | 2750 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); |
2731 } | 2751 } |
2732 | 2752 |
2733 | 2753 |
2734 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { | 2754 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { |
2735 return GetKeySlot(descriptor_number); | 2755 return GetKeySlot(descriptor_number); |
2736 } | 2756 } |
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7689 #undef WRITE_INT64_FIELD | 7709 #undef WRITE_INT64_FIELD |
7690 #undef READ_BYTE_FIELD | 7710 #undef READ_BYTE_FIELD |
7691 #undef WRITE_BYTE_FIELD | 7711 #undef WRITE_BYTE_FIELD |
7692 #undef NOBARRIER_READ_BYTE_FIELD | 7712 #undef NOBARRIER_READ_BYTE_FIELD |
7693 #undef NOBARRIER_WRITE_BYTE_FIELD | 7713 #undef NOBARRIER_WRITE_BYTE_FIELD |
7694 | 7714 |
7695 } // namespace internal | 7715 } // namespace internal |
7696 } // namespace v8 | 7716 } // namespace v8 |
7697 | 7717 |
7698 #endif // V8_OBJECTS_INL_H_ | 7718 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |