OLD | NEW |
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 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3063 _loaded = true; | 3063 _loaded = true; |
3064 } | 3064 } |
3065 | 3065 |
3066 String toString() => 'Sentinel($kind)'; | 3066 String toString() => 'Sentinel($kind)'; |
3067 String get shortName => valueAsString; | 3067 String get shortName => valueAsString; |
3068 } | 3068 } |
3069 | 3069 |
3070 class Thread extends ServiceObject implements M.Thread { | 3070 class Thread extends ServiceObject implements M.Thread { |
3071 M.ThreadKind get kind => _kind; | 3071 M.ThreadKind get kind => _kind; |
3072 M.ThreadKind _kind; | 3072 M.ThreadKind _kind; |
| 3073 String get kindString => _kindString; |
| 3074 String _kindString; |
3073 List<Zone> get zones => _zones; | 3075 List<Zone> get zones => _zones; |
3074 final List<Zone> _zones = new List<Zone>(); | 3076 final List<Zone> _zones = new List<Zone>(); |
3075 | 3077 |
3076 Thread._empty(ServiceObjectOwner owner) : super._empty(owner); | 3078 Thread._empty(ServiceObjectOwner owner) : super._empty(owner); |
3077 | 3079 |
3078 void _update(Map map, bool mapIsRef) { | 3080 void _update(Map map, bool mapIsRef) { |
3079 String kindString = map['kind']; | 3081 String rawKind = map['kind']; |
3080 List<Map> zoneList = map['zones']; | 3082 List<Map> zoneList = map['zones']; |
3081 | 3083 |
3082 switch(kindString) { | 3084 switch(rawKind) { |
3083 case "kUnknownTask": | 3085 case "kUnknownTask": |
3084 _kind = M.ThreadKind.unknownTask; | 3086 _kind = M.ThreadKind.unknownTask; |
| 3087 _kindString = 'unknown'; |
3085 break; | 3088 break; |
3086 case "kMutatorTask": | 3089 case "kMutatorTask": |
3087 _kind = M.ThreadKind.mutatorTask; | 3090 _kind = M.ThreadKind.mutatorTask; |
| 3091 _kindString = 'mutator'; |
3088 break; | 3092 break; |
3089 case "kCompilerTask": | 3093 case "kCompilerTask": |
3090 _kind = M.ThreadKind.compilerTask; | 3094 _kind = M.ThreadKind.compilerTask; |
| 3095 _kindString = 'compiler'; |
3091 break; | 3096 break; |
3092 case "kSweeperTask": | 3097 case "kSweeperTask": |
3093 _kind = M.ThreadKind.sweeperTask; | 3098 _kind = M.ThreadKind.sweeperTask; |
| 3099 _kindString = 'sweeper'; |
3094 break; | 3100 break; |
3095 case "kMarkerTask": | 3101 case "kMarkerTask": |
3096 _kind = M.ThreadKind.markerTask; | 3102 _kind = M.ThreadKind.markerTask; |
| 3103 _kindString = 'marker'; |
3097 break; | 3104 break; |
3098 case "kFinalizerTask": | 3105 case "kFinalizerTask": |
3099 _kind = M.ThreadKind.finalizerTask; | 3106 _kind = M.ThreadKind.finalizerTask; |
| 3107 _kindString = 'finalizer'; |
3100 break; | 3108 break; |
3101 default: | 3109 default: |
3102 assert(false); | 3110 assert(false); |
3103 } | 3111 } |
3104 zones.clear(); | 3112 zones.clear(); |
3105 zoneList.forEach((zone) { | 3113 zoneList.forEach((zone) { |
3106 int capacity = zone['capacity']; | 3114 int capacity = zone['capacity']; |
3107 int used = zone['used']; | 3115 int used = zone['used']; |
3108 zones.add(new Zone(capacity, used)); | 3116 zones.add(new Zone(capacity, used)); |
3109 }); | 3117 }); |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4483 var v = list[i]; | 4491 var v = list[i]; |
4484 if ((v is Map) && _isServiceMap(v)) { | 4492 if ((v is Map) && _isServiceMap(v)) { |
4485 list[i] = owner.getFromMap(v); | 4493 list[i] = owner.getFromMap(v); |
4486 } else if (v is List) { | 4494 } else if (v is List) { |
4487 _upgradeList(v, owner); | 4495 _upgradeList(v, owner); |
4488 } else if (v is Map) { | 4496 } else if (v is Map) { |
4489 _upgradeMap(v, owner); | 4497 _upgradeMap(v, owner); |
4490 } | 4498 } |
4491 } | 4499 } |
4492 } | 4500 } |
OLD | NEW |