| 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" |
| 11 #include "vm/datastream.h" | 11 #include "vm/datastream.h" |
| 12 #include "vm/globals.h" | 12 #include "vm/globals.h" |
| 13 #include "vm/growable_array.h" | 13 #include "vm/growable_array.h" |
| 14 #include "vm/isolate.h" | 14 #include "vm/isolate.h" |
| 15 #include "vm/visitor.h" | 15 #include "vm/visitor.h" |
| 16 | 16 |
| 17 namespace dart { | 17 namespace dart { |
| 18 | 18 |
| 19 // Forward declarations. | 19 // Forward declarations. |
| 20 class AbstractType; | 20 class AbstractType; |
| 21 class AbstractTypeArguments; | 21 class AbstractTypeArguments; |
| 22 class Array; | 22 class Array; |
| 23 class Class; | 23 class Class; |
| 24 class GrowableObjectArray; |
| 24 class Heap; | 25 class Heap; |
| 25 class Library; | 26 class Library; |
| 26 class Object; | 27 class Object; |
| 27 class ObjectStore; | 28 class ObjectStore; |
| 28 class RawAbstractTypeArguments; | 29 class RawAbstractTypeArguments; |
| 29 class RawArray; | 30 class RawArray; |
| 30 class RawBigint; | 31 class RawBigint; |
| 31 class RawClass; | 32 class RawClass; |
| 32 class RawContext; | 33 class RawContext; |
| 33 class RawDouble; | 34 class RawDouble; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 SnapshotReader(const Snapshot* snapshot, Isolate* isolate); | 168 SnapshotReader(const Snapshot* snapshot, Isolate* isolate); |
| 168 ~SnapshotReader() { } | 169 ~SnapshotReader() { } |
| 169 | 170 |
| 170 Isolate* isolate() const { return isolate_; } | 171 Isolate* isolate() const { return isolate_; } |
| 171 Heap* heap() const { return isolate_->heap(); } | 172 Heap* heap() const { return isolate_->heap(); } |
| 172 ObjectStore* object_store() const { return isolate_->object_store(); } | 173 ObjectStore* object_store() const { return isolate_->object_store(); } |
| 173 Object* ObjectHandle() { return &obj_; } | 174 Object* ObjectHandle() { return &obj_; } |
| 174 String* StringHandle() { return &str_; } | 175 String* StringHandle() { return &str_; } |
| 175 AbstractType* TypeHandle() { return &type_; } | 176 AbstractType* TypeHandle() { return &type_; } |
| 176 AbstractTypeArguments* TypeArgumentsHandle() { return &type_arguments_; } | 177 AbstractTypeArguments* TypeArgumentsHandle() { return &type_arguments_; } |
| 178 Array* TokensHandle() { return &tokens_; } |
| 177 | 179 |
| 178 // Reads an object. | 180 // Reads an object. |
| 179 RawObject* ReadObject(); | 181 RawObject* ReadObject(); |
| 180 | 182 |
| 181 // Add object to backward references. | 183 // Add object to backward references. |
| 182 void AddBackRef(intptr_t id, Object* obj, DeserializeState state); | 184 void AddBackRef(intptr_t id, Object* obj, DeserializeState state); |
| 183 | 185 |
| 184 // Get an object from the backward references list. | 186 // Get an object from the backward references list. |
| 185 Object* GetBackRef(intptr_t id); | 187 Object* GetBackRef(intptr_t id); |
| 186 | 188 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 void ArrayReadFrom(const Array& result, intptr_t len, intptr_t tags); | 252 void ArrayReadFrom(const Array& result, intptr_t len, intptr_t tags); |
| 251 | 253 |
| 252 Snapshot::Kind kind_; // Indicates type of snapshot(full, script, message). | 254 Snapshot::Kind kind_; // Indicates type of snapshot(full, script, message). |
| 253 Isolate* isolate_; // Current isolate. | 255 Isolate* isolate_; // Current isolate. |
| 254 Class& cls_; // Temporary Class handle. | 256 Class& cls_; // Temporary Class handle. |
| 255 Object& obj_; // Temporary Object handle. | 257 Object& obj_; // Temporary Object handle. |
| 256 String& str_; // Temporary String handle. | 258 String& str_; // Temporary String handle. |
| 257 Library& library_; // Temporary library handle. | 259 Library& library_; // Temporary library handle. |
| 258 AbstractType& type_; // Temporary type handle. | 260 AbstractType& type_; // Temporary type handle. |
| 259 AbstractTypeArguments& type_arguments_; // Temporary type argument handle. | 261 AbstractTypeArguments& type_arguments_; // Temporary type argument handle. |
| 262 Array& tokens_; // Temporary tokens handle. |
| 260 GrowableArray<BackRefNode*> backward_references_; | 263 GrowableArray<BackRefNode*> backward_references_; |
| 261 | 264 |
| 262 friend class Array; | 265 friend class Array; |
| 263 friend class Class; | 266 friend class Class; |
| 264 friend class Context; | 267 friend class Context; |
| 265 friend class ContextScope; | 268 friend class ContextScope; |
| 266 friend class Field; | 269 friend class Field; |
| 267 friend class Function; | 270 friend class Function; |
| 268 friend class GrowableObjectArray; | 271 friend class GrowableObjectArray; |
| 269 friend class ImmutableArray; | 272 friend class ImmutableArray; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 private: | 478 private: |
| 476 SnapshotWriter* writer_; | 479 SnapshotWriter* writer_; |
| 477 bool as_references_; | 480 bool as_references_; |
| 478 | 481 |
| 479 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 482 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 480 }; | 483 }; |
| 481 | 484 |
| 482 } // namespace dart | 485 } // namespace dart |
| 483 | 486 |
| 484 #endif // VM_SNAPSHOT_H_ | 487 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |