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

Side by Side Diff: runtime/vm/datastream.h

Issue 522893002: Change snapshot versioning code to use plain strings instead of Dart strings (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_DATASTREAM_H_ 5 #ifndef VM_DATASTREAM_H_
6 #define VM_DATASTREAM_H_ 6 #define VM_DATASTREAM_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/utils.h" 9 #include "platform/utils.h"
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 const uint8_t* AddressOfCurrentPosition() const { 92 const uint8_t* AddressOfCurrentPosition() const {
93 return current_; 93 return current_;
94 } 94 }
95 95
96 void Advance(intptr_t value) { 96 void Advance(intptr_t value) {
97 ASSERT((end_ - current_) > value); 97 ASSERT((end_ - current_) > value);
98 current_ = current_ + value; 98 current_ = current_ + value;
99 } 99 }
100 100
101 intptr_t PendingBytes() const {
102 ASSERT(end_ >= current_);
103 return (end_ - current_);
104 }
105
101 private: 106 private:
102 template<typename T> 107 template<typename T>
103 T Read() { 108 T Read() {
104 return Read<T>(kEndByteMarker); 109 return Read<T>(kEndByteMarker);
105 } 110 }
106 111
107 int16_t Read16() { 112 int16_t Read16() {
108 return Read16(kEndByteMarker); 113 return Read16(kEndByteMarker);
109 } 114 }
110 115
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 intptr_t current_size_; 433 intptr_t current_size_;
429 ReAlloc alloc_; 434 ReAlloc alloc_;
430 intptr_t initial_size_; 435 intptr_t initial_size_;
431 436
432 DISALLOW_COPY_AND_ASSIGN(WriteStream); 437 DISALLOW_COPY_AND_ASSIGN(WriteStream);
433 }; 438 };
434 439
435 } // namespace dart 440 } // namespace dart
436 441
437 #endif // VM_DATASTREAM_H_ 442 #endif // VM_DATASTREAM_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698