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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 private: | 332 private: |
333 Object* reference_; | 333 Object* reference_; |
334 DeserializeState state_; | 334 DeserializeState state_; |
335 bool defer_canonicalization_; | 335 bool defer_canonicalization_; |
336 ZoneGrowableArray<intptr_t>* patch_records_; | 336 ZoneGrowableArray<intptr_t>* patch_records_; |
337 }; | 337 }; |
338 | 338 |
339 | 339 |
340 class InstructionsReader : public ZoneAllocated { | 340 class ImageReader : public ZoneAllocated { |
341 public: | 341 public: |
342 InstructionsReader(const uint8_t* instructions_buffer, | 342 ImageReader(const uint8_t* instructions_buffer, const uint8_t* data_buffer) |
343 const uint8_t* data_buffer) | |
344 : instructions_buffer_(instructions_buffer), data_buffer_(data_buffer) { | 343 : instructions_buffer_(instructions_buffer), data_buffer_(data_buffer) { |
345 ASSERT(instructions_buffer != NULL); | 344 ASSERT(instructions_buffer != NULL); |
346 ASSERT(data_buffer != NULL); | 345 ASSERT(data_buffer != NULL); |
347 ASSERT(Utils::IsAligned(reinterpret_cast<uword>(instructions_buffer), | 346 ASSERT(Utils::IsAligned(reinterpret_cast<uword>(instructions_buffer), |
348 OS::PreferredCodeAlignment())); | 347 OS::PreferredCodeAlignment())); |
349 } | 348 } |
350 | 349 |
351 RawInstructions* GetInstructionsAt(int32_t offset); | 350 RawInstructions* GetInstructionsAt(int32_t offset); |
352 RawObject* GetObjectAt(int32_t offset); | 351 RawObject* GetObjectAt(int32_t offset); |
353 | 352 |
354 private: | 353 private: |
355 const uint8_t* instructions_buffer_; | 354 const uint8_t* instructions_buffer_; |
356 const uint8_t* data_buffer_; | 355 const uint8_t* data_buffer_; |
357 | 356 |
358 DISALLOW_COPY_AND_ASSIGN(InstructionsReader); | 357 DISALLOW_COPY_AND_ASSIGN(ImageReader); |
359 }; | 358 }; |
360 | 359 |
361 | 360 |
362 // Reads a snapshot into objects. | 361 // Reads a snapshot into objects. |
363 class SnapshotReader : public BaseReader { | 362 class SnapshotReader : public BaseReader { |
364 public: | 363 public: |
365 Thread* thread() const { return thread_; } | 364 Thread* thread() const { return thread_; } |
366 Zone* zone() const { return zone_; } | 365 Zone* zone() const { return zone_; } |
367 Isolate* isolate() const { return thread_->isolate(); } | 366 Isolate* isolate() const { return thread_->isolate(); } |
368 Heap* heap() const { return heap_; } | 367 Heap* heap() const { return heap_; } |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 private: | 1013 private: |
1015 SnapshotWriter* writer_; | 1014 SnapshotWriter* writer_; |
1016 bool as_references_; | 1015 bool as_references_; |
1017 | 1016 |
1018 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 1017 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
1019 }; | 1018 }; |
1020 | 1019 |
1021 } // namespace dart | 1020 } // namespace dart |
1022 | 1021 |
1023 #endif // RUNTIME_VM_SNAPSHOT_H_ | 1022 #endif // RUNTIME_VM_SNAPSHOT_H_ |
OLD | NEW |