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 // |
(...skipping 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3018 result = GetHeap()->empty_sloppy_arguments_elements(); | 3018 result = GetHeap()->empty_sloppy_arguments_elements(); |
3019 } else if (has_fixed_typed_array_elements()) { | 3019 } else if (has_fixed_typed_array_elements()) { |
3020 result = GetHeap()->EmptyFixedTypedArrayForMap(this); | 3020 result = GetHeap()->EmptyFixedTypedArrayForMap(this); |
3021 } else { | 3021 } else { |
3022 UNREACHABLE(); | 3022 UNREACHABLE(); |
3023 } | 3023 } |
3024 DCHECK(!GetHeap()->InNewSpace(result)); | 3024 DCHECK(!GetHeap()->InNewSpace(result)); |
3025 return result; | 3025 return result; |
3026 } | 3026 } |
3027 | 3027 |
3028 // static | |
3029 Handle<Map> Map::ReconfigureProperty(Handle<Map> map, int modify_index, | |
3030 PropertyKind new_kind, | |
3031 PropertyAttributes new_attributes, | |
3032 Representation new_representation, | |
3033 Handle<FieldType> new_field_type, | |
3034 StoreMode store_mode) { | |
3035 return Reconfigure(map, map->elements_kind(), modify_index, new_kind, | |
3036 new_attributes, new_representation, new_field_type, | |
3037 store_mode); | |
3038 } | |
3039 | |
3040 // static | |
3041 Handle<Map> Map::ReconfigureElementsKind(Handle<Map> map, | |
3042 ElementsKind new_elements_kind) { | |
3043 return Reconfigure(map, new_elements_kind, -1, kData, NONE, | |
3044 Representation::None(), FieldType::None(map->GetIsolate()), | |
3045 ALLOW_IN_DESCRIPTOR); | |
3046 } | |
3047 | |
3048 Object** DescriptorArray::GetKeySlot(int descriptor_number) { | 3028 Object** DescriptorArray::GetKeySlot(int descriptor_number) { |
3049 DCHECK(descriptor_number < number_of_descriptors()); | 3029 DCHECK(descriptor_number < number_of_descriptors()); |
3050 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); | 3030 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); |
3051 } | 3031 } |
3052 | 3032 |
3053 | 3033 |
3054 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { | 3034 Object** DescriptorArray::GetDescriptorStartSlot(int descriptor_number) { |
3055 return GetKeySlot(descriptor_number); | 3035 return GetKeySlot(descriptor_number); |
3056 } | 3036 } |
3057 | 3037 |
(...skipping 5393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8451 #undef WRITE_INT64_FIELD | 8431 #undef WRITE_INT64_FIELD |
8452 #undef READ_BYTE_FIELD | 8432 #undef READ_BYTE_FIELD |
8453 #undef WRITE_BYTE_FIELD | 8433 #undef WRITE_BYTE_FIELD |
8454 #undef NOBARRIER_READ_BYTE_FIELD | 8434 #undef NOBARRIER_READ_BYTE_FIELD |
8455 #undef NOBARRIER_WRITE_BYTE_FIELD | 8435 #undef NOBARRIER_WRITE_BYTE_FIELD |
8456 | 8436 |
8457 } // namespace internal | 8437 } // namespace internal |
8458 } // namespace v8 | 8438 } // namespace v8 |
8459 | 8439 |
8460 #endif // V8_OBJECTS_INL_H_ | 8440 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |