| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 26 class GrowableObjectArray; | 26 class GrowableObjectArray; |
| 27 class Heap; | 27 class Heap; |
| 28 class LanguageError; | 28 class LanguageError; |
| 29 class Library; | 29 class Library; |
| 30 class Object; | 30 class Object; |
| 31 class ObjectStore; | 31 class ObjectStore; |
| 32 class RawApiError; | 32 class RawApiError; |
| 33 class RawArray; | 33 class RawArray; |
| 34 class RawBigint; | 34 class RawBigint; |
| 35 class RawBoundedType; | 35 class RawBoundedType; |
| 36 class RawMixinAppType; | 36 class RawCapability; |
| 37 class RawClass; | 37 class RawClass; |
| 38 class RawClosureData; |
| 38 class RawContext; | 39 class RawContext; |
| 39 class RawDouble; | 40 class RawDouble; |
| 40 class RawField; | 41 class RawField; |
| 41 class RawClosureData; | 42 class RawFloat32x4; |
| 42 class RawRedirectionData; | 43 class RawFloat64x2; |
| 43 class RawFunction; | 44 class RawFunction; |
| 44 class RawGrowableObjectArray; | 45 class RawGrowableObjectArray; |
| 45 class RawLinkedHashMap; | 46 class RawImmutableArray; |
| 46 class RawFloat32x4; | |
| 47 class RawFloat64x2; | |
| 48 class RawInt32x4; | 47 class RawInt32x4; |
| 49 class RawImmutableArray; | |
| 50 class RawLanguageError; | 48 class RawLanguageError; |
| 51 class RawLibrary; | 49 class RawLibrary; |
| 52 class RawLibraryPrefix; | 50 class RawLibraryPrefix; |
| 53 class RawNamespace; | 51 class RawLinkedHashMap; |
| 54 class RawLiteralToken; | 52 class RawLiteralToken; |
| 55 class RawMint; | 53 class RawMint; |
| 54 class RawMixinAppType; |
| 55 class RawNamespace; |
| 56 class RawObject; | 56 class RawObject; |
| 57 class RawOneByteString; | 57 class RawOneByteString; |
| 58 class RawPatchClass; | 58 class RawPatchClass; |
| 59 class RawReceivePort; |
| 60 class RawRedirectionData; |
| 59 class RawScript; | 61 class RawScript; |
| 62 class RawSendPort; |
| 60 class RawSmi; | 63 class RawSmi; |
| 61 class RawCapability; | |
| 62 class RawReceivePort; | |
| 63 class RawSendPort; | |
| 64 class RawStacktrace; | 64 class RawStacktrace; |
| 65 class RawTokenStream; | 65 class RawTokenStream; |
| 66 class RawTwoByteString; |
| 66 class RawType; | 67 class RawType; |
| 68 class RawTypeArguments; |
| 69 class RawTypedData; |
| 70 class RawTypeParameter; |
| 67 class RawTypeRef; | 71 class RawTypeRef; |
| 68 class RawTypeParameter; | |
| 69 class RawTypeArguments; | |
| 70 class RawTwoByteString; | |
| 71 class RawUnhandledException; | 72 class RawUnhandledException; |
| 72 class RawUnresolvedClass; | 73 class RawUnresolvedClass; |
| 73 class String; | 74 class String; |
| 74 class TokenStream; | 75 class TokenStream; |
| 75 class TypeArguments; | 76 class TypeArguments; |
| 76 class UnhandledException; | 77 class UnhandledException; |
| 77 | 78 |
| 78 // Serialized object header encoding is as follows: | 79 // Serialized object header encoding is as follows: |
| 79 // - Smi: the Smi value is written as is (last bit is not tagged). | 80 // - Smi: the Smi value is written as is (last bit is not tagged). |
| 80 // - VM object (from VM isolate): (object id in vm isolate | 0x3) | 81 // - VM object (from VM isolate): (object id in vm isolate | 0x3) |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 RawImmutableArray* NewImmutableArray(intptr_t len); | 279 RawImmutableArray* NewImmutableArray(intptr_t len); |
| 279 RawOneByteString* NewOneByteString(intptr_t len); | 280 RawOneByteString* NewOneByteString(intptr_t len); |
| 280 RawTwoByteString* NewTwoByteString(intptr_t len); | 281 RawTwoByteString* NewTwoByteString(intptr_t len); |
| 281 RawTypeArguments* NewTypeArguments(intptr_t len); | 282 RawTypeArguments* NewTypeArguments(intptr_t len); |
| 282 RawTokenStream* NewTokenStream(intptr_t len); | 283 RawTokenStream* NewTokenStream(intptr_t len); |
| 283 RawContext* NewContext(intptr_t num_variables); | 284 RawContext* NewContext(intptr_t num_variables); |
| 284 RawClass* NewClass(intptr_t class_id); | 285 RawClass* NewClass(intptr_t class_id); |
| 285 RawInstance* NewInstance(); | 286 RawInstance* NewInstance(); |
| 286 RawMint* NewMint(int64_t value); | 287 RawMint* NewMint(int64_t value); |
| 287 RawBigint* NewBigint(const char* hex_string); | 288 RawBigint* NewBigint(const char* hex_string); |
| 289 RawTypedData* NewTypedData(intptr_t class_id, intptr_t len); |
| 288 RawDouble* NewDouble(double value); | 290 RawDouble* NewDouble(double value); |
| 289 RawUnresolvedClass* NewUnresolvedClass(); | 291 RawUnresolvedClass* NewUnresolvedClass(); |
| 290 RawType* NewType(); | 292 RawType* NewType(); |
| 291 RawTypeRef* NewTypeRef(); | 293 RawTypeRef* NewTypeRef(); |
| 292 RawTypeParameter* NewTypeParameter(); | 294 RawTypeParameter* NewTypeParameter(); |
| 293 RawBoundedType* NewBoundedType(); | 295 RawBoundedType* NewBoundedType(); |
| 294 RawMixinAppType* NewMixinAppType(); | 296 RawMixinAppType* NewMixinAppType(); |
| 295 RawPatchClass* NewPatchClass(); | 297 RawPatchClass* NewPatchClass(); |
| 296 RawClosureData* NewClosureData(); | 298 RawClosureData* NewClosureData(); |
| 297 RawRedirectionData* NewRedirectionData(); | 299 RawRedirectionData* NewRedirectionData(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 326 state_ = other.state_; | 328 state_ = other.state_; |
| 327 return *this; | 329 return *this; |
| 328 } | 330 } |
| 329 | 331 |
| 330 private: | 332 private: |
| 331 Object* reference_; | 333 Object* reference_; |
| 332 DeserializeState state_; | 334 DeserializeState state_; |
| 333 }; | 335 }; |
| 334 | 336 |
| 335 // Allocate uninitialized objects, this is used when reading a full snapshot. | 337 // Allocate uninitialized objects, this is used when reading a full snapshot. |
| 336 RawObject* AllocateUninitialized(const Class& cls, intptr_t size); | 338 RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size); |
| 337 | 339 |
| 338 RawClass* ReadClassId(intptr_t object_id); | 340 RawClass* ReadClassId(intptr_t object_id); |
| 339 RawObject* ReadObjectImpl(); | 341 RawObject* ReadObjectImpl(); |
| 340 RawObject* ReadObjectImpl(intptr_t header); | 342 RawObject* ReadObjectImpl(intptr_t header); |
| 341 RawObject* ReadObjectRef(); | 343 RawObject* ReadObjectRef(); |
| 342 | 344 |
| 343 // Read a VM isolate object that was serialized as an Id. | 345 // Read a VM isolate object that was serialized as an Id. |
| 344 RawObject* ReadVMIsolateObject(intptr_t object_id); | 346 RawObject* ReadVMIsolateObject(intptr_t object_id); |
| 345 | 347 |
| 346 // Read an object that was serialized as an Id (singleton in object store, | 348 // Read an object that was serialized as an Id (singleton in object store, |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 private: | 715 private: |
| 714 SnapshotWriter* writer_; | 716 SnapshotWriter* writer_; |
| 715 bool as_references_; | 717 bool as_references_; |
| 716 | 718 |
| 717 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 719 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 718 }; | 720 }; |
| 719 | 721 |
| 720 } // namespace dart | 722 } // namespace dart |
| 721 | 723 |
| 722 #endif // VM_SNAPSHOT_H_ | 724 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |