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

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

Issue 2588083002: Revert "Added ability to request zone memory information for all isolates through the VM service an… (Closed)
Patch Set: Created 4 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
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 // Some value smaller than the object ring, so requesting a large array 7 // Some value smaller than the object ring, so requesting a large array
8 // doesn't result in an expired ref because the elements lapped it in the 8 // doesn't result in an expired ref because the elements lapped it in the
9 // object ring. 9 // object ring.
10 const int kDefaultFieldLimit = 100; 10 const int kDefaultFieldLimit = 100;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 break; 231 break;
232 case 'Library': 232 case 'Library':
233 obj = new Library._empty(owner); 233 obj = new Library._empty(owner);
234 break; 234 break;
235 case 'Message': 235 case 'Message':
236 obj = new ServiceMessage._empty(owner); 236 obj = new ServiceMessage._empty(owner);
237 break; 237 break;
238 case 'SourceLocation': 238 case 'SourceLocation':
239 obj = new SourceLocation._empty(owner); 239 obj = new SourceLocation._empty(owner);
240 break; 240 break;
241 case '_Thread':
242 obj = new Thread._empty(owner);
243 break;
244 case 'UnresolvedSourceLocation': 241 case 'UnresolvedSourceLocation':
245 obj = new UnresolvedSourceLocation._empty(owner); 242 obj = new UnresolvedSourceLocation._empty(owner);
246 break; 243 break;
247 case 'Object': 244 case 'Object':
248 switch (vmType) { 245 switch (vmType) {
249 case 'ICData': 246 case 'ICData':
250 obj = new ICData._empty(owner); 247 obj = new ICData._empty(owner);
251 break; 248 break;
252 case 'LocalVarDescriptors': 249 case 'LocalVarDescriptors':
253 obj = new LocalVarDescriptors._empty(owner); 250 obj = new LocalVarDescriptors._empty(owner);
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 final HeapSpace newSpace = new HeapSpace(); 1494 final HeapSpace newSpace = new HeapSpace();
1498 final HeapSpace oldSpace = new HeapSpace(); 1495 final HeapSpace oldSpace = new HeapSpace();
1499 1496
1500 String fileAndLine; 1497 String fileAndLine;
1501 1498
1502 DartError error; 1499 DartError error;
1503 StreamController _snapshotFetch; 1500 StreamController _snapshotFetch;
1504 1501
1505 List<ByteData> _chunksInProgress; 1502 List<ByteData> _chunksInProgress;
1506 1503
1507 List<Thread> get threads => _threads;
1508 final List<Thread> _threads = new List<Thread>();
1509
1510 void _loadHeapSnapshot(ServiceEvent event) { 1504 void _loadHeapSnapshot(ServiceEvent event) {
1511 if (_snapshotFetch == null || _snapshotFetch.isClosed) { 1505 if (_snapshotFetch == null || _snapshotFetch.isClosed) {
1512 // No outstanding snapshot request. Presumably another client asked for a 1506 // No outstanding snapshot request. Presumably another client asked for a
1513 // snapshot. 1507 // snapshot.
1514 Logger.root.info("Dropping unsolicited heap snapshot chunk"); 1508 Logger.root.info("Dropping unsolicited heap snapshot chunk");
1515 return; 1509 return;
1516 } 1510 }
1517 1511
1518 // Occasionally these actually arrive out of order. 1512 // Occasionally these actually arrive out of order.
1519 var chunkIndex = event.chunkIndex; 1513 var chunkIndex = event.chunkIndex;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 libraries.addAll(map['libraries']); 1617 libraries.addAll(map['libraries']);
1624 libraries.sort(ServiceObject.LexicalSortName); 1618 libraries.sort(ServiceObject.LexicalSortName);
1625 if (savedStartTime == null) { 1619 if (savedStartTime == null) {
1626 vm._buildIsolateList(); 1620 vm._buildIsolateList();
1627 } 1621 }
1628 1622
1629 extensionRPCs.clear(); 1623 extensionRPCs.clear();
1630 if (map['extensionRPCs'] != null) { 1624 if (map['extensionRPCs'] != null) {
1631 extensionRPCs.addAll(map['extensionRPCs']); 1625 extensionRPCs.addAll(map['extensionRPCs']);
1632 } 1626 }
1633
1634 threads.clear();
1635 if(map['threads'] != null) {
1636 threads.addAll(map['threads']);
1637 }
1638 } 1627 }
1639 1628
1640 Future<TagProfile> updateTagProfile() { 1629 Future<TagProfile> updateTagProfile() {
1641 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) { 1630 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) {
1642 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; 1631 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0;
1643 tagProfile._processTagProfile(seconds, map); 1632 tagProfile._processTagProfile(seconds, map);
1644 return tagProfile; 1633 return tagProfile;
1645 }); 1634 });
1646 } 1635 }
1647 1636
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3060 3049
3061 kind = stringToSentinelKind(map['kind']); 3050 kind = stringToSentinelKind(map['kind']);
3062 valueAsString = map['valueAsString']; 3051 valueAsString = map['valueAsString'];
3063 _loaded = true; 3052 _loaded = true;
3064 } 3053 }
3065 3054
3066 String toString() => 'Sentinel($kind)'; 3055 String toString() => 'Sentinel($kind)';
3067 String get shortName => valueAsString; 3056 String get shortName => valueAsString;
3068 } 3057 }
3069 3058
3070 class Thread extends ServiceObject implements M.Thread {
3071 M.ThreadKind get kind => _kind;
3072 M.ThreadKind _kind;
3073 List<Zone> get zones => _zones;
3074 final List<Zone> _zones = new List<Zone>();
3075
3076 Thread._empty(ServiceObjectOwner owner) : super._empty(owner);
3077
3078 void _update(Map map, bool mapIsRef) {
3079 String kindString = map['kind'];
3080 List<Map> zoneList = map['zones'];
3081
3082 switch(kindString) {
3083 case "kUnknownTask":
3084 _kind = M.ThreadKind.unknownTask;
3085 break;
3086 case "kMutatorTask":
3087 _kind = M.ThreadKind.mutatorTask;
3088 break;
3089 case "kCompilerTask":
3090 _kind = M.ThreadKind.compilerTask;
3091 break;
3092 case "kSweeperTask":
3093 _kind = M.ThreadKind.sweeperTask;
3094 break;
3095 case "kMarkerTask":
3096 _kind = M.ThreadKind.markerTask;
3097 break;
3098 case "kFinalizerTask":
3099 _kind = M.ThreadKind.finalizerTask;
3100 break;
3101 default:
3102 assert(false);
3103 }
3104 zones.clear();
3105 zoneList.forEach((zone) {
3106 int capacity = zone['capacity'];
3107 int used = zone['used'];
3108 zones.add(new Zone(capacity, used));
3109 });
3110 }
3111 }
3112
3113 class Zone implements M.Zone {
3114 int get capacity => _capacity;
3115 int _capacity;
3116 int get used => _used;
3117 int _used;
3118
3119 Zone(this._capacity, this._used);
3120 }
3121
3122 class Field extends HeapObject implements M.Field { 3059 class Field extends HeapObject implements M.Field {
3123 // Library or Class. 3060 // Library or Class.
3124 HeapObject dartOwner; 3061 HeapObject dartOwner;
3125 Library library; 3062 Library library;
3126 Instance declaredType; 3063 Instance declaredType;
3127 bool isStatic; 3064 bool isStatic;
3128 bool isFinal; 3065 bool isFinal;
3129 bool isConst; 3066 bool isConst;
3130 Instance staticValue; 3067 Instance staticValue;
3131 String name; 3068 String name;
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
4483 var v = list[i]; 4420 var v = list[i];
4484 if ((v is Map) && _isServiceMap(v)) { 4421 if ((v is Map) && _isServiceMap(v)) {
4485 list[i] = owner.getFromMap(v); 4422 list[i] = owner.getFromMap(v);
4486 } else if (v is List) { 4423 } else if (v is List) {
4487 _upgradeList(v, owner); 4424 _upgradeList(v, owner);
4488 } else if (v is Map) { 4425 } else if (v is Map) {
4489 _upgradeMap(v, owner); 4426 _upgradeMap(v, owner);
4490 } 4427 }
4491 } 4428 }
4492 } 4429 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698