Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: runtime/vm/snapshot.h

Issue 2909403002: When deduplicating program metadata, try to use objects from the VM isolate. (Closed)
Patch Set: sync Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/program_visitor.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/program_visitor.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698