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 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 | 3141 |
3142 | 3142 |
3143 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 3143 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
3144 DCHECK(GetDetails(descriptor_number).location() == kField); | 3144 DCHECK(GetDetails(descriptor_number).location() == kField); |
3145 return GetDetails(descriptor_number).field_index(); | 3145 return GetDetails(descriptor_number).field_index(); |
3146 } | 3146 } |
3147 | 3147 |
3148 | 3148 |
3149 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { | 3149 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { |
3150 DCHECK(GetDetails(descriptor_number).location() == kField); | 3150 DCHECK(GetDetails(descriptor_number).location() == kField); |
3151 return HeapType::cast(GetValue(descriptor_number)); | 3151 Object* value = GetValue(descriptor_number); |
| 3152 if (value->IsWeakCell()) { |
| 3153 if (WeakCell::cast(value)->cleared()) return HeapType::None(); |
| 3154 value = WeakCell::cast(value)->value(); |
| 3155 } |
| 3156 return HeapType::cast(value); |
3152 } | 3157 } |
3153 | 3158 |
3154 | 3159 |
3155 Object* DescriptorArray::GetConstant(int descriptor_number) { | 3160 Object* DescriptorArray::GetConstant(int descriptor_number) { |
3156 return GetValue(descriptor_number); | 3161 return GetValue(descriptor_number); |
3157 } | 3162 } |
3158 | 3163 |
3159 | 3164 |
3160 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { | 3165 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { |
3161 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT); | 3166 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT); |
(...skipping 4335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7497 #undef READ_SHORT_FIELD | 7502 #undef READ_SHORT_FIELD |
7498 #undef WRITE_SHORT_FIELD | 7503 #undef WRITE_SHORT_FIELD |
7499 #undef READ_BYTE_FIELD | 7504 #undef READ_BYTE_FIELD |
7500 #undef WRITE_BYTE_FIELD | 7505 #undef WRITE_BYTE_FIELD |
7501 #undef NOBARRIER_READ_BYTE_FIELD | 7506 #undef NOBARRIER_READ_BYTE_FIELD |
7502 #undef NOBARRIER_WRITE_BYTE_FIELD | 7507 #undef NOBARRIER_WRITE_BYTE_FIELD |
7503 | 7508 |
7504 } } // namespace v8::internal | 7509 } } // namespace v8::internal |
7505 | 7510 |
7506 #endif // V8_OBJECTS_INL_H_ | 7511 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |