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

Unified Diff: runtime/vm/profiler_service.cc

Issue 2951803004: [vm-service] Encode ticks directly as integers, since they are expect to stay in JS integer range. (Closed)
Patch Set: Created 3 years, 6 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/observatory/lib/src/cpu_profile/cpu_profile.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 3f8d50758cec5f5129141e08e5581d22593617f8..3b8a8cd05a036356a07e8be1691edfbaa0ffa329 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -229,8 +229,8 @@ void ProfileFunction::PrintToJSONObject(JSONObject* func) {
void ProfileFunction::PrintToJSONArray(JSONArray* functions) {
JSONObject obj(functions);
obj.AddProperty("kind", KindToCString(kind()));
- obj.AddPropertyF("inclusiveTicks", "%" Pd "", inclusive_ticks());
- obj.AddPropertyF("exclusiveTicks", "%" Pd "", exclusive_ticks());
+ obj.AddProperty("inclusiveTicks", inclusive_ticks());
+ obj.AddProperty("exclusiveTicks", exclusive_ticks());
if (kind() == kDartFunction) {
ASSERT(!function_.IsNull());
obj.AddProperty("function", function_);
@@ -507,8 +507,8 @@ const char* ProfileCode::KindToCString(Kind kind) {
void ProfileCode::PrintToJSONArray(JSONArray* codes) {
JSONObject obj(codes);
obj.AddProperty("kind", ProfileCode::KindToCString(kind()));
- obj.AddPropertyF("inclusiveTicks", "%" Pd "", inclusive_ticks());
- obj.AddPropertyF("exclusiveTicks", "%" Pd "", exclusive_ticks());
+ obj.AddProperty("inclusiveTicks", inclusive_ticks());
+ obj.AddProperty("exclusiveTicks", exclusive_ticks());
if (kind() == kDartCode) {
ASSERT(!code_.IsNull());
obj.AddProperty("code", code_);
@@ -527,8 +527,8 @@ void ProfileCode::PrintToJSONArray(JSONArray* codes) {
for (intptr_t i = 0; i < address_ticks_.length(); i++) {
const ProfileCodeAddress& entry = address_ticks_[i];
ticks.AddValueF("%" Px "", entry.pc());
- ticks.AddValueF("%" Pd "", entry.exclusive_ticks());
- ticks.AddValueF("%" Pd "", entry.inclusive_ticks());
+ ticks.AddValue(entry.exclusive_ticks());
+ ticks.AddValue(entry.inclusive_ticks());
}
}
}
« no previous file with comments | « runtime/observatory/lib/src/cpu_profile/cpu_profile.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698