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

Unified Diff: vm/datastream.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 | « no previous file | vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/datastream.h
===================================================================
--- vm/datastream.h (revision 11973)
+++ vm/datastream.h (working copy)
@@ -75,6 +75,22 @@
return Read<intptr_t>(kEndUnsignedByteMarker);
}
+ intptr_t Position() const { return current_ - buffer_; }
+
+ void SetPosition(intptr_t value) {
+ ASSERT((end_ - buffer_) > value);
+ current_ = buffer_ + value;
+ }
+
+ const uint8_t* AddressOfCurrentPosition() const {
+ return current_;
+ }
+
+ void Advance(intptr_t value) {
+ ASSERT((end_ - current_) > value);
+ current_ = current_ + value;
+ }
+
private:
template<typename T>
T Read() {
« no previous file with comments | « no previous file | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698