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

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

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 years, 10 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
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 4387 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 class Frame extends ServiceObject implements M.Frame { 4407 class Frame extends ServiceObject implements M.Frame {
4408 M.FrameKind kind = M.FrameKind.regular;
4408 int index; 4409 int index;
4409 ServiceFunction function; 4410 ServiceFunction function;
4410 SourceLocation location; 4411 SourceLocation location;
4411 Code code; 4412 Code code;
4412 List<ServiceMap> variables = <ServiceMap>[]; 4413 List<ServiceMap> variables = <ServiceMap>[];
4414 String marker;
4413 4415
4414 Frame._empty(ServiceObject owner) : super._empty(owner); 4416 Frame._empty(ServiceObject owner) : super._empty(owner);
4415 4417
4416 void _update(Map map, bool mapIsRef) { 4418 void _update(Map map, bool mapIsRef) {
4417 assert(!mapIsRef); 4419 assert(!mapIsRef);
4418 _loaded = true; 4420 _loaded = true;
4419 _upgradeCollection(map, owner); 4421 _upgradeCollection(map, owner);
4422 this.kind = _fromString(map['kind']);
4423 this.marker = map['marker'];
4420 this.index = map['index']; 4424 this.index = map['index'];
4421 this.function = map['function']; 4425 this.function = map['function'];
4422 this.location = map['location']; 4426 this.location = map['location'];
4423 this.code = map['code']; 4427 this.code = map['code'];
4424 this.variables = map['vars']; 4428 this.variables = map['vars'] ?? [];
4425 } 4429 }
4426 4430
4427 String toString() => "Frame(${function.qualifiedName} $location)"; 4431 M.FrameKind _fromString(String frameKind) {
4432 if (frameKind == null) {
4433 return M.FrameKind.regular;
4434 }
4435 switch (frameKind) {
4436 case 'kRegular': return M.FrameKind.regular;
4437 case 'kAsyncCausal': return M.FrameKind.asyncCausal;
4438 case 'kAsyncSuspensionMarker': return M.FrameKind.asyncSuspensionMarker;
4439 default:
4440 throw new UnsupportedError('Unknown FrameKind: $frameKind');
4441 }
4442 }
4443
4444 String toString() {
4445 if (function != null) {
4446 return "Frame([$kind] ${function.qualifiedName} $location)";
4447 } else if (location != null) {
4448 return "Frame([$kind] $location)";
4449 } else {
4450 return "Frame([$kind])";
4451 }
4452 }
4428 } 4453 }
4429 4454
4430 class ServiceMessage extends ServiceObject { 4455 class ServiceMessage extends ServiceObject {
4431 int index; 4456 int index;
4432 String messageObjectId; 4457 String messageObjectId;
4433 int size; 4458 int size;
4434 ServiceFunction handler; 4459 ServiceFunction handler;
4435 SourceLocation location; 4460 SourceLocation location;
4436 4461
4437 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); 4462 ServiceMessage._empty(ServiceObject owner) : super._empty(owner);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
4529 var v = list[i]; 4554 var v = list[i];
4530 if ((v is Map) && _isServiceMap(v)) { 4555 if ((v is Map) && _isServiceMap(v)) {
4531 list[i] = owner.getFromMap(v); 4556 list[i] = owner.getFromMap(v);
4532 } else if (v is List) { 4557 } else if (v is List) {
4533 _upgradeList(v, owner); 4558 _upgradeList(v, owner);
4534 } else if (v is Map) { 4559 } else if (v is Map) {
4535 _upgradeMap(v, owner); 4560 _upgradeMap(v, owner);
4536 } 4561 }
4537 } 4562 }
4538 } 4563 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698