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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 243973002: - Add a minimal implementation of Capability. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 35287)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -2512,6 +2512,72 @@
#undef EXT_TYPED_DATA_WRITE
+RawCapability* Capability::ReadFrom(SnapshotReader* reader,
+ intptr_t object_id,
+ intptr_t tags,
+ Snapshot::Kind kind) {
+ UNIMPLEMENTED();
+ return Capability::null();
+}
+
+
+void RawCapability::WriteTo(SnapshotWriter* writer,
+ intptr_t object_id,
+ Snapshot::Kind kind) {
+ UNIMPLEMENTED();
+}
+
+
+RawReceivePort* ReceivePort::ReadFrom(SnapshotReader* reader,
+ intptr_t object_id,
+ intptr_t tags,
+ Snapshot::Kind kind) {
+ UNREACHABLE();
+ return ReceivePort::null();
+}
+
+
+void RawReceivePort::WriteTo(SnapshotWriter* writer,
+ intptr_t object_id,
+ Snapshot::Kind kind) {
+ if (kind == Snapshot::kMessage) {
+ // We do not allow objects with native fields in an isolate message.
+ writer->SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
+ " : (object is a RawReceivePort)");
+ } else {
+ UNREACHABLE();
+ }
+}
+
+
+RawSendPort* SendPort::ReadFrom(SnapshotReader* reader,
+ intptr_t object_id,
+ intptr_t tags,
+ Snapshot::Kind kind) {
+ uint64_t id = reader->Read<uint64_t>();
+
+ SendPort& result = SendPort::ZoneHandle(reader->isolate(),
+ SendPort::New(id));
+ reader->AddBackRef(object_id, &result, kIsDeserialized);
+ return result.raw();
+}
+
+
+void RawSendPort::WriteTo(SnapshotWriter* writer,
+ intptr_t object_id,
+ Snapshot::Kind kind) {
+ // Write out the serialization header value for this object.
+ writer->WriteInlinedObjectHeader(object_id);
+
+ // Write out the class and tags information.
+ writer->WriteIndexedObject(kSendPortCid);
+ writer->WriteIntptrValue(writer->GetObjectTags(this));
+
+ writer->Write(ptr()->id_);
+}
+
+
RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698