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 4386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4397 description = map['description']; | 4397 description = map['description']; |
4398 vmName = map['name']; | 4398 vmName = map['name']; |
4399 value = map['value']; | 4399 value = map['value']; |
4400 min = map['min']; | 4400 min = map['min']; |
4401 max = map['max']; | 4401 max = map['max']; |
4402 } | 4402 } |
4403 | 4403 |
4404 String toString() => "ServiceMetric($_id)"; | 4404 String toString() => "ServiceMetric($_id)"; |
4405 } | 4405 } |
4406 | 4406 |
| 4407 void printFrames(List<Frame> frames) async { |
| 4408 for (int i = 0; i < frames.length; i++) { |
| 4409 final Frame frame = frames[i]; |
| 4410 String frameText = await frame.toUserString(); |
| 4411 print('#${i.toString().padLeft(3)}: $frameText'); |
| 4412 } |
| 4413 } |
| 4414 |
4407 class Frame extends ServiceObject implements M.Frame { | 4415 class Frame extends ServiceObject implements M.Frame { |
4408 M.FrameKind kind = M.FrameKind.regular; | 4416 M.FrameKind kind = M.FrameKind.regular; |
4409 int index; | 4417 int index; |
4410 ServiceFunction function; | 4418 ServiceFunction function; |
4411 SourceLocation location; | 4419 SourceLocation location; |
4412 Code code; | 4420 Code code; |
4413 List<ServiceMap> variables = <ServiceMap>[]; | 4421 List<ServiceMap> variables = <ServiceMap>[]; |
4414 String marker; | 4422 String marker; |
4415 | 4423 |
4416 Frame._empty(ServiceObject owner) : super._empty(owner); | 4424 Frame._empty(ServiceObject owner) : super._empty(owner); |
(...skipping 26 matching lines...) Expand all Loading... |
4443 | 4451 |
4444 String toString() { | 4452 String toString() { |
4445 if (function != null) { | 4453 if (function != null) { |
4446 return "Frame([$kind] ${function.qualifiedName} $location)"; | 4454 return "Frame([$kind] ${function.qualifiedName} $location)"; |
4447 } else if (location != null) { | 4455 } else if (location != null) { |
4448 return "Frame([$kind] $location)"; | 4456 return "Frame([$kind] $location)"; |
4449 } else { | 4457 } else { |
4450 return "Frame([$kind])"; | 4458 return "Frame([$kind])"; |
4451 } | 4459 } |
4452 } | 4460 } |
| 4461 |
| 4462 String toUserString() async { |
| 4463 if (function != null) { |
| 4464 return "Frame([$kind] ${function.qualifiedName} " |
| 4465 "${await location.toUserString()})"; |
| 4466 } else if (location != null) { |
| 4467 return "Frame([$kind] ${await location.toUserString()}"; |
| 4468 } else { |
| 4469 return "Frame([$kind])"; |
| 4470 } |
| 4471 } |
4453 } | 4472 } |
4454 | 4473 |
4455 class ServiceMessage extends ServiceObject { | 4474 class ServiceMessage extends ServiceObject { |
4456 int index; | 4475 int index; |
4457 String messageObjectId; | 4476 String messageObjectId; |
4458 int size; | 4477 int size; |
4459 ServiceFunction handler; | 4478 ServiceFunction handler; |
4460 SourceLocation location; | 4479 SourceLocation location; |
4461 | 4480 |
4462 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); | 4481 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4554 var v = list[i]; | 4573 var v = list[i]; |
4555 if ((v is Map) && _isServiceMap(v)) { | 4574 if ((v is Map) && _isServiceMap(v)) { |
4556 list[i] = owner.getFromMap(v); | 4575 list[i] = owner.getFromMap(v); |
4557 } else if (v is List) { | 4576 } else if (v is List) { |
4558 _upgradeList(v, owner); | 4577 _upgradeList(v, owner); |
4559 } else if (v is Map) { | 4578 } else if (v is Map) { |
4560 _upgradeMap(v, owner); | 4579 _upgradeMap(v, owner); |
4561 } | 4580 } |
4562 } | 4581 } |
4563 } | 4582 } |
OLD | NEW |