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 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5417 | 5417 |
5418 | 5418 |
5419 void Map::set_prototype(Object* value, WriteBarrierMode mode) { | 5419 void Map::set_prototype(Object* value, WriteBarrierMode mode) { |
5420 DCHECK(value->IsNull(GetIsolate()) || value->IsJSReceiver()); | 5420 DCHECK(value->IsNull(GetIsolate()) || value->IsJSReceiver()); |
5421 WRITE_FIELD(this, kPrototypeOffset, value); | 5421 WRITE_FIELD(this, kPrototypeOffset, value); |
5422 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode); | 5422 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode); |
5423 } | 5423 } |
5424 | 5424 |
5425 | 5425 |
5426 LayoutDescriptor* Map::layout_descriptor_gc_safe() { | 5426 LayoutDescriptor* Map::layout_descriptor_gc_safe() { |
5427 Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); | 5427 Object* layout_desc = READ_FIELD(this, kLayoutDescriptorOffset); |
5428 return LayoutDescriptor::cast_gc_safe(layout_desc); | 5428 return LayoutDescriptor::cast_gc_safe(layout_desc); |
5429 } | 5429 } |
5430 | 5430 |
5431 | 5431 |
5432 bool Map::HasFastPointerLayout() const { | 5432 bool Map::HasFastPointerLayout() const { |
5433 Object* layout_desc = READ_FIELD(this, kLayoutDecriptorOffset); | 5433 Object* layout_desc = READ_FIELD(this, kLayoutDescriptorOffset); |
5434 return LayoutDescriptor::IsFastPointerLayout(layout_desc); | 5434 return LayoutDescriptor::IsFastPointerLayout(layout_desc); |
5435 } | 5435 } |
5436 | 5436 |
5437 | 5437 |
5438 void Map::UpdateDescriptors(DescriptorArray* descriptors, | 5438 void Map::UpdateDescriptors(DescriptorArray* descriptors, |
5439 LayoutDescriptor* layout_desc) { | 5439 LayoutDescriptor* layout_desc) { |
5440 set_instance_descriptors(descriptors); | 5440 set_instance_descriptors(descriptors); |
5441 if (FLAG_unbox_double_fields) { | 5441 if (FLAG_unbox_double_fields) { |
5442 if (layout_descriptor()->IsSlowLayout()) { | 5442 if (layout_descriptor()->IsSlowLayout()) { |
5443 set_layout_descriptor(layout_desc); | 5443 set_layout_descriptor(layout_desc); |
(...skipping 27 matching lines...) Expand all Loading... |
5471 } | 5471 } |
5472 #else | 5472 #else |
5473 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5473 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5474 #endif | 5474 #endif |
5475 set_visitor_id(Heap::GetStaticVisitorIdForMap(this)); | 5475 set_visitor_id(Heap::GetStaticVisitorIdForMap(this)); |
5476 } | 5476 } |
5477 } | 5477 } |
5478 | 5478 |
5479 | 5479 |
5480 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) | 5480 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) |
5481 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) | 5481 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDescriptorOffset) |
5482 | |
5483 | 5482 |
5484 void Map::set_bit_field3(uint32_t bits) { | 5483 void Map::set_bit_field3(uint32_t bits) { |
5485 if (kInt32Size != kPointerSize) { | 5484 if (kInt32Size != kPointerSize) { |
5486 WRITE_UINT32_FIELD(this, kBitField3Offset + kInt32Size, 0); | 5485 WRITE_UINT32_FIELD(this, kBitField3Offset + kInt32Size, 0); |
5487 } | 5486 } |
5488 WRITE_UINT32_FIELD(this, kBitField3Offset, bits); | 5487 WRITE_UINT32_FIELD(this, kBitField3Offset, bits); |
5489 } | 5488 } |
5490 | 5489 |
5491 | 5490 |
5492 uint32_t Map::bit_field3() const { | 5491 uint32_t Map::bit_field3() const { |
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8196 #undef WRITE_INT64_FIELD | 8195 #undef WRITE_INT64_FIELD |
8197 #undef READ_BYTE_FIELD | 8196 #undef READ_BYTE_FIELD |
8198 #undef WRITE_BYTE_FIELD | 8197 #undef WRITE_BYTE_FIELD |
8199 #undef NOBARRIER_READ_BYTE_FIELD | 8198 #undef NOBARRIER_READ_BYTE_FIELD |
8200 #undef NOBARRIER_WRITE_BYTE_FIELD | 8199 #undef NOBARRIER_WRITE_BYTE_FIELD |
8201 | 8200 |
8202 } // namespace internal | 8201 } // namespace internal |
8203 } // namespace v8 | 8202 } // namespace v8 |
8204 | 8203 |
8205 #endif // V8_OBJECTS_INL_H_ | 8204 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |