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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 12730013: - Use dart:typedata types in the Dart API calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/object.h ('k') | runtime/vm/snapshot.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 19847)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -2468,8 +2468,18 @@
intptr_t object_id,
intptr_t tags,
Snapshot::Kind kind) {
- UNIMPLEMENTED();
- return ExternalTypedData::null();
+ ASSERT(kind != Snapshot::kFull);
+ intptr_t cid = RawObject::ClassIdTag::decode(tags);
+ intptr_t length = reader->ReadSmiValue();
+ uint8_t* data = reinterpret_cast<uint8_t*>(reader->ReadIntptrValue());
+ const ExternalTypedData& obj = ExternalTypedData::Handle(
+ ExternalTypedData::New(cid, data, length));
+ void* peer = reinterpret_cast<void*>(reader->ReadIntptrValue());
+ Dart_WeakPersistentHandleFinalizer callback =
+ reinterpret_cast<Dart_WeakPersistentHandleFinalizer>(
+ reader->ReadIntptrValue());
+ obj.AddFinalizer(peer, callback);
+ return obj.raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698