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 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 int value = pretenure_data()->value(); | 1805 int value = pretenure_data()->value(); |
1806 return MementoFoundCountBits::decode(value); | 1806 return MementoFoundCountBits::decode(value); |
1807 } | 1807 } |
1808 | 1808 |
1809 | 1809 |
1810 inline void AllocationSite::set_memento_found_count(int count) { | 1810 inline void AllocationSite::set_memento_found_count(int count) { |
1811 int value = pretenure_data()->value(); | 1811 int value = pretenure_data()->value(); |
1812 // Verify that we can count more mementos than we can possibly find in one | 1812 // Verify that we can count more mementos than we can possibly find in one |
1813 // new space collection. | 1813 // new space collection. |
1814 DCHECK((GetHeap()->MaxSemiSpaceSize() / | 1814 DCHECK((GetHeap()->MaxSemiSpaceSize() / |
1815 (StaticVisitorBase::kMinObjectSizeInWords * kPointerSize + | 1815 (Heap::kMinObjectSizeInWords * kPointerSize + |
1816 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); | 1816 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); |
1817 DCHECK(count < MementoFoundCountBits::kMax); | 1817 DCHECK(count < MementoFoundCountBits::kMax); |
1818 set_pretenure_data( | 1818 set_pretenure_data( |
1819 Smi::FromInt(MementoFoundCountBits::update(value, count)), | 1819 Smi::FromInt(MementoFoundCountBits::update(value, count)), |
1820 SKIP_WRITE_BARRIER); | 1820 SKIP_WRITE_BARRIER); |
1821 } | 1821 } |
1822 | 1822 |
1823 | 1823 |
1824 int AllocationSite::memento_create_count() { | 1824 int AllocationSite::memento_create_count() { |
1825 return pretenure_create_count()->value(); | 1825 return pretenure_create_count()->value(); |
(...skipping 3529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 LayoutDescriptor* layout_desc) { | 5355 LayoutDescriptor* layout_desc) { |
5356 set_instance_descriptors(descriptors); | 5356 set_instance_descriptors(descriptors); |
5357 if (FLAG_unbox_double_fields) { | 5357 if (FLAG_unbox_double_fields) { |
5358 if (layout_descriptor()->IsSlowLayout()) { | 5358 if (layout_descriptor()->IsSlowLayout()) { |
5359 set_layout_descriptor(layout_desc); | 5359 set_layout_descriptor(layout_desc); |
5360 } | 5360 } |
5361 #ifdef VERIFY_HEAP | 5361 #ifdef VERIFY_HEAP |
5362 // TODO(ishell): remove these checks from VERIFY_HEAP mode. | 5362 // TODO(ishell): remove these checks from VERIFY_HEAP mode. |
5363 if (FLAG_verify_heap) { | 5363 if (FLAG_verify_heap) { |
5364 CHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5364 CHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5365 CHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); | 5365 CHECK(visitor_id() == Heap::GetStaticVisitorIdForMap(this)); |
5366 } | 5366 } |
5367 #else | 5367 #else |
5368 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5368 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5369 DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); | 5369 DCHECK(visitor_id() == Heap::GetStaticVisitorIdForMap(this)); |
5370 #endif | 5370 #endif |
5371 } | 5371 } |
5372 } | 5372 } |
5373 | 5373 |
5374 | 5374 |
5375 void Map::InitializeDescriptors(DescriptorArray* descriptors, | 5375 void Map::InitializeDescriptors(DescriptorArray* descriptors, |
5376 LayoutDescriptor* layout_desc) { | 5376 LayoutDescriptor* layout_desc) { |
5377 int len = descriptors->number_of_descriptors(); | 5377 int len = descriptors->number_of_descriptors(); |
5378 set_instance_descriptors(descriptors); | 5378 set_instance_descriptors(descriptors); |
5379 SetNumberOfOwnDescriptors(len); | 5379 SetNumberOfOwnDescriptors(len); |
5380 | 5380 |
5381 if (FLAG_unbox_double_fields) { | 5381 if (FLAG_unbox_double_fields) { |
5382 set_layout_descriptor(layout_desc); | 5382 set_layout_descriptor(layout_desc); |
5383 #ifdef VERIFY_HEAP | 5383 #ifdef VERIFY_HEAP |
5384 // TODO(ishell): remove these checks from VERIFY_HEAP mode. | 5384 // TODO(ishell): remove these checks from VERIFY_HEAP mode. |
5385 if (FLAG_verify_heap) { | 5385 if (FLAG_verify_heap) { |
5386 CHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5386 CHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5387 } | 5387 } |
5388 #else | 5388 #else |
5389 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5389 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5390 #endif | 5390 #endif |
5391 set_visitor_id(StaticVisitorBase::GetVisitorId(this)); | 5391 set_visitor_id(Heap::GetStaticVisitorIdForMap(this)); |
5392 } | 5392 } |
5393 } | 5393 } |
5394 | 5394 |
5395 | 5395 |
5396 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) | 5396 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) |
5397 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) | 5397 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) |
5398 | 5398 |
5399 | 5399 |
5400 void Map::set_bit_field3(uint32_t bits) { | 5400 void Map::set_bit_field3(uint32_t bits) { |
5401 if (kInt32Size != kPointerSize) { | 5401 if (kInt32Size != kPointerSize) { |
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7905 #undef READ_INT64_FIELD | 7905 #undef READ_INT64_FIELD |
7906 #undef WRITE_INT64_FIELD | 7906 #undef WRITE_INT64_FIELD |
7907 #undef READ_BYTE_FIELD | 7907 #undef READ_BYTE_FIELD |
7908 #undef WRITE_BYTE_FIELD | 7908 #undef WRITE_BYTE_FIELD |
7909 #undef NOBARRIER_READ_BYTE_FIELD | 7909 #undef NOBARRIER_READ_BYTE_FIELD |
7910 #undef NOBARRIER_WRITE_BYTE_FIELD | 7910 #undef NOBARRIER_WRITE_BYTE_FIELD |
7911 | 7911 |
7912 } } // namespace v8::internal | 7912 } } // namespace v8::internal |
7913 | 7913 |
7914 #endif // V8_OBJECTS_INL_H_ | 7914 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |