| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |