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

Unified Diff: runtime/observatory/lib/src/cpu_profile/cpu_profile.dart

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 | « no previous file | runtime/vm/profiler_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
diff --git a/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart b/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
index 1ce26489a63823acd61262e8d430f0735330f113..87c4213219abeefdbf20c4beaea149013ea1ab09 100644
--- a/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
+++ b/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart
@@ -477,9 +477,11 @@ class ProfileCode implements M.ProfileCode {
assert(profileTicks != null);
assert((profileTicks.length % 3) == 0);
for (var i = 0; i < profileTicks.length; i += 3) {
+ // TODO(observatory): Address is not necessarily representable as a JS
+ // integer.
var address = int.parse(profileTicks[i], radix: 16);
- var exclusive = int.parse(profileTicks[i + 1]);
- var inclusive = int.parse(profileTicks[i + 2]);
+ var exclusive = profileTicks[i + 1];
+ var inclusive = profileTicks[i + 2];
var tick = new CodeTick(exclusive, inclusive);
addressTicks[address] = tick;
@@ -524,8 +526,8 @@ class ProfileCode implements M.ProfileCode {
} else if (code.kind == M.CodeKind.native) {
attributes.add('native');
}
- inclusiveTicks = int.parse(data['inclusiveTicks']);
- exclusiveTicks = int.parse(data['exclusiveTicks']);
+ inclusiveTicks = data['inclusiveTicks'];
+ exclusiveTicks = data['exclusiveTicks'];
normalizedExclusiveTicks = exclusiveTicks / profile.sampleCount;
@@ -690,8 +692,8 @@ class ProfileFunction implements M.ProfileFunction {
profileCodes.sort(_sortCodes);
_addKindBasedAttributes(attributes);
- exclusiveTicks = int.parse(data['exclusiveTicks']);
- inclusiveTicks = int.parse(data['inclusiveTicks']);
+ exclusiveTicks = data['exclusiveTicks'];
+ inclusiveTicks = data['inclusiveTicks'];
normalizedExclusiveTicks = exclusiveTicks / profile.sampleCount;
normalizedInclusiveTicks = inclusiveTicks / profile.sampleCount;
« no previous file with comments | « no previous file | runtime/vm/profiler_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698