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

Unified Diff: src/heap/spaces.h

Issue 1816463002: [heap] Fix skip list for deserialized code objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: added comment Created 4 years, 9 months 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 | « src/heap/heap.cc ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 46bfd3d71960801e88ff83451417608e4db80bb3..339a13164440378b96ecc31bec0dc143d4752680 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -1200,7 +1200,14 @@ class SkipList {
int start_region = RegionNumber(addr);
int end_region = RegionNumber(addr + size - kPointerSize);
for (int idx = start_region; idx <= end_region; idx++) {
- if (starts_[idx] > addr) starts_[idx] = addr;
+ if (starts_[idx] > addr) {
+ starts_[idx] = addr;
+ } else {
+ // In the first region, there may already be an object closer to the
+ // start of the region. Do not change the start in that case. If this
+ // is not the first region, you probably added overlapping objects.
+ DCHECK_EQ(start_region, idx);
+ }
}
}
@@ -2038,10 +2045,13 @@ class PagedSpace : public Space {
return allocation_info_.limit_address();
}
+ enum UpdateSkipList { UPDATE_SKIP_LIST, IGNORE_SKIP_LIST };
+
// Allocate the requested number of bytes in the space if possible, return a
- // failure object if not.
+ // failure object if not. Only use IGNORE_SKIP_LIST if the skip list is going
+ // to be manually updated later.
MUST_USE_RESULT inline AllocationResult AllocateRawUnaligned(
- int size_in_bytes);
+ int size_in_bytes, UpdateSkipList update_skip_list = UPDATE_SKIP_LIST);
MUST_USE_RESULT inline AllocationResult AllocateRawUnalignedSynchronized(
int size_in_bytes);
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698