| 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 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3019 | 3019 |
| 3020 return number; | 3020 return number; |
| 3021 } | 3021 } |
| 3022 | 3022 |
| 3023 | 3023 |
| 3024 PropertyDetails Map::GetLastDescriptorDetails() { | 3024 PropertyDetails Map::GetLastDescriptorDetails() { |
| 3025 return instance_descriptors()->GetDetails(LastAdded()); | 3025 return instance_descriptors()->GetDetails(LastAdded()); |
| 3026 } | 3026 } |
| 3027 | 3027 |
| 3028 | 3028 |
| 3029 void Map::LookupDescriptor(JSObject* holder, | 3029 void Map::LookupDescriptor(Name* name, LookupResult* result) { |
| 3030 Name* name, | |
| 3031 LookupResult* result) { | |
| 3032 DescriptorArray* descriptors = this->instance_descriptors(); | 3030 DescriptorArray* descriptors = this->instance_descriptors(); |
| 3033 int number = descriptors->SearchWithCache(name, this); | 3031 int number = descriptors->SearchWithCache(name, this); |
| 3034 if (number == DescriptorArray::kNotFound) return result->NotFound(); | 3032 if (number == DescriptorArray::kNotFound) return result->NotFound(); |
| 3035 result->DescriptorResult(holder, descriptors->GetDetails(number), number); | 3033 result->DescriptorResult(descriptors->GetDetails(number), number); |
| 3036 } | 3034 } |
| 3037 | 3035 |
| 3038 | 3036 |
| 3039 void Map::LookupTransition(JSObject* holder, Name* name, | 3037 void Map::LookupTransition(Name* name, PropertyAttributes attributes, |
| 3040 PropertyAttributes attributes, | |
| 3041 LookupResult* result) { | 3038 LookupResult* result) { |
| 3042 int transition_index = this->SearchTransition(kData, name, attributes); | 3039 int transition_index = this->SearchTransition(kData, name, attributes); |
| 3043 if (transition_index == TransitionArray::kNotFound) return result->NotFound(); | 3040 if (transition_index == TransitionArray::kNotFound) return result->NotFound(); |
| 3044 result->TransitionResult(holder, this->GetTransition(transition_index)); | 3041 result->TransitionResult(this->GetTransition(transition_index)); |
| 3045 } | 3042 } |
| 3046 | 3043 |
| 3047 | 3044 |
| 3048 FixedArrayBase* Map::GetInitialElements() { | 3045 FixedArrayBase* Map::GetInitialElements() { |
| 3049 if (has_fast_smi_or_object_elements() || | 3046 if (has_fast_smi_or_object_elements() || |
| 3050 has_fast_double_elements()) { | 3047 has_fast_double_elements()) { |
| 3051 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array())); | 3048 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array())); |
| 3052 return GetHeap()->empty_fixed_array(); | 3049 return GetHeap()->empty_fixed_array(); |
| 3053 } else if (has_external_array_elements()) { | 3050 } else if (has_external_array_elements()) { |
| 3054 ExternalArray* empty_array = GetHeap()->EmptyExternalArrayForMap(this); | 3051 ExternalArray* empty_array = GetHeap()->EmptyExternalArrayForMap(this); |
| (...skipping 4578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7633 #undef READ_SHORT_FIELD | 7630 #undef READ_SHORT_FIELD |
| 7634 #undef WRITE_SHORT_FIELD | 7631 #undef WRITE_SHORT_FIELD |
| 7635 #undef READ_BYTE_FIELD | 7632 #undef READ_BYTE_FIELD |
| 7636 #undef WRITE_BYTE_FIELD | 7633 #undef WRITE_BYTE_FIELD |
| 7637 #undef NOBARRIER_READ_BYTE_FIELD | 7634 #undef NOBARRIER_READ_BYTE_FIELD |
| 7638 #undef NOBARRIER_WRITE_BYTE_FIELD | 7635 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7639 | 7636 |
| 7640 } } // namespace v8::internal | 7637 } } // namespace v8::internal |
| 7641 | 7638 |
| 7642 #endif // V8_OBJECTS_INL_H_ | 7639 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |