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

Unified Diff: vm/snapshot.h

Issue 9166012: Create temporary handles in the snapshot object during initialization and use them instead of cre... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 11 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 | « vm/raw_object_snapshot.cc ('k') | vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/snapshot.h
===================================================================
--- vm/snapshot.h (revision 3160)
+++ vm/snapshot.h (working copy)
@@ -16,12 +16,16 @@
namespace dart {
// Forward declarations.
+class AbstractType;
+class AbstractTypeArguments;
+class Class;
class Heap;
class Library;
class Object;
class ObjectStore;
class RawClass;
class RawObject;
+class String;
static const int8_t kSerializedBitsPerByte = 7;
static const int8_t kMaxSerializedUnsignedValuePerByte = 127;
@@ -279,11 +283,7 @@
// Reads a snapshot into objects.
class SnapshotReader {
public:
- SnapshotReader(const Snapshot* snapshot, Isolate* isolate)
- : stream_(snapshot->content(), snapshot->length()),
- kind_(snapshot->kind()),
- isolate_(isolate),
- backward_references_() { }
+ SnapshotReader(const Snapshot* snapshot, Isolate* isolate);
~SnapshotReader() { }
// Reads raw data (for basic types).
@@ -303,6 +303,10 @@
Isolate* isolate() const { return isolate_; }
Heap* heap() const { return isolate_->heap(); }
ObjectStore* object_store() const { return isolate_->object_store(); }
+ Object* ObjectHandle() { return &obj_; }
+ String* StringHandle() { return &str_; }
+ AbstractType* TypeHandle() { return &type_; }
+ AbstractTypeArguments* TypeArgumentsHandle() { return &type_arguments_; }
// Reads an object.
RawObject* ReadObject();
@@ -332,6 +336,12 @@
ReadStream stream_; // input stream.
Snapshot::Kind kind_; // Indicates type of snapshot(full, script, message).
Isolate* isolate_; // Current isolate.
+ Class& cls_; // Temporary Class handle.
+ Object& obj_; // Temporary Object handle.
+ String& str_; // Temporary String handle.
+ Library& library_; // Temporary library handle.
+ AbstractType& type_; // Temporary type handle.
+ AbstractTypeArguments& type_arguments_; // Temporary type argument handle.
GrowableArray<Object*> backward_references_;
DISALLOW_COPY_AND_ASSIGN(SnapshotReader);
« no previous file with comments | « vm/raw_object_snapshot.cc ('k') | vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698