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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 197853005: Show object pool on code page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of service; 5 part of service;
6 6
7 /// State for a running isolate. 7 /// State for a running isolate.
8 class Isolate extends ServiceObject { 8 class Isolate extends ServiceObject {
9 final VM vm; 9 final VM vm;
10 String get link => _id; 10 String get link => _id;
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 @reflectable int exclusiveTicks = 0; 468 @reflectable int exclusiveTicks = 0;
469 @reflectable int inclusiveTicks = 0; 469 @reflectable int inclusiveTicks = 0;
470 @reflectable int startAddress = 0; 470 @reflectable int startAddress = 0;
471 @reflectable int endAddress = 0; 471 @reflectable int endAddress = 0;
472 @reflectable final callers = new List<CodeCallCount>(); 472 @reflectable final callers = new List<CodeCallCount>();
473 @reflectable final callees = new List<CodeCallCount>(); 473 @reflectable final callees = new List<CodeCallCount>();
474 @reflectable final instructions = new ObservableList<CodeInstruction>(); 474 @reflectable final instructions = new ObservableList<CodeInstruction>();
475 @reflectable final addressTicks = new ObservableMap<int, CodeTick>(); 475 @reflectable final addressTicks = new ObservableMap<int, CodeTick>();
476 @observable String formattedInclusiveTicks = ''; 476 @observable String formattedInclusiveTicks = '';
477 @observable String formattedExclusiveTicks = ''; 477 @observable String formattedExclusiveTicks = '';
478 478 @observable ServiceMap objectPool;
479 @observable ServiceMap function; 479 @observable ServiceMap function;
480 String name; 480 String name;
481 String vmName; 481 String vmName;
482 482
483 Code.fromMap(Isolate isolate, Map map) : super.fromMap(isolate, map); 483 Code.fromMap(Isolate isolate, Map map) : super.fromMap(isolate, map);
484 484
485 // Reset all data associated with a profile. 485 // Reset all data associated with a profile.
486 void resetProfileData() { 486 void resetProfileData() {
487 totalSamplesInProfile = 0; 487 totalSamplesInProfile = 0;
488 exclusiveTicks = 0; 488 exclusiveTicks = 0;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 _resolveCalls(callees, profileData['callees'], codeTable); 540 _resolveCalls(callees, profileData['callees'], codeTable);
541 var ticks = profileData['ticks']; 541 var ticks = profileData['ticks'];
542 if (ticks != null) { 542 if (ticks != null) {
543 _processTicks(ticks); 543 _processTicks(ticks);
544 } 544 }
545 formattedInclusiveTicks = 545 formattedInclusiveTicks =
546 '${formatPercent(inclusiveTicks, totalSamplesInProfile)} ' 546 '${formatPercent(inclusiveTicks, totalSamplesInProfile)} '
547 '($inclusiveTicks)'; 547 '($inclusiveTicks)';
548 formattedExclusiveTicks = 548 formattedExclusiveTicks =
549 '${formatPercent(exclusiveTicks, totalSamplesInProfile)} ' 549 '${formatPercent(exclusiveTicks, totalSamplesInProfile)} '
550 '($inclusiveTicks)'; 550 '($exclusiveTicks)';
Cutch 2014/03/14 14:37:21 One line fix for unrelated bug.
551 } 551 }
552 552
553 void _update(ObservableMap m) { 553 void _update(ObservableMap m) {
554 assert(ServiceObject.isServiceMap(m)); 554 assert(ServiceObject.isServiceMap(m));
555 assert(m['id'] == _id); 555 assert(m['id'] == _id);
556 assert(ServiceObject.stripRef(m['type']) == _serviceType); 556 assert(ServiceObject.stripRef(m['type']) == _serviceType);
557 name = m['user_name']; 557 name = m['user_name'];
558 vmName = m['name']; 558 vmName = m['name'];
559 kind = CodeKind.fromString(m['kind']); 559 kind = CodeKind.fromString(m['kind']);
560 startAddress = int.parse(m['start'], radix:16); 560 startAddress = int.parse(m['start'], radix:16);
561 endAddress = int.parse(m['end'], radix:16); 561 endAddress = int.parse(m['end'], radix:16);
562 // Upgrade the function. 562 function = _upgradeToServiceObject(vm, isolate, m['function']);
563 function = _upgradeToServiceObject(isolate.vm, isolate, m['function']); 563 objectPool = _upgradeToServiceObject(vm, isolate, m['object_pool']);
564 var disassembly = m['disassembly']; 564 var disassembly = m['disassembly'];
565 if (disassembly != null) { 565 if (disassembly != null) {
566 _processDisassembly(disassembly); 566 _processDisassembly(disassembly);
567 } 567 }
568 // We are a reference if we don't have instructions and are Dart code. 568 // We are a reference if we don't have instructions and are Dart code.
569 _ref = (instructions.length == 0) && (kind == CodeKind.Dart); 569 _ref = (instructions.length == 0) && (kind == CodeKind.Dart);
570 hasDisassembly = (instructions.length != 0) && (kind == CodeKind.Dart); 570 hasDisassembly = (instructions.length != 0) && (kind == CodeKind.Dart);
571 } 571 }
572 572
573 @observable bool hasDisassembly = false; 573 @observable bool hasDisassembly = false;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 625
626 int _callCount(List<CodeCallCount> calls, Code code) { 626 int _callCount(List<CodeCallCount> calls, Code code) {
627 for (CodeCallCount caller in calls) { 627 for (CodeCallCount caller in calls) {
628 if (caller.code == code) { 628 if (caller.code == code) {
629 return caller.count; 629 return caller.count;
630 } 630 }
631 } 631 }
632 return 0; 632 return 0;
633 } 633 }
634 } 634 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698