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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1885503005: Add event for script snapshot reading with the snapshot size and resulting heap size. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index e8c31a9e10f8171cfa4a4e98f9fe64fe1152ff6b..bd3fe231eb0ce964c8447d190c655743f53c6ae9 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5204,11 +5204,20 @@ DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer,
CHECK_COMPILATION_ALLOWED(I);
ASSERT(snapshot->kind() == Snapshot::kScript);
+ NOT_IN_PRODUCT(TimelineDurationScope tds2(T,
+ Timeline::GetIsolateStream(), "ScriptSnapshotReader"));
+
ScriptSnapshotReader reader(snapshot->content(), snapshot->length(), T);
const Object& tmp = Object::Handle(Z, reader.ReadScriptSnapshot());
if (tmp.IsError()) {
return Api::NewHandle(T, tmp.raw());
}
+ NOT_IN_PRODUCT(if (tds2.enabled()) {
+ tds2.SetNumArguments(2);
+ tds2.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length());
+ tds2.FormatArgument(1, "heapSize", "%" Pd64,
+ I->heap()->UsedInWords(Heap::kOld) * kWordSize);
+ });
library ^= tmp.raw();
library.set_debuggable(true);
I->object_store()->set_root_library(library);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698