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

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

Issue 1162033005: Fix http://dartbug.com/23578: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update to ToT. Created 5 years, 6 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
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/object.h" 5 #include "vm/object.h"
6 #include "vm/object_store.h" 6 #include "vm/object_store.h"
7 #include "vm/snapshot.h" 7 #include "vm/snapshot.h"
8 #include "vm/stub_code.h" 8 #include "vm/stub_code.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 // TODO(5411462): Need to assert No GC can happen here, even though 715 // TODO(5411462): Need to assert No GC can happen here, even though
716 // allocations may happen. 716 // allocations may happen.
717 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); 717 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from());
718 for (intptr_t i = 0; i <= num_flds; i++) { 718 for (intptr_t i = 0; i <= num_flds; i++) {
719 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); 719 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef();
720 func.StorePointer((func.raw()->from() + i), 720 func.StorePointer((func.raw()->from() + i),
721 reader->PassiveObjectHandle()->raw()); 721 reader->PassiveObjectHandle()->raw());
722 } 722 }
723 723
724 // Initialize all fields that are not part of the snapshot. 724 // Initialize all fields that are not part of the snapshot.
725 func.ClearICDataArray();
725 func.ClearCode(); 726 func.ClearCode();
726 func.set_ic_data_array(Object::null_array());
727 return func.raw(); 727 return func.raw();
728 } 728 }
729 729
730 730
731 void RawFunction::WriteTo(SnapshotWriter* writer, 731 void RawFunction::WriteTo(SnapshotWriter* writer,
732 intptr_t object_id, 732 intptr_t object_id,
733 Snapshot::Kind kind) { 733 Snapshot::Kind kind) {
734 ASSERT(writer != NULL); 734 ASSERT(writer != NULL);
735 ASSERT(((kind == Snapshot::kScript) && 735 ASSERT(((kind == Snapshot::kScript) &&
736 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))) || 736 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))) ||
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2947 // We do not allow objects with native fields in an isolate message. 2947 // We do not allow objects with native fields in an isolate message.
2948 writer->SetWriteException(Exceptions::kArgument, 2948 writer->SetWriteException(Exceptions::kArgument,
2949 "Illegal argument in isolate message" 2949 "Illegal argument in isolate message"
2950 " : (object is a UserTag)"); 2950 " : (object is a UserTag)");
2951 } else { 2951 } else {
2952 UNREACHABLE(); 2952 UNREACHABLE();
2953 } 2953 }
2954 } 2954 }
2955 2955
2956 } // namespace dart 2956 } // namespace dart
OLDNEW
« runtime/vm/isolate.cc ('K') | « runtime/vm/parser.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698