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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 15736011: Create test isolates using a snapshot, this ensures that we do not depend (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/unit_test.h » ('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/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 RawLibrary* Library::ReadFrom(SnapshotReader* reader, 1040 RawLibrary* Library::ReadFrom(SnapshotReader* reader,
1041 intptr_t object_id, 1041 intptr_t object_id,
1042 intptr_t tags, 1042 intptr_t tags,
1043 Snapshot::Kind kind) { 1043 Snapshot::Kind kind) {
1044 ASSERT(reader != NULL); 1044 ASSERT(reader != NULL);
1045 ASSERT(kind != Snapshot::kMessage); 1045 ASSERT(kind != Snapshot::kMessage);
1046 1046
1047 Library& library = Library::ZoneHandle(reader->isolate(), Library::null()); 1047 Library& library = Library::ZoneHandle(reader->isolate(), Library::null());
1048 reader->AddBackRef(object_id, &library, kIsDeserialized); 1048 reader->AddBackRef(object_id, &library, kIsDeserialized);
1049 1049
1050 if (RawObject::IsCreatedFromSnapshot(tags)) { 1050 if ((kind == Snapshot::kScript) && RawObject::IsCreatedFromSnapshot(tags)) {
1051 ASSERT(kind != Snapshot::kFull); 1051 ASSERT(kind != Snapshot::kFull);
1052 // Lookup the object as it should already exist in the heap. 1052 // Lookup the object as it should already exist in the heap.
1053 *reader->StringHandle() ^= reader->ReadObjectImpl(); 1053 *reader->StringHandle() ^= reader->ReadObjectImpl();
1054 library = Library::LookupLibrary(*reader->StringHandle()); 1054 library = Library::LookupLibrary(*reader->StringHandle());
1055 } else { 1055 } else {
1056 // Allocate library object. 1056 // Allocate library object.
1057 library = NEW_OBJECT(Library); 1057 library = NEW_OBJECT(Library);
1058 1058
1059 // Set the object tags. 1059 // Set the object tags.
1060 library.set_tags(tags); 1060 library.set_tags(tags);
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 // Write out the class and tags information. 2640 // Write out the class and tags information.
2641 writer->WriteIndexedObject(kWeakPropertyCid); 2641 writer->WriteIndexedObject(kWeakPropertyCid);
2642 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2642 writer->WriteIntptrValue(writer->GetObjectTags(this));
2643 2643
2644 // Write out all the other fields. 2644 // Write out all the other fields.
2645 writer->Write<RawObject*>(ptr()->key_); 2645 writer->Write<RawObject*>(ptr()->key_);
2646 writer->Write<RawObject*>(ptr()->value_); 2646 writer->Write<RawObject*>(ptr()->value_);
2647 } 2647 }
2648 2648
2649 } // namespace dart 2649 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698