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. |