| 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 RUNTIME_VM_SNAPSHOT_H_ | 5 #ifndef RUNTIME_VM_SNAPSHOT_H_ |
| 6 #define RUNTIME_VM_SNAPSHOT_H_ | 6 #define RUNTIME_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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 private: | 320 private: |
| 321 Object* reference_; | 321 Object* reference_; |
| 322 DeserializeState state_; | 322 DeserializeState state_; |
| 323 bool defer_canonicalization_; | 323 bool defer_canonicalization_; |
| 324 ZoneGrowableArray<intptr_t>* patch_records_; | 324 ZoneGrowableArray<intptr_t>* patch_records_; |
| 325 }; | 325 }; |
| 326 | 326 |
| 327 class ImageReader : public ZoneAllocated { | 327 class ImageReader : public ZoneAllocated { |
| 328 public: | 328 public: |
| 329 ImageReader(const uint8_t* instructions_buffer, const uint8_t* data_buffer) | 329 ImageReader(const uint8_t* instructions_buffer, const uint8_t* data_buffer); |
| 330 : instructions_buffer_(instructions_buffer), data_buffer_(data_buffer) { | |
| 331 ASSERT(instructions_buffer != NULL); | |
| 332 ASSERT(data_buffer != NULL); | |
| 333 ASSERT(Utils::IsAligned(reinterpret_cast<uword>(instructions_buffer), | |
| 334 OS::PreferredCodeAlignment())); | |
| 335 } | |
| 336 | 330 |
| 337 RawInstructions* GetInstructionsAt(int32_t offset); | 331 RawInstructions* GetInstructionsAt(int32_t offset); |
| 338 RawObject* GetObjectAt(int32_t offset); | 332 RawObject* GetObjectAt(int32_t offset); |
| 339 | 333 |
| 340 private: | 334 private: |
| 341 const uint8_t* instructions_buffer_; | 335 const uint8_t* instructions_buffer_; |
| 342 const uint8_t* data_buffer_; | 336 const uint8_t* data_buffer_; |
| 337 const uint8_t* vm_instructions_buffer_; |
| 343 | 338 |
| 344 DISALLOW_COPY_AND_ASSIGN(ImageReader); | 339 DISALLOW_COPY_AND_ASSIGN(ImageReader); |
| 345 }; | 340 }; |
| 346 | 341 |
| 347 // Reads a snapshot into objects. | 342 // Reads a snapshot into objects. |
| 348 class SnapshotReader : public BaseReader { | 343 class SnapshotReader : public BaseReader { |
| 349 public: | 344 public: |
| 350 Thread* thread() const { return thread_; } | 345 Thread* thread() const { return thread_; } |
| 351 Zone* zone() const { return zone_; } | 346 Zone* zone() const { return zone_; } |
| 352 Isolate* isolate() const { return thread_->isolate(); } | 347 Isolate* isolate() const { return thread_->isolate(); } |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 private: | 987 private: |
| 993 SnapshotWriter* writer_; | 988 SnapshotWriter* writer_; |
| 994 bool as_references_; | 989 bool as_references_; |
| 995 | 990 |
| 996 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 991 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 997 }; | 992 }; |
| 998 | 993 |
| 999 } // namespace dart | 994 } // namespace dart |
| 1000 | 995 |
| 1001 #endif // RUNTIME_VM_SNAPSHOT_H_ | 996 #endif // RUNTIME_VM_SNAPSHOT_H_ |
| OLD | NEW |