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