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 UNREACHABLE(); |
| 2536 return ReceivePort::null(); |
| 2537 } |
| 2538 |
| 2539 |
| 2540 void RawReceivePort::WriteTo(SnapshotWriter* writer, |
| 2541 intptr_t object_id, |
| 2542 Snapshot::Kind kind) { |
| 2543 if (kind == Snapshot::kMessage) { |
| 2544 // We do not allow objects with native fields in an isolate message. |
| 2545 writer->SetWriteException(Exceptions::kArgument, |
| 2546 "Illegal argument in isolate message" |
| 2547 " : (object is a RawReceivePort)"); |
| 2548 } else { |
| 2549 UNREACHABLE(); |
| 2550 } |
| 2551 } |
| 2552 |
| 2553 |
| 2554 RawSendPort* SendPort::ReadFrom(SnapshotReader* reader, |
| 2555 intptr_t object_id, |
| 2556 intptr_t tags, |
| 2557 Snapshot::Kind kind) { |
| 2558 uint64_t id = reader->Read<uint64_t>(); |
| 2559 |
| 2560 SendPort& result = SendPort::ZoneHandle(reader->isolate(), |
| 2561 SendPort::New(id)); |
| 2562 reader->AddBackRef(object_id, &result, kIsDeserialized); |
| 2563 return result.raw(); |
| 2564 } |
| 2565 |
| 2566 |
| 2567 void RawSendPort::WriteTo(SnapshotWriter* writer, |
| 2568 intptr_t object_id, |
| 2569 Snapshot::Kind kind) { |
| 2570 // Write out the serialization header value for this object. |
| 2571 writer->WriteInlinedObjectHeader(object_id); |
| 2572 |
| 2573 // Write out the class and tags information. |
| 2574 writer->WriteIndexedObject(kSendPortCid); |
| 2575 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 2576 |
| 2577 writer->Write(ptr()->id_); |
| 2578 } |
| 2579 |
| 2580 |
2515 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, | 2581 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, |
2516 intptr_t object_id, | 2582 intptr_t object_id, |
2517 intptr_t tags, | 2583 intptr_t tags, |
2518 Snapshot::Kind kind) { | 2584 Snapshot::Kind kind) { |
2519 if (kind == Snapshot::kFull) { | 2585 if (kind == Snapshot::kFull) { |
2520 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), | 2586 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), |
2521 reader->NewStacktrace()); | 2587 reader->NewStacktrace()); |
2522 reader->AddBackRef(object_id, &result, kIsDeserialized); | 2588 reader->AddBackRef(object_id, &result, kIsDeserialized); |
2523 | 2589 |
2524 // There are no non object pointer fields. | 2590 // 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. | 2776 // We do not allow objects with native fields in an isolate message. |
2711 writer->SetWriteException(Exceptions::kArgument, | 2777 writer->SetWriteException(Exceptions::kArgument, |
2712 "Illegal argument in isolate message" | 2778 "Illegal argument in isolate message" |
2713 " : (object is a UserTag)"); | 2779 " : (object is a UserTag)"); |
2714 } else { | 2780 } else { |
2715 UNREACHABLE(); | 2781 UNREACHABLE(); |
2716 } | 2782 } |
2717 } | 2783 } |
2718 | 2784 |
2719 } // namespace dart | 2785 } // namespace dart |
OLD | NEW |