Chromium Code Reviews| 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 5202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5213 map->set_transitions(*transitions); | 5213 map->set_transitions(*transitions); |
| 5214 } | 5214 } |
| 5215 | 5215 |
| 5216 | 5216 |
| 5217 LayoutDescriptor* Map::layout_descriptor_gc_safe() { | 5217 LayoutDescriptor* Map::layout_descriptor_gc_safe() { |
| 5218 Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); | 5218 Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); |
| 5219 return LayoutDescriptor::cast_gc_safe(layout_desc); | 5219 return LayoutDescriptor::cast_gc_safe(layout_desc); |
| 5220 } | 5220 } |
| 5221 | 5221 |
| 5222 | 5222 |
| 5223 bool Map::HasFastPointerLayout() const { | |
| 5224 Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); | |
| 5225 return LayoutDescriptor::IsFastPointerLayout(layout_desc); | |
| 5226 } | |
| 5227 | |
| 5228 | |
| 5223 void Map::UpdateDescriptors(DescriptorArray* descriptors, | 5229 void Map::UpdateDescriptors(DescriptorArray* descriptors, |
| 5224 LayoutDescriptor* layout_desc) { | 5230 LayoutDescriptor* layout_desc) { |
| 5225 set_instance_descriptors(descriptors); | 5231 set_instance_descriptors(descriptors); |
| 5226 if (FLAG_unbox_double_fields) { | 5232 if (FLAG_unbox_double_fields) { |
| 5227 if (layout_descriptor()->IsSlowLayout()) { | 5233 if (layout_descriptor()->IsSlowLayout()) { |
| 5228 set_layout_descriptor(layout_desc); | 5234 set_layout_descriptor(layout_desc); |
| 5229 } | 5235 } |
| 5230 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5236 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
| 5231 DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); | 5237 DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); |
| 5232 } | 5238 } |
| (...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7350 v->VisitPointer(HeapObject::RawField(object, offset)); | 7356 v->VisitPointer(HeapObject::RawField(object, offset)); |
| 7351 } | 7357 } |
| 7352 } | 7358 } |
| 7353 } | 7359 } |
| 7354 | 7360 |
| 7355 | 7361 |
| 7356 template<int start_offset, int end_offset, int size> | 7362 template<int start_offset, int end_offset, int size> |
| 7357 void FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody( | 7363 void FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody( |
| 7358 HeapObject* obj, | 7364 HeapObject* obj, |
| 7359 ObjectVisitor* v) { | 7365 ObjectVisitor* v) { |
| 7360 if (!FLAG_unbox_double_fields || | 7366 if (!FLAG_unbox_double_fields || obj->map()->HasFastPointerLayout()) { |
| 7361 obj->map()->layout_descriptor()->IsFastPointerLayout()) { | |
|
Igor Sheludko
2014/11/24 09:32:10
It is not correct to call here layout_descriptor()
| |
| 7362 v->VisitPointers(HeapObject::RawField(obj, start_offset), | 7367 v->VisitPointers(HeapObject::RawField(obj, start_offset), |
| 7363 HeapObject::RawField(obj, end_offset)); | 7368 HeapObject::RawField(obj, end_offset)); |
| 7364 } else { | 7369 } else { |
| 7365 IterateBodyUsingLayoutDescriptor(obj, start_offset, end_offset, v); | 7370 IterateBodyUsingLayoutDescriptor(obj, start_offset, end_offset, v); |
| 7366 } | 7371 } |
| 7367 } | 7372 } |
| 7368 | 7373 |
| 7369 | 7374 |
| 7370 template<int start_offset> | 7375 template<int start_offset> |
| 7371 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj, | 7376 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj, |
| 7372 int object_size, | 7377 int object_size, |
| 7373 ObjectVisitor* v) { | 7378 ObjectVisitor* v) { |
| 7374 if (!FLAG_unbox_double_fields || | 7379 if (!FLAG_unbox_double_fields || obj->map()->HasFastPointerLayout()) { |
| 7375 obj->map()->layout_descriptor()->IsFastPointerLayout()) { | |
| 7376 v->VisitPointers(HeapObject::RawField(obj, start_offset), | 7380 v->VisitPointers(HeapObject::RawField(obj, start_offset), |
| 7377 HeapObject::RawField(obj, object_size)); | 7381 HeapObject::RawField(obj, object_size)); |
| 7378 } else { | 7382 } else { |
| 7379 IterateBodyUsingLayoutDescriptor(obj, start_offset, object_size, v); | 7383 IterateBodyUsingLayoutDescriptor(obj, start_offset, object_size, v); |
| 7380 } | 7384 } |
| 7381 } | 7385 } |
| 7382 | 7386 |
| 7383 | 7387 |
| 7384 template<class Derived, class TableType> | 7388 template<class Derived, class TableType> |
| 7385 Object* OrderedHashTableIterator<Derived, TableType>::CurrentKey() { | 7389 Object* OrderedHashTableIterator<Derived, TableType>::CurrentKey() { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7440 #undef READ_SHORT_FIELD | 7444 #undef READ_SHORT_FIELD |
| 7441 #undef WRITE_SHORT_FIELD | 7445 #undef WRITE_SHORT_FIELD |
| 7442 #undef READ_BYTE_FIELD | 7446 #undef READ_BYTE_FIELD |
| 7443 #undef WRITE_BYTE_FIELD | 7447 #undef WRITE_BYTE_FIELD |
| 7444 #undef NOBARRIER_READ_BYTE_FIELD | 7448 #undef NOBARRIER_READ_BYTE_FIELD |
| 7445 #undef NOBARRIER_WRITE_BYTE_FIELD | 7449 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7446 | 7450 |
| 7447 } } // namespace v8::internal | 7451 } } // namespace v8::internal |
| 7448 | 7452 |
| 7449 #endif // V8_OBJECTS_INL_H_ | 7453 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |