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

Unified Diff: vm/snapshot.h

Issue 9139067: Use special allocation functions for object creation while deserializing from a full snapshot in ... (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 3378)
+++ vm/snapshot.h (working copy)
@@ -23,8 +23,26 @@
class Library;
class Object;
class ObjectStore;
+class RawArray;
class RawClass;
+class RawContext;
+class RawDouble;
+class RawField;
+class RawFourByteString;
+class RawFunction;
+class RawImmutableArray;
+class RawLibrary;
+class RawLibraryPrefix;
+class RawMint;
class RawObject;
+class RawOneByteString;
+class RawScript;
+class RawTokenStream;
+class RawType;
+class RawTypeParameter;
+class RawTypeArguments;
+class RawTwoByteString;
+class RawUnresolvedClass;
class String;
static const int8_t kSerializedBitsPerByte = 7;
@@ -319,7 +337,33 @@
// Read a full snap shot.
void ReadFullSnapshot();
+ // Helper functions for creating uninitialized versions
+ // of various object types. These are used when reading a
+ // full snapshot.
+ RawArray* NewArray(intptr_t len);
+ RawImmutableArray* NewImmutableArray(intptr_t len);
+ RawOneByteString* NewOneByteString(intptr_t len);
+ RawTwoByteString* NewTwoByteString(intptr_t len);
+ RawFourByteString* NewFourByteString(intptr_t len);
+ RawTypeArguments* NewTypeArguments(intptr_t len);
+ RawTokenStream* NewTokenStream(intptr_t len);
+ RawContext* NewContext(intptr_t num_variables);
+ RawClass* NewClass(int value);
+ RawMint* NewMint(int64_t value);
+ RawDouble* NewDouble(double value);
+ RawUnresolvedClass* NewUnresolvedClass();
+ RawType* NewType();
+ RawTypeParameter* NewTypeParameter();
+ RawFunction* NewFunction();
+ RawField* NewField();
+ RawLibrary* NewLibrary();
+ RawLibraryPrefix* NewLibraryPrefix();
+ RawScript* NewScript();
+
private:
+ // Allocate uninitialized objects, this is used when reading a full snapshot.
+ RawObject* AllocateUninitialized(const Class& cls, intptr_t size);
+
// Internal implementation of ReadObject once the header value is read.
RawObject* ReadObjectImpl(intptr_t header);
« 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