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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 PropertyDetails PropertyDetails::AsDeleted() const { | 54 PropertyDetails PropertyDetails::AsDeleted() const { |
55 Smi* smi = Smi::FromInt(value_ | DeletedField::encode(1)); | 55 Smi* smi = Smi::FromInt(value_ | DeletedField::encode(1)); |
56 return PropertyDetails(smi); | 56 return PropertyDetails(smi); |
57 } | 57 } |
58 | 58 |
59 | 59 |
60 int PropertyDetails::field_width_in_words() const { | 60 int PropertyDetails::field_width_in_words() const { |
61 DCHECK(type() == DATA); | 61 DCHECK(location() == kField); |
62 if (!FLAG_unbox_double_fields) return 1; | 62 if (!FLAG_unbox_double_fields) return 1; |
63 if (kDoubleSize == kPointerSize) return 1; | 63 if (kDoubleSize == kPointerSize) return 1; |
64 return representation().IsDouble() ? kDoubleSize / kPointerSize : 1; | 64 return representation().IsDouble() ? kDoubleSize / kPointerSize : 1; |
65 } | 65 } |
66 | 66 |
67 | 67 |
68 #define TYPE_CHECKER(type, instancetype) \ | 68 #define TYPE_CHECKER(type, instancetype) \ |
69 bool Object::Is##type() const { \ | 69 bool Object::Is##type() const { \ |
70 return Object::IsHeapObject() && \ | 70 return Object::IsHeapObject() && \ |
71 HeapObject::cast(this)->map()->instance_type() == instancetype; \ | 71 HeapObject::cast(this)->map()->instance_type() == instancetype; \ |
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 return PropertyDetails(Smi::cast(details)); | 3141 return PropertyDetails(Smi::cast(details)); |
3142 } | 3142 } |
3143 | 3143 |
3144 | 3144 |
3145 PropertyType DescriptorArray::GetType(int descriptor_number) { | 3145 PropertyType DescriptorArray::GetType(int descriptor_number) { |
3146 return GetDetails(descriptor_number).type(); | 3146 return GetDetails(descriptor_number).type(); |
3147 } | 3147 } |
3148 | 3148 |
3149 | 3149 |
3150 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 3150 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
3151 DCHECK(GetDetails(descriptor_number).type() == DATA); | 3151 DCHECK(GetDetails(descriptor_number).location() == kField); |
3152 return GetDetails(descriptor_number).field_index(); | 3152 return GetDetails(descriptor_number).field_index(); |
3153 } | 3153 } |
3154 | 3154 |
3155 | 3155 |
3156 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { | 3156 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { |
3157 DCHECK(GetDetails(descriptor_number).type() == DATA); | 3157 DCHECK(GetDetails(descriptor_number).location() == kField); |
3158 return HeapType::cast(GetValue(descriptor_number)); | 3158 return HeapType::cast(GetValue(descriptor_number)); |
3159 } | 3159 } |
3160 | 3160 |
3161 | 3161 |
3162 Object* DescriptorArray::GetConstant(int descriptor_number) { | 3162 Object* DescriptorArray::GetConstant(int descriptor_number) { |
3163 return GetValue(descriptor_number); | 3163 return GetValue(descriptor_number); |
3164 } | 3164 } |
3165 | 3165 |
3166 | 3166 |
3167 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { | 3167 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { |
(...skipping 4465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7633 #undef READ_SHORT_FIELD | 7633 #undef READ_SHORT_FIELD |
7634 #undef WRITE_SHORT_FIELD | 7634 #undef WRITE_SHORT_FIELD |
7635 #undef READ_BYTE_FIELD | 7635 #undef READ_BYTE_FIELD |
7636 #undef WRITE_BYTE_FIELD | 7636 #undef WRITE_BYTE_FIELD |
7637 #undef NOBARRIER_READ_BYTE_FIELD | 7637 #undef NOBARRIER_READ_BYTE_FIELD |
7638 #undef NOBARRIER_WRITE_BYTE_FIELD | 7638 #undef NOBARRIER_WRITE_BYTE_FIELD |
7639 | 7639 |
7640 } } // namespace v8::internal | 7640 } } // namespace v8::internal |
7641 | 7641 |
7642 #endif // V8_OBJECTS_INL_H_ | 7642 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |