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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 ReadStream stream_; // input stream. | 238 ReadStream stream_; // input stream. |
239 }; | 239 }; |
240 | 240 |
241 | 241 |
242 // Reads a snapshot into objects. | 242 // Reads a snapshot into objects. |
243 class SnapshotReader : public BaseReader { | 243 class SnapshotReader : public BaseReader { |
244 public: | 244 public: |
245 SnapshotReader(const uint8_t* buffer, | 245 SnapshotReader(const uint8_t* buffer, |
246 intptr_t size, | 246 intptr_t size, |
247 Snapshot::Kind kind, | 247 Snapshot::Kind kind, |
248 Isolate* isolate); | 248 Isolate* isolate, |
| 249 Zone* zone); |
249 ~SnapshotReader() { } | 250 ~SnapshotReader() { } |
250 | 251 |
| 252 Zone* zone() const { return zone_; } |
251 Isolate* isolate() const { return isolate_; } | 253 Isolate* isolate() const { return isolate_; } |
252 Heap* heap() const { return heap_; } | 254 Heap* heap() const { return heap_; } |
253 ObjectStore* object_store() const { return isolate_->object_store(); } | 255 ObjectStore* object_store() const { return isolate_->object_store(); } |
254 ClassTable* class_table() const { return isolate_->class_table(); } | 256 ClassTable* class_table() const { return isolate_->class_table(); } |
255 PassiveObject* PassiveObjectHandle() { return &pobj_; } | 257 PassiveObject* PassiveObjectHandle() { return &pobj_; } |
256 Array* ArrayHandle() { return &array_; } | 258 Array* ArrayHandle() { return &array_; } |
257 String* StringHandle() { return &str_; } | 259 String* StringHandle() { return &str_; } |
258 AbstractType* TypeHandle() { return &type_; } | 260 AbstractType* TypeHandle() { return &type_; } |
259 TypeArguments* TypeArgumentsHandle() { return &type_arguments_; } | 261 TypeArguments* TypeArgumentsHandle() { return &type_arguments_; } |
260 Array* TokensHandle() { return &tokens_; } | 262 Array* TokensHandle() { return &tokens_; } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 intptr_t LookupInternalClass(intptr_t class_header); | 368 intptr_t LookupInternalClass(intptr_t class_header); |
367 | 369 |
368 void ArrayReadFrom(const Array& result, intptr_t len, intptr_t tags); | 370 void ArrayReadFrom(const Array& result, intptr_t len, intptr_t tags); |
369 | 371 |
370 intptr_t NextAvailableObjectId() const; | 372 intptr_t NextAvailableObjectId() const; |
371 | 373 |
372 void SetReadException(const char* msg); | 374 void SetReadException(const char* msg); |
373 | 375 |
374 Snapshot::Kind kind_; // Indicates type of snapshot(full, script, message). | 376 Snapshot::Kind kind_; // Indicates type of snapshot(full, script, message). |
375 Isolate* isolate_; // Current isolate. | 377 Isolate* isolate_; // Current isolate. |
| 378 Zone* zone_; // Zone for allocations while reading snapshot. |
376 Heap* heap_; // Heap of the current isolate. | 379 Heap* heap_; // Heap of the current isolate. |
377 PageSpace* old_space_; // Old space of the current isolate. | 380 PageSpace* old_space_; // Old space of the current isolate. |
378 Class& cls_; // Temporary Class handle. | 381 Class& cls_; // Temporary Class handle. |
379 Object& obj_; // Temporary Object handle. | 382 Object& obj_; // Temporary Object handle. |
380 PassiveObject& pobj_; // Temporary PassiveObject handle. | 383 PassiveObject& pobj_; // Temporary PassiveObject handle. |
381 Array& array_; // Temporary Array handle. | 384 Array& array_; // Temporary Array handle. |
382 Field& field_; // Temporary Field handle. | 385 Field& field_; // Temporary Field handle. |
383 String& str_; // Temporary String handle. | 386 String& str_; // Temporary String handle. |
384 Library& library_; // Temporary library handle. | 387 Library& library_; // Temporary library handle. |
385 AbstractType& type_; // Temporary type handle. | 388 AbstractType& type_; // Temporary type handle. |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 private: | 750 private: |
748 SnapshotWriter* writer_; | 751 SnapshotWriter* writer_; |
749 bool as_references_; | 752 bool as_references_; |
750 | 753 |
751 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 754 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
752 }; | 755 }; |
753 | 756 |
754 } // namespace dart | 757 } // namespace dart |
755 | 758 |
756 #endif // VM_SNAPSHOT_H_ | 759 #endif // VM_SNAPSHOT_H_ |
OLD | NEW |