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

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: Prototype transitions printing removed 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
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698