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

Side by Side Diff: vm/raw_object_snapshot.cc

Issue 9314048: Fix for issue 1456 - register libraries read from a partial snapshot (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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 | « vm/dart_api_impl.cc ('k') | 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 #include "vm/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // The cache of loaded scripts is not serialized. 698 // The cache of loaded scripts is not serialized.
699 library.raw_ptr()->loaded_scripts_ = Array::null(); 699 library.raw_ptr()->loaded_scripts_ = Array::null();
700 700
701 // Set all the object fields. 701 // Set all the object fields.
702 // TODO(5411462): Need to assert No GC can happen here, even though 702 // TODO(5411462): Need to assert No GC can happen here, even though
703 // allocations may happen. 703 // allocations may happen.
704 intptr_t num_flds = (library.raw()->to() - library.raw()->from()); 704 intptr_t num_flds = (library.raw()->to() - library.raw()->from());
705 for (intptr_t i = 0; i <= num_flds; i++) { 705 for (intptr_t i = 0; i <= num_flds; i++) {
706 *(library.raw()->from() + i) = reader->ReadObject(); 706 *(library.raw()->from() + i) = reader->ReadObject();
707 } 707 }
708 if (kind != Snapshot::kFull) {
709 library.Register();
710 }
708 } 711 }
709 return library.raw(); 712 return library.raw();
710 } 713 }
711 714
712 715
713 void RawLibrary::WriteTo(SnapshotWriter* writer, 716 void RawLibrary::WriteTo(SnapshotWriter* writer,
714 intptr_t object_id, 717 intptr_t object_id,
715 Snapshot::Kind kind) { 718 Snapshot::Kind kind) {
716 ASSERT(writer != NULL); 719 ASSERT(writer != NULL);
717 ASSERT(kind != Snapshot::kMessage); 720 ASSERT(kind != Snapshot::kMessage);
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 // Write out all the other fields. 1818 // Write out all the other fields.
1816 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 1819 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
1817 writer->WriteObject(ptr()->pattern_); 1820 writer->WriteObject(ptr()->pattern_);
1818 writer->WriteIntptrValue(ptr()->type_); 1821 writer->WriteIntptrValue(ptr()->type_);
1819 writer->WriteIntptrValue(ptr()->flags_); 1822 writer->WriteIntptrValue(ptr()->flags_);
1820 1823
1821 // Do not write out the data part which is native. 1824 // Do not write out the data part which is native.
1822 } 1825 }
1823 1826
1824 } // namespace dart 1827 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698