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

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

Issue 1023753006: First step towards splitting a full snapshot into a vm isolate snapshot and a (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/snapshot_test.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 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 friend class RawUserTag; 670 friend class RawUserTag;
671 friend class SnapshotWriterVisitor; 671 friend class SnapshotWriterVisitor;
672 friend class WriteInlinedObjectVisitor; 672 friend class WriteInlinedObjectVisitor;
673 DISALLOW_COPY_AND_ASSIGN(SnapshotWriter); 673 DISALLOW_COPY_AND_ASSIGN(SnapshotWriter);
674 }; 674 };
675 675
676 676
677 class FullSnapshotWriter : public SnapshotWriter { 677 class FullSnapshotWriter : public SnapshotWriter {
678 public: 678 public:
679 static const intptr_t kInitialSize = 64 * KB; 679 static const intptr_t kInitialSize = 64 * KB;
680 FullSnapshotWriter(uint8_t** buffer, ReAlloc alloc) 680 FullSnapshotWriter(uint8_t** vm_isolate_snapshot_buffer,
681 : SnapshotWriter(Snapshot::kFull, buffer, alloc, kInitialSize, true) { 681 uint8_t** isolate_snapshot_buffer,
682 ASSERT(buffer != NULL); 682 ReAlloc alloc)
683 : SnapshotWriter(Snapshot::kFull,
684 isolate_snapshot_buffer,
685 alloc,
686 kInitialSize,
687 true) {
688 ASSERT(vm_isolate_snapshot_buffer != NULL);
689 ASSERT(isolate_snapshot_buffer != NULL);
683 ASSERT(alloc != NULL); 690 ASSERT(alloc != NULL);
684 } 691 }
685 ~FullSnapshotWriter() { } 692 ~FullSnapshotWriter() { }
686 693
687 // Writes a full snapshot of the Isolate. 694 // Writes a full snapshot of the Isolate.
688 void WriteFullSnapshot(); 695 void WriteFullSnapshot();
689 696
697 intptr_t VmIsolateSnapshotSize() const { return 0; }
698 intptr_t IsolateSnapshotSize() const { return BytesWritten(); }
699
690 private: 700 private:
691 DISALLOW_COPY_AND_ASSIGN(FullSnapshotWriter); 701 DISALLOW_COPY_AND_ASSIGN(FullSnapshotWriter);
692 }; 702 };
693 703
694 704
695 class ScriptSnapshotWriter : public SnapshotWriter { 705 class ScriptSnapshotWriter : public SnapshotWriter {
696 public: 706 public:
697 static const intptr_t kInitialSize = 64 * KB; 707 static const intptr_t kInitialSize = 64 * KB;
698 ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc) 708 ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
699 : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize, true) { 709 : SnapshotWriter(Snapshot::kScript, buffer, alloc, kInitialSize, true) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 private: 760 private:
751 SnapshotWriter* writer_; 761 SnapshotWriter* writer_;
752 bool as_references_; 762 bool as_references_;
753 763
754 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 764 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
755 }; 765 };
756 766
757 } // namespace dart 767 } // namespace dart
758 768
759 #endif // VM_SNAPSHOT_H_ 769 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698