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

Unified Diff: src/address-map.h

Issue 2229583003: [serializer] reserve maps one by one to avoid fragmentation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix build Created 4 years, 4 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 | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/address-map.h
diff --git a/src/address-map.h b/src/address-map.h
index ce2170576a89025b6377658ec22779bb6f848b3c..0ce93d24e898fb69eeab3541b47b7971343e5c51 100644
--- a/src/address-map.h
+++ b/src/address-map.h
@@ -77,6 +77,11 @@ class SerializerReference {
ChunkOffsetBits::encode(chunk_offset >> kObjectAlignmentBits));
}
+ static SerializerReference MapReference(uint32_t index) {
+ return SerializerReference(SpaceBits::encode(MAP_SPACE) |
+ ValueIndexBits::encode(index));
+ }
+
static SerializerReference LargeObjectReference(uint32_t index) {
return SerializerReference(SpaceBits::encode(LO_SPACE) |
ValueIndexBits::encode(index));
@@ -107,10 +112,14 @@ class SerializerReference {
return ChunkOffsetBits::decode(bitfield_) << kObjectAlignmentBits;
}
+ uint32_t map_index() const {
+ DCHECK(is_back_reference());
+ return ValueIndexBits::decode(bitfield_);
+ }
+
uint32_t large_object_index() const {
DCHECK(is_back_reference());
- DCHECK(chunk_index() == 0);
- return ChunkOffsetBits::decode(bitfield_);
+ return ValueIndexBits::decode(bitfield_);
}
uint32_t chunk_index() const {
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698