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

Unified Diff: runtime/vm/snapshot.cc

Issue 10867046: Use Heap::kOld when allocating objects for script snapshots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« runtime/vm/raw_object_snapshot.cc ('K') | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 11276)
+++ runtime/vm/snapshot.cc (working copy)
@@ -114,6 +114,11 @@
}
+static Heap::Space space(Snapshot::Kind kind) {
cshapiro 2012/08/25 03:30:11 Is this change missing heap.h or am I confused? L
siva 2012/08/27 17:15:21 I would have preferred to put this in snapshot.h b
+ return (kind == Snapshot::kMessage) ? Heap::kNew : Heap::kOld;
+}
+
+
// TODO(5411462): Temporary setup of snapshot for testing purposes,
// the actual creation of a snapshot maybe done differently.
const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) {
@@ -198,7 +203,7 @@
RawObject* SnapshotReader::ReadObjectImpl() {
int64_t value = Read<int64_t>();
if ((value & kSmiTagMask) == 0) {
- return Integer::New((value >> kSmiTagShift));
+ return Integer::New((value >> kSmiTagShift), space(kind_));
}
return ReadObjectImpl(value);
}
@@ -221,7 +226,7 @@
RawObject* SnapshotReader::ReadObjectRef() {
int64_t header_value = Read<int64_t>();
if ((header_value & kSmiTagMask) == 0) {
- return Integer::New((header_value >> kSmiTagShift));
+ return Integer::New((header_value >> kSmiTagShift), space(kind_));
}
ASSERT((header_value <= kIntptrMax) && (header_value >= kIntptrMin));
if (IsVMIsolateObject(header_value)) {
@@ -250,7 +255,7 @@
if (kind_ == Snapshot::kFull) {
result ^= AllocateUninitialized(cls_, instance_size);
} else {
- result ^= Object::Allocate(cls_.id(), instance_size, Heap::kNew);
+ result ^= Object::Allocate(cls_.id(), instance_size, space(kind_));
}
return result.raw();
}
@@ -266,7 +271,8 @@
intptr_t len = ReadSmiValue();
Array& array = Array::ZoneHandle(
isolate(),
- (kind_ == Snapshot::kFull) ? NewArray(len) : Array::New(len));
+ ((kind_ == Snapshot::kFull) ?
+ NewArray(len) : Array::New(len, space(kind_))));
AddBackRef(object_id, &array, kIsNotDeserialized);
return array.raw();
@@ -277,7 +283,7 @@
ImmutableArray& array = ImmutableArray::ZoneHandle(
isolate(),
(kind_ == Snapshot::kFull) ?
- NewImmutableArray(len) : ImmutableArray::New(len));
+ NewImmutableArray(len) : ImmutableArray::New(len, space(kind_)));
AddBackRef(object_id, &array, kIsNotDeserialized);
return array.raw();
@@ -661,7 +667,7 @@
if (kind_ == Snapshot::kFull) {
*result ^= AllocateUninitialized(cls_, instance_size);
} else {
- *result ^= Object::Allocate(cls_.id(), instance_size, Heap::kNew);
+ *result ^= Object::Allocate(cls_.id(), instance_size, space(kind_));
}
} else {
cls_ ^= ReadObjectImpl();
« runtime/vm/raw_object_snapshot.cc ('K') | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698