Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/objects-inl.h

Issue 888623002: Property reconfiguring implemented. Tests added. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 return PropertyDetails(Smi::cast(details)); 3133 return PropertyDetails(Smi::cast(details));
3134 } 3134 }
3135 3135
3136 3136
3137 PropertyType DescriptorArray::GetType(int descriptor_number) { 3137 PropertyType DescriptorArray::GetType(int descriptor_number) {
3138 return GetDetails(descriptor_number).type(); 3138 return GetDetails(descriptor_number).type();
3139 } 3139 }
3140 3140
3141 3141
3142 int DescriptorArray::GetFieldIndex(int descriptor_number) { 3142 int DescriptorArray::GetFieldIndex(int descriptor_number) {
3143 DCHECK(GetDetails(descriptor_number).type() == DATA); 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).type() == DATA); 3149 DCHECK(GetDetails(descriptor_number).location() == kField);
3150 return HeapType::cast(GetValue(descriptor_number)); 3150 return HeapType::cast(GetValue(descriptor_number));
3151 } 3151 }
3152 3152
3153 3153
3154 Object* DescriptorArray::GetConstant(int descriptor_number) { 3154 Object* DescriptorArray::GetConstant(int descriptor_number) {
3155 return GetValue(descriptor_number); 3155 return GetValue(descriptor_number);
3156 } 3156 }
3157 3157
3158 3158
3159 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { 3159 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) {
(...skipping 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after
7593 #undef READ_SHORT_FIELD 7593 #undef READ_SHORT_FIELD
7594 #undef WRITE_SHORT_FIELD 7594 #undef WRITE_SHORT_FIELD
7595 #undef READ_BYTE_FIELD 7595 #undef READ_BYTE_FIELD
7596 #undef WRITE_BYTE_FIELD 7596 #undef WRITE_BYTE_FIELD
7597 #undef NOBARRIER_READ_BYTE_FIELD 7597 #undef NOBARRIER_READ_BYTE_FIELD
7598 #undef NOBARRIER_WRITE_BYTE_FIELD 7598 #undef NOBARRIER_WRITE_BYTE_FIELD
7599 7599
7600 } } // namespace v8::internal 7600 } } // namespace v8::internal
7601 7601
7602 #endif // V8_OBJECTS_INL_H_ 7602 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698