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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1634863002: Introduce CodeSourceMap object to hold pc -> token position mappings (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 4b92cccc9b6fbcab11553f8570ccdce3ec6475ce..3a934d5b496f7d9dba67d4c1382ebfb2b3ec000a 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -1676,6 +1676,51 @@ void RawPcDescriptors::WriteTo(SnapshotWriter* writer,
}
+RawCodeSourceMap* CodeSourceMap::ReadFrom(SnapshotReader* reader,
+ intptr_t object_id,
+ intptr_t tags,
+ Snapshot::Kind kind,
+ bool as_reference) {
+ ASSERT(reader->snapshot_code());
+ ASSERT(kind == Snapshot::kFull);
+
+ const int32_t length = reader->Read<int32_t>();
+ CodeSourceMap& result =
+ CodeSourceMap::ZoneHandle(reader->zone(),
+ NEW_OBJECT_WITH_LEN(CodeSourceMap, length));
+ reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+ if (result.Length() > 0) {
+ NoSafepointScope no_safepoint;
+ intptr_t len = result.Length();
+ uint8_t* data = result.UnsafeMutableNonPointer(result.raw_ptr()->data());
+ reader->ReadBytes(data, len);
+ }
+
+ return result.raw();
+}
+
+
+void RawCodeSourceMap::WriteTo(SnapshotWriter* writer,
+ intptr_t object_id,
+ Snapshot::Kind kind,
+ bool as_reference) {
+ ASSERT(writer->snapshot_code());
+ ASSERT(kind == Snapshot::kFull);
+
+ // Write out the serialization header value for this object.
+ writer->WriteInlinedObjectHeader(object_id);
+ writer->WriteIndexedObject(kCodeSourceMapCid);
+ writer->WriteTags(writer->GetObjectTags(this));
+ writer->Write<int32_t>(ptr()->length_);
+ if (ptr()->length_ > 0) {
+ intptr_t len = ptr()->length_;
+ uint8_t* data = reinterpret_cast<uint8_t*>(ptr()->data());
+ writer->WriteBytes(data, len);
+ }
+}
+
+
RawStackmap* Stackmap::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698