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

Side by Side Diff: vm/snapshot.h

Issue 10967044: Fix the types used in bit fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 | « vm/raw_object_snapshot.cc ('k') | no next file » | 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_SNAPSHOT_H_ 5 #ifndef VM_SNAPSHOT_H_
6 #define VM_SNAPSHOT_H_ 6 #define VM_SNAPSHOT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/bitfield.h" 10 #include "vm/bitfield.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // sizeof(T) must be in {1,2,4,8}. 158 // sizeof(T) must be in {1,2,4,8}.
159 template <typename T> 159 template <typename T>
160 T Read() { 160 T Read() {
161 return ReadStream::Raw<sizeof(T), T>::Read(&stream_); 161 return ReadStream::Raw<sizeof(T), T>::Read(&stream_);
162 } 162 }
163 163
164 // Reads an intptr_t type value. 164 // Reads an intptr_t type value.
165 intptr_t ReadIntptrValue() { 165 intptr_t ReadIntptrValue() {
166 int64_t value = Read<int64_t>(); 166 int64_t value = Read<int64_t>();
167 ASSERT((value <= kIntptrMax) && (value >= kIntptrMin)); 167 ASSERT((value <= kIntptrMax) && (value >= kIntptrMin));
168 return value; 168 return static_cast<intptr_t>(value);
169 } 169 }
170 170
171 void ReadBytes(uint8_t* addr, intptr_t len) { 171 void ReadBytes(uint8_t* addr, intptr_t len) {
172 stream_.ReadBytes(addr, len); 172 stream_.ReadBytes(addr, len);
173 } 173 }
174 174
175 const uint8_t* CurrentBufferAddress() const { 175 const uint8_t* CurrentBufferAddress() const {
176 return stream_.AddressOfCurrentPosition(); 176 return stream_.AddressOfCurrentPosition();
177 } 177 }
178 178
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 private: 570 private:
571 SnapshotWriter* writer_; 571 SnapshotWriter* writer_;
572 bool as_references_; 572 bool as_references_;
573 573
574 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 574 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
575 }; 575 };
576 576
577 } // namespace dart 577 } // namespace dart
578 578
579 #endif // VM_SNAPSHOT_H_ 579 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698