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 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3129 | 3129 |
3130 | 3130 |
3131 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 3131 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
3132 DCHECK(GetDetails(descriptor_number).location() == kField); | 3132 DCHECK(GetDetails(descriptor_number).location() == kField); |
3133 return GetDetails(descriptor_number).field_index(); | 3133 return GetDetails(descriptor_number).field_index(); |
3134 } | 3134 } |
3135 | 3135 |
3136 | 3136 |
3137 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { | 3137 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { |
3138 DCHECK(GetDetails(descriptor_number).location() == kField); | 3138 DCHECK(GetDetails(descriptor_number).location() == kField); |
3139 return HeapType::cast(GetValue(descriptor_number)); | 3139 Object* value = GetValue(descriptor_number); |
| 3140 if (value->IsWeakCell()) { |
| 3141 if (WeakCell::cast(value)->cleared()) return HeapType::Any(); |
| 3142 value = WeakCell::cast(value)->value(); |
| 3143 } |
| 3144 return HeapType::cast(value); |
3140 } | 3145 } |
3141 | 3146 |
3142 | 3147 |
3143 Object* DescriptorArray::GetConstant(int descriptor_number) { | 3148 Object* DescriptorArray::GetConstant(int descriptor_number) { |
3144 return GetValue(descriptor_number); | 3149 return GetValue(descriptor_number); |
3145 } | 3150 } |
3146 | 3151 |
3147 | 3152 |
3148 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { | 3153 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { |
3149 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT); | 3154 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT); |
(...skipping 4479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7629 #undef READ_SHORT_FIELD | 7634 #undef READ_SHORT_FIELD |
7630 #undef WRITE_SHORT_FIELD | 7635 #undef WRITE_SHORT_FIELD |
7631 #undef READ_BYTE_FIELD | 7636 #undef READ_BYTE_FIELD |
7632 #undef WRITE_BYTE_FIELD | 7637 #undef WRITE_BYTE_FIELD |
7633 #undef NOBARRIER_READ_BYTE_FIELD | 7638 #undef NOBARRIER_READ_BYTE_FIELD |
7634 #undef NOBARRIER_WRITE_BYTE_FIELD | 7639 #undef NOBARRIER_WRITE_BYTE_FIELD |
7635 | 7640 |
7636 } } // namespace v8::internal | 7641 } } // namespace v8::internal |
7637 | 7642 |
7638 #endif // V8_OBJECTS_INL_H_ | 7643 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |