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 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2505 EXT_TYPED_DATA_WRITE(kTypedDataFloat64ArrayCid, double); // NOLINT. | 2505 EXT_TYPED_DATA_WRITE(kTypedDataFloat64ArrayCid, double); // NOLINT. |
2506 break; | 2506 break; |
2507 default: | 2507 default: |
2508 UNREACHABLE(); | 2508 UNREACHABLE(); |
2509 } | 2509 } |
2510 } | 2510 } |
2511 #undef TYPED_DATA_WRITE | 2511 #undef TYPED_DATA_WRITE |
2512 #undef EXT_TYPED_DATA_WRITE | 2512 #undef EXT_TYPED_DATA_WRITE |
2513 | 2513 |
2514 | 2514 |
2515 RawCapability* Capability::ReadFrom(SnapshotReader* reader, | |
2516 intptr_t object_id, | |
2517 intptr_t tags, | |
2518 Snapshot::Kind kind) { | |
2519 UNIMPLEMENTED(); | |
2520 return Capability::null(); | |
2521 } | |
2522 | |
2523 | |
2524 void RawCapability::WriteTo(SnapshotWriter* writer, | |
2525 intptr_t object_id, | |
2526 Snapshot::Kind kind) { | |
2527 UNIMPLEMENTED(); | |
2528 } | |
2529 | |
2530 | |
2531 RawReceivePort* ReceivePort::ReadFrom(SnapshotReader* reader, | |
2532 intptr_t object_id, | |
2533 intptr_t tags, | |
2534 Snapshot::Kind kind) { | |
2535 UNIMPLEMENTED(); | |
siva
2014/04/23 00:20:31
Should this be UNREACHABLE() we don't expect to se
Ivan Posva
2014/04/23 19:43:35
Throwing an exception in that case.
| |
2536 return ReceivePort::null(); | |
2537 } | |
2538 | |
2539 | |
2540 void RawReceivePort::WriteTo(SnapshotWriter* writer, | |
2541 intptr_t object_id, | |
2542 Snapshot::Kind kind) { | |
2543 UNIMPLEMENTED(); | |
siva
2014/04/23 00:20:31
Ditto comment.
| |
2544 } | |
2545 | |
2546 | |
2547 RawSendPort* SendPort::ReadFrom(SnapshotReader* reader, | |
2548 intptr_t object_id, | |
2549 intptr_t tags, | |
2550 Snapshot::Kind kind) { | |
2551 uint64_t id = reader->Read<uint64_t>(); | |
2552 | |
2553 SendPort& result = SendPort::ZoneHandle(reader->isolate(), | |
2554 SendPort::New(id)); | |
2555 reader->AddBackRef(object_id, &result, kIsDeserialized); | |
2556 return result.raw(); | |
2557 } | |
2558 | |
2559 | |
2560 void RawSendPort::WriteTo(SnapshotWriter* writer, | |
2561 intptr_t object_id, | |
2562 Snapshot::Kind kind) { | |
2563 // Write out the serialization header value for this object. | |
2564 writer->WriteInlinedObjectHeader(object_id); | |
2565 | |
2566 // Write out the class and tags information. | |
2567 writer->WriteIndexedObject(kSendPortCid); | |
2568 writer->WriteIntptrValue(writer->GetObjectTags(this)); | |
2569 | |
2570 writer->Write(ptr()->id_); | |
2571 } | |
2572 | |
2573 | |
2515 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, | 2574 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, |
2516 intptr_t object_id, | 2575 intptr_t object_id, |
2517 intptr_t tags, | 2576 intptr_t tags, |
2518 Snapshot::Kind kind) { | 2577 Snapshot::Kind kind) { |
2519 if (kind == Snapshot::kFull) { | 2578 if (kind == Snapshot::kFull) { |
2520 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), | 2579 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), |
2521 reader->NewStacktrace()); | 2580 reader->NewStacktrace()); |
2522 reader->AddBackRef(object_id, &result, kIsDeserialized); | 2581 reader->AddBackRef(object_id, &result, kIsDeserialized); |
2523 | 2582 |
2524 // There are no non object pointer fields. | 2583 // There are no non object pointer fields. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2710 // We do not allow objects with native fields in an isolate message. | 2769 // We do not allow objects with native fields in an isolate message. |
2711 writer->SetWriteException(Exceptions::kArgument, | 2770 writer->SetWriteException(Exceptions::kArgument, |
2712 "Illegal argument in isolate message" | 2771 "Illegal argument in isolate message" |
2713 " : (object is a UserTag)"); | 2772 " : (object is a UserTag)"); |
2714 } else { | 2773 } else { |
2715 UNREACHABLE(); | 2774 UNREACHABLE(); |
2716 } | 2775 } |
2717 } | 2776 } |
2718 | 2777 |
2719 } // namespace dart | 2778 } // namespace dart |
OLD | NEW |