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

Unified Diff: vm/snapshot.h

Issue 10914050: Use external byte arrays for token stream, this moves the token stream out of the isolate heap. For… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 11973)
+++ vm/snapshot.h (working copy)
@@ -22,6 +22,7 @@
class Array;
class Class;
class ClassTable;
+class ExternalUint8Array;
class GrowableObjectArray;
class Heap;
class Library;
@@ -56,6 +57,7 @@
class RawTwoByteString;
class RawUnresolvedClass;
class String;
+class TokenStream;
// Serialized object header encoding is as follows:
// - Smi: the Smi value is written as is (last bit is not tagged).
@@ -169,6 +171,14 @@
stream_.ReadBytes(addr, len);
}
+ const uint8_t* CurrentBufferAddress() const {
+ return stream_.AddressOfCurrentPosition();
+ }
+
+ void Advance(intptr_t value) {
+ stream_.Advance(value);
+ }
+
RawSmi* ReadAsSmi();
intptr_t ReadSmiValue();
@@ -204,6 +214,8 @@
AbstractType* TypeHandle() { return &type_; }
AbstractTypeArguments* TypeArgumentsHandle() { return &type_arguments_; }
Array* TokensHandle() { return &tokens_; }
+ TokenStream* StreamHandle() { return &stream_; }
+ ExternalUint8Array* DataHandle() { return &data_; }
// Reads an object.
RawObject* ReadObject();
@@ -294,6 +306,8 @@
AbstractType& type_; // Temporary type handle.
AbstractTypeArguments& type_arguments_; // Temporary type argument handle.
Array& tokens_; // Temporary tokens handle.
+ TokenStream& stream_; // Temporary token stream handle.
+ ExternalUint8Array& data_; // Temporary stream data handle.
GrowableArray<BackRefNode*> backward_references_;
friend class ApiError;
« 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