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

Unified Diff: src/serialize.cc

Issue 944923005: Use easier method to determine allocation space when serializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comment Created 5 years, 10 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/serialize.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 05a54188b86cfbeef9bc010a083fcad001d9adb5..8a383db1430dd273a2728aeded5794c705c69f2d 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1888,7 +1888,9 @@ void Serializer::ObjectSerializer::Serialize() {
int size = object_->Size();
Map* map = object_->map();
- SerializePrologue(Serializer::SpaceOfObject(object_), size, map);
+ AllocationSpace space =
+ MemoryChunk::FromAddress(object_->address())->owner()->identity();
+ SerializePrologue(space, size, map);
// Serialize the rest of the object.
CHECK_EQ(0, bytes_processed_so_far_);
@@ -2128,19 +2130,6 @@ int Serializer::ObjectSerializer::OutputRawData(
}
-AllocationSpace Serializer::SpaceOfObject(HeapObject* object) {
- for (int i = FIRST_SPACE; i <= LAST_SPACE; i++) {
- AllocationSpace s = static_cast<AllocationSpace>(i);
- if (object->GetHeap()->InSpace(object, s)) {
- DCHECK(i < kNumberOfSpaces);
- return s;
- }
- }
- UNREACHABLE();
- return FIRST_SPACE;
-}
-
-
BackReference Serializer::AllocateLargeObject(int size) {
// Large objects are allocated one-by-one when deserializing. We do not
// have to keep track of multiple chunks.
« no previous file with comments | « src/serialize.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698