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

Unified Diff: runtime/vm/snapshot.cc

Issue 1012333002: Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « runtime/vm/snapshot.h ('k') | runtime/vm/snapshot_test.cc » ('j') | 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 44579)
+++ runtime/vm/snapshot.cc (working copy)
@@ -164,10 +164,12 @@
SnapshotReader::SnapshotReader(const uint8_t* buffer,
intptr_t size,
Snapshot::Kind kind,
- Isolate* isolate)
+ Isolate* isolate,
+ Zone* zone)
: BaseReader(buffer, size),
kind_(kind),
isolate_(isolate),
+ zone_(zone),
heap_(isolate->heap()),
old_space_(isolate->heap()->old_space()),
cls_(Class::Handle(isolate)),
@@ -219,7 +221,7 @@
!IsSingletonClassId(GetVMIsolateObjectId(class_header)));
ASSERT((SerializedHeaderTag::decode(class_header) != kObjectId) ||
!IsObjectStoreClassId(SerializedHeaderData::decode(class_header)));
- Class& cls = Class::ZoneHandle(isolate(), Class::null());
+ Class& cls = Class::ZoneHandle(zone(), Class::null());
AddBackRef(object_id, &cls, kIsDeserialized);
// Read the library/class information and lookup the class.
str_ ^= ReadObjectImpl(class_header);
@@ -244,7 +246,7 @@
// First create a function object and associate it with the specified
// 'object_id'.
Function& func = Function::Handle(isolate(), Function::null());
- Instance& obj = Instance::ZoneHandle(isolate(), Instance::null());
+ Instance& obj = Instance::ZoneHandle(zone(), Instance::null());
AddBackRef(object_id, &obj, kIsDeserialized);
// Read the library/class/function information and lookup the function.
@@ -356,7 +358,7 @@
// instance of it. The individual fields will be read later.
intptr_t header_id = SerializedHeaderData::decode(class_header);
if (header_id == kInstanceObjectId) {
- Instance& result = Instance::ZoneHandle(isolate(), Instance::null());
+ Instance& result = Instance::ZoneHandle(zone(), Instance::null());
AddBackRef(object_id, &result, kIsNotDeserialized);
cls_ ^= ReadObjectImpl(); // Read class information.
@@ -385,7 +387,7 @@
// Read the length and allocate an object based on the len.
intptr_t len = ReadSmiValue();
Array& array = Array::ZoneHandle(
- isolate(),
+ zone(),
((kind_ == Snapshot::kFull) ?
NewArray(len) : Array::New(len, HEAP_SPACE(kind_))));
AddBackRef(object_id, &array, kIsNotDeserialized);
@@ -396,7 +398,7 @@
// Read the length and allocate an object based on the len.
intptr_t len = ReadSmiValue();
Array& array = Array::ZoneHandle(
- isolate(),
+ zone(),
(kind_ == Snapshot::kFull) ?
NewImmutableArray(len) : ImmutableArray::New(len, HEAP_SPACE(kind_)));
AddBackRef(object_id, &array, kIsNotDeserialized);
@@ -992,7 +994,7 @@
Instance* result = reinterpret_cast<Instance*>(GetBackRef(object_id));
intptr_t instance_size = 0;
if (result == NULL) {
- result = &(Instance::ZoneHandle(isolate(), Instance::null()));
+ result = &(Instance::ZoneHandle(zone(), Instance::null()));
AddBackRef(object_id, result, kIsDeserialized);
cls_ ^= ReadObjectImpl();
ASSERT(!cls_.IsNull());
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698