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

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

Issue 773303003: observatory: populate 'architecture' in VM, and add numerical vmId in Class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | runtime/bin/vmservice/observatory/test/classes_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// A [ServiceObject] is an object known to the VM service and is tied 7 /// A [ServiceObject] is an object known to the VM service and is tied
8 /// to an owning [Isolate]. 8 /// to an owning [Isolate].
9 abstract class ServiceObject extends Observable { 9 abstract class ServiceObject extends Observable {
10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 abstract class VM extends ServiceObjectOwner { 326 abstract class VM extends ServiceObjectOwner {
327 @reflectable VM get vm => this; 327 @reflectable VM get vm => this;
328 @reflectable Isolate get isolate => null; 328 @reflectable Isolate get isolate => null;
329 329
330 @reflectable Iterable<Isolate> get isolates => _isolateCache.values; 330 @reflectable Iterable<Isolate> get isolates => _isolateCache.values;
331 331
332 @reflectable String get link => '$id'; 332 @reflectable String get link => '$id';
333 @reflectable String relativeLink(String id) => '$id'; 333 @reflectable String relativeLink(String id) => '$id';
334 334
335 @observable String version = 'unknown'; 335 @observable String version = 'unknown';
336 @observable String architecture = 'unknown'; 336 @observable String targetCPU;
Cutch 2014/12/04 17:40:33 check that the VM view still works. It probably re
koda 2014/12/04 17:41:51 No, this field was completely unused until now.
337 @observable int architectureBits;
337 @observable double uptime = 0.0; 338 @observable double uptime = 0.0;
338 @observable bool assertsEnabled = false; 339 @observable bool assertsEnabled = false;
339 @observable bool typeChecksEnabled = false; 340 @observable bool typeChecksEnabled = false;
340 @observable String pid = ''; 341 @observable String pid = '';
341 @observable DateTime lastUpdate; 342 @observable DateTime lastUpdate;
342 343
343 VM() : super._empty(null) { 344 VM() : super._empty(null) {
344 name = 'vm'; 345 name = 'vm';
345 vmName = 'vm'; 346 vmName = 'vm';
346 _cache['vm'] = this; 347 _cache['vm'] = this;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 Future get onConnect; 551 Future get onConnect;
551 /// Completes when the VM disconnects or there was an error connecting. 552 /// Completes when the VM disconnects or there was an error connecting.
552 Future get onDisconnect; 553 Future get onDisconnect;
553 554
554 void _update(ObservableMap map, bool mapIsRef) { 555 void _update(ObservableMap map, bool mapIsRef) {
555 if (mapIsRef) { 556 if (mapIsRef) {
556 return; 557 return;
557 } 558 }
558 _loaded = true; 559 _loaded = true;
559 version = map['version']; 560 version = map['version'];
560 architecture = map['architecture']; 561 targetCPU = map['targetCPU'];
562 architectureBits = map['architectureBits'];
561 uptime = map['uptime']; 563 uptime = map['uptime'];
562 var dateInMillis = int.parse(map['date']); 564 var dateInMillis = int.parse(map['date']);
563 lastUpdate = new DateTime.fromMillisecondsSinceEpoch(dateInMillis); 565 lastUpdate = new DateTime.fromMillisecondsSinceEpoch(dateInMillis);
564 assertsEnabled = map['assertsEnabled']; 566 assertsEnabled = map['assertsEnabled'];
565 pid = map['pid']; 567 pid = map['pid'];
566 typeChecksEnabled = map['typeChecksEnabled']; 568 typeChecksEnabled = map['typeChecksEnabled'];
567 _updateIsolates(map['isolates']); 569 _updateIsolates(map['isolates']);
568 } 570 }
569 571
570 void _updateIsolates(List newIsolates) { 572 void _updateIsolates(List newIsolates) {
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 @observable bool isAbstract; 1433 @observable bool isAbstract;
1432 @observable bool isConst; 1434 @observable bool isConst;
1433 @observable bool isFinalized; 1435 @observable bool isFinalized;
1434 @observable bool isPatch; 1436 @observable bool isPatch;
1435 @observable bool isImplemented; 1437 @observable bool isImplemented;
1436 1438
1437 @observable int tokenPos; 1439 @observable int tokenPos;
1438 @observable int endTokenPos; 1440 @observable int endTokenPos;
1439 1441
1440 @observable ServiceMap error; 1442 @observable ServiceMap error;
1443 @observable int vmCid;
1441 1444
1442 final Allocations newSpace = new Allocations(); 1445 final Allocations newSpace = new Allocations();
1443 final Allocations oldSpace = new Allocations(); 1446 final Allocations oldSpace = new Allocations();
1444 final AllocationCount promotedByLastNewGC = new AllocationCount(); 1447 final AllocationCount promotedByLastNewGC = new AllocationCount();
1445 1448
1446 bool get hasNoAllocations => newSpace.empty && oldSpace.empty; 1449 bool get hasNoAllocations => newSpace.empty && oldSpace.empty;
1447 1450
1448 @reflectable final fields = new ObservableList<Field>(); 1451 @reflectable final fields = new ObservableList<Field>();
1449 @reflectable final functions = new ObservableList<ServiceFunction>(); 1452 @reflectable final functions = new ObservableList<ServiceFunction>();
1450 1453
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 functions.clear(); 1503 functions.clear();
1501 functions.addAll(map['functions']); 1504 functions.addAll(map['functions']);
1502 functions.sort(ServiceObject.LexicalSortName); 1505 functions.sort(ServiceObject.LexicalSortName);
1503 1506
1504 superclass = map['super']; 1507 superclass = map['super'];
1505 // Work-around Object not tracking its subclasses in the VM. 1508 // Work-around Object not tracking its subclasses in the VM.
1506 if (superclass != null && superclass.name == "Object") { 1509 if (superclass != null && superclass.name == "Object") {
1507 superclass._addSubclass(this); 1510 superclass._addSubclass(this);
1508 } 1511 }
1509 error = map['error']; 1512 error = map['error'];
1513 var idPrefix = "classes/";
1514 assert(id.startsWith(idPrefix));
1515 vmCid = int.parse(id.substring(idPrefix.length));
1510 1516
1511 var allocationStats = map['allocationStats']; 1517 var allocationStats = map['allocationStats'];
1512 if (allocationStats != null) { 1518 if (allocationStats != null) {
1513 newSpace.update(allocationStats['new']); 1519 newSpace.update(allocationStats['new']);
1514 oldSpace.update(allocationStats['old']); 1520 oldSpace.update(allocationStats['old']);
1515 promotedByLastNewGC.instances = allocationStats['promotedInstances']; 1521 promotedByLastNewGC.instances = allocationStats['promotedInstances'];
1516 promotedByLastNewGC.bytes = allocationStats['promotedBytes']; 1522 promotedByLastNewGC.bytes = allocationStats['promotedBytes'];
1517 } 1523 }
1518 } 1524 }
1519 1525
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 var v = list[i]; 2735 var v = list[i];
2730 if ((v is ObservableMap) && _isServiceMap(v)) { 2736 if ((v is ObservableMap) && _isServiceMap(v)) {
2731 list[i] = owner.getFromMap(v); 2737 list[i] = owner.getFromMap(v);
2732 } else if (v is ObservableList) { 2738 } else if (v is ObservableList) {
2733 _upgradeObservableList(v, owner); 2739 _upgradeObservableList(v, owner);
2734 } else if (v is ObservableMap) { 2740 } else if (v is ObservableMap) {
2735 _upgradeObservableMap(v, owner); 2741 _upgradeObservableMap(v, owner);
2736 } 2742 }
2737 } 2743 }
2738 } 2744 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/vmservice/observatory/test/classes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698