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/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/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2521 } | 2521 } |
2522 } | 2522 } |
2523 #undef TYPED_DATA_WRITE | 2523 #undef TYPED_DATA_WRITE |
2524 #undef EXT_TYPED_DATA_WRITE | 2524 #undef EXT_TYPED_DATA_WRITE |
2525 | 2525 |
2526 | 2526 |
2527 RawCapability* Capability::ReadFrom(SnapshotReader* reader, | 2527 RawCapability* Capability::ReadFrom(SnapshotReader* reader, |
2528 intptr_t object_id, | 2528 intptr_t object_id, |
2529 intptr_t tags, | 2529 intptr_t tags, |
2530 Snapshot::Kind kind) { | 2530 Snapshot::Kind kind) { |
2531 UNIMPLEMENTED(); | 2531 uint64_t id = reader->Read<uint64_t>(); |
2532 return Capability::null(); | 2532 |
2533 Capability& result = Capability::ZoneHandle(reader->isolate(), | |
2534 Capability::New(id)); | |
2535 reader->AddBackRef(object_id, &result, kIsDeserialized); | |
2536 return result.raw(); | |
2533 } | 2537 } |
2534 | 2538 |
2535 | 2539 |
2536 void RawCapability::WriteTo(SnapshotWriter* writer, | 2540 void RawCapability::WriteTo(SnapshotWriter* writer, |
2537 intptr_t object_id, | 2541 intptr_t object_id, |
2538 Snapshot::Kind kind) { | 2542 Snapshot::Kind kind) { |
2539 UNIMPLEMENTED(); | 2543 // Write out the serialization header value for this object. |
2544 writer->WriteInlinedObjectHeader(object_id); | |
2545 | |
2546 // Write out the class and tags information. | |
2547 writer->WriteIndexedObject(kCapabilityCid); | |
2548 writer->WriteTags(writer->GetObjectTags(this)); | |
2549 | |
2550 writer->Write(ptr()->id_); | |
siva
2014/07/01 21:42:56
writer->Write<uint64_t>(ptr()->id_);
so it reads
Ivan Posva
2014/07/03 12:51:17
Done. Also below in SendPort::WriteTo.
| |
2540 } | 2551 } |
2541 | 2552 |
2542 | 2553 |
2543 RawReceivePort* ReceivePort::ReadFrom(SnapshotReader* reader, | 2554 RawReceivePort* ReceivePort::ReadFrom(SnapshotReader* reader, |
2544 intptr_t object_id, | 2555 intptr_t object_id, |
2545 intptr_t tags, | 2556 intptr_t tags, |
2546 Snapshot::Kind kind) { | 2557 Snapshot::Kind kind) { |
2547 UNREACHABLE(); | 2558 UNREACHABLE(); |
2548 return ReceivePort::null(); | 2559 return ReceivePort::null(); |
2549 } | 2560 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2788 // We do not allow objects with native fields in an isolate message. | 2799 // We do not allow objects with native fields in an isolate message. |
2789 writer->SetWriteException(Exceptions::kArgument, | 2800 writer->SetWriteException(Exceptions::kArgument, |
2790 "Illegal argument in isolate message" | 2801 "Illegal argument in isolate message" |
2791 " : (object is a UserTag)"); | 2802 " : (object is a UserTag)"); |
2792 } else { | 2803 } else { |
2793 UNREACHABLE(); | 2804 UNREACHABLE(); |
2794 } | 2805 } |
2795 } | 2806 } |
2796 | 2807 |
2797 } // namespace dart | 2808 } // namespace dart |
OLD | NEW |