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

Side by Side Diff: src/heap/heap.cc

Issue 726713003: LayoutDescriptorHelper is now able to calculate the length of contiguous regions of tagged/non-tagg… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 6 years 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 | « no previous file | src/heap/mark-compact.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 // Promote and process all the to-be-promoted objects. 1799 // Promote and process all the to-be-promoted objects.
1800 { 1800 {
1801 StoreBufferRebuildScope scope(this, store_buffer(), 1801 StoreBufferRebuildScope scope(this, store_buffer(),
1802 &ScavengeStoreBufferCallback); 1802 &ScavengeStoreBufferCallback);
1803 while (!promotion_queue()->is_empty()) { 1803 while (!promotion_queue()->is_empty()) {
1804 HeapObject* target; 1804 HeapObject* target;
1805 int size; 1805 int size;
1806 promotion_queue()->remove(&target, &size); 1806 promotion_queue()->remove(&target, &size);
1807 1807
1808 // Promoted object might be already partially visited 1808 // Promoted object might be already partially visited
1809 // during old space pointer iteration. Thus we search specificly 1809 // during old space pointer iteration. Thus we search specifically
1810 // for pointers to from semispace instead of looking for pointers 1810 // for pointers to from semispace instead of looking for pointers
1811 // to new space. 1811 // to new space.
1812 DCHECK(!target->IsMap()); 1812 DCHECK(!target->IsMap());
1813 Address start_address = target->address(); 1813 Address obj_address = target->address();
1814 Address end_address = start_address + size;
1815 #if V8_DOUBLE_FIELDS_UNBOXING 1814 #if V8_DOUBLE_FIELDS_UNBOXING
1816 InobjectPropertiesHelper helper(target->map()); 1815 LayoutDescriptorHelper helper(target->map());
1817 bool has_only_tagged_fields = helper.all_fields_tagged(); 1816 bool has_only_tagged_fields = helper.all_fields_tagged();
1818 1817
1819 if (!has_only_tagged_fields) { 1818 if (!has_only_tagged_fields) {
1820 for (Address slot = start_address; slot < end_address; 1819 for (int offset = 0; offset < size;) {
1821 slot += kPointerSize) { 1820 int end_of_region_offset;
1822 if (helper.IsTagged(static_cast<int>(slot - start_address))) { 1821 if (helper.IsTagged(offset, size, &end_of_region_offset)) {
1823 // TODO(ishell): call this once for contiguous region 1822 IterateAndMarkPointersToFromSpace(
1824 // of tagged fields. 1823 obj_address + offset, obj_address + end_of_region_offset,
1825 IterateAndMarkPointersToFromSpace(slot, slot + kPointerSize, 1824 &ScavengeObject);
1826 &ScavengeObject);
1827 } 1825 }
1826 offset = end_of_region_offset;
1828 } 1827 }
1829 } else { 1828 } else {
1830 #endif 1829 #endif
1831 IterateAndMarkPointersToFromSpace(start_address, end_address, 1830 IterateAndMarkPointersToFromSpace(obj_address, obj_address + size,
1832 &ScavengeObject); 1831 &ScavengeObject);
1833 #if V8_DOUBLE_FIELDS_UNBOXING 1832 #if V8_DOUBLE_FIELDS_UNBOXING
1834 } 1833 }
1835 #endif 1834 #endif
1836 } 1835 }
1837 } 1836 }
1838 1837
1839 // Take another spin if there are now unswept objects in new space 1838 // Take another spin if there are now unswept objects in new space
1840 // (there are currently no more unswept promoted objects). 1839 // (there are currently no more unswept promoted objects).
1841 } while (new_space_front != new_space_.top()); 1840 } while (new_space_front != new_space_.top());
(...skipping 4554 matching lines...) Expand 10 before | Expand all | Expand 10 after
6396 static_cast<int>(object_sizes_last_time_[index])); 6395 static_cast<int>(object_sizes_last_time_[index]));
6397 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6396 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6398 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6397 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6399 6398
6400 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6399 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6401 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6400 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6402 ClearObjectStats(); 6401 ClearObjectStats();
6403 } 6402 }
6404 } 6403 }
6405 } // namespace v8::internal 6404 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698