OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assert.h" | 9 #include "vm/assert.h" |
10 #include "vm/bitfield.h" | 10 #include "vm/bitfield.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 | 348 |
349 // Writes raw data to the stream (basic type). | 349 // Writes raw data to the stream (basic type). |
350 // sizeof(T) must be in {1,2,4,8}. | 350 // sizeof(T) must be in {1,2,4,8}. |
351 template <typename T> | 351 template <typename T> |
352 void Write(T value) { | 352 void Write(T value) { |
353 WriteStream::Raw<sizeof(T), T>::Write(&stream_, value); | 353 WriteStream::Raw<sizeof(T), T>::Write(&stream_, value); |
354 } | 354 } |
355 | 355 |
356 // Writes an intptr_t type value out. | 356 // Writes an intptr_t type value out. |
357 void WriteIntptrValue(intptr_t value) { | 357 void WriteIntptrValue(intptr_t value) { |
358 Write<int64_t>(value); | 358 Write<int64_t>(static_cast<int64_t>(value)); |
siva
2012/01/03 22:55:17
Is this cast necessary, isn't there an implicit ca
| |
359 } | 359 } |
360 | 360 |
361 // Write an object that is serialized as an Id (singleton, object store, | 361 // Write an object that is serialized as an Id (singleton, object store, |
362 // or an object that was already serialized before). | 362 // or an object that was already serialized before). |
363 void WriteIndexedObject(intptr_t object_id) { | 363 void WriteIndexedObject(intptr_t object_id) { |
364 WriteSerializationMarker(kObjectId, object_id); | 364 WriteSerializationMarker(kObjectId, object_id); |
365 } | 365 } |
366 | 366 |
367 // Write out object header value. | 367 // Write out object header value. |
368 void WriteObjectHeader(intptr_t class_id, intptr_t tags) { | 368 void WriteObjectHeader(intptr_t class_id, intptr_t tags) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
509 | 509 |
510 private: | 510 private: |
511 SnapshotWriter* writer_; | 511 SnapshotWriter* writer_; |
512 | 512 |
513 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 513 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
514 }; | 514 }; |
515 | 515 |
516 } // namespace dart | 516 } // namespace dart |
517 | 517 |
518 #endif // VM_SNAPSHOT_H_ | 518 #endif // VM_SNAPSHOT_H_ |
OLD | NEW |