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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 416bcc82862bf4dcb403cc75a5afcf3daa2d4c32..2e90174ba019021814d2b576e4b1be4e35cde7c4 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1806,29 +1806,28 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
promotion_queue()->remove(&target, &size);
// Promoted object might be already partially visited
- // during old space pointer iteration. Thus we search specificly
+ // during old space pointer iteration. Thus we search specifically
// for pointers to from semispace instead of looking for pointers
// to new space.
DCHECK(!target->IsMap());
- Address start_address = target->address();
- Address end_address = start_address + size;
+ Address obj_address = target->address();
#if V8_DOUBLE_FIELDS_UNBOXING
- InobjectPropertiesHelper helper(target->map());
+ LayoutDescriptorHelper helper(target->map());
bool has_only_tagged_fields = helper.all_fields_tagged();
if (!has_only_tagged_fields) {
- for (Address slot = start_address; slot < end_address;
- slot += kPointerSize) {
- if (helper.IsTagged(static_cast<int>(slot - start_address))) {
- // TODO(ishell): call this once for contiguous region
- // of tagged fields.
- IterateAndMarkPointersToFromSpace(slot, slot + kPointerSize,
- &ScavengeObject);
+ for (int offset = 0; offset < size;) {
+ int end_of_region_offset;
+ if (helper.IsTagged(offset, size, &end_of_region_offset)) {
+ IterateAndMarkPointersToFromSpace(
+ obj_address + offset, obj_address + end_of_region_offset,
+ &ScavengeObject);
}
+ offset = end_of_region_offset;
}
} else {
#endif
- IterateAndMarkPointersToFromSpace(start_address, end_address,
+ IterateAndMarkPointersToFromSpace(obj_address, obj_address + size,
&ScavengeObject);
#if V8_DOUBLE_FIELDS_UNBOXING
}
« 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