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

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

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: Observatory UI support Created 3 years, 11 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 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after
4383 vmName = map['name']; 4383 vmName = map['name'];
4384 value = map['value']; 4384 value = map['value'];
4385 min = map['min']; 4385 min = map['min'];
4386 max = map['max']; 4386 max = map['max'];
4387 } 4387 }
4388 4388
4389 String toString() => "ServiceMetric($_id)"; 4389 String toString() => "ServiceMetric($_id)";
4390 } 4390 }
4391 4391
4392 class Frame extends ServiceObject implements M.Frame { 4392 class Frame extends ServiceObject implements M.Frame {
4393 M.FrameKind kind = M.FrameKind.regular;
4393 int index; 4394 int index;
4394 ServiceFunction function; 4395 ServiceFunction function;
4395 SourceLocation location; 4396 SourceLocation location;
4396 Code code; 4397 Code code;
4397 List<ServiceMap> variables = <ServiceMap>[]; 4398 List<ServiceMap> variables = <ServiceMap>[];
4399 String marker;
4398 4400
4399 Frame._empty(ServiceObject owner) : super._empty(owner); 4401 Frame._empty(ServiceObject owner) : super._empty(owner);
4400 4402
4401 void _update(Map map, bool mapIsRef) { 4403 void _update(Map map, bool mapIsRef) {
4402 assert(!mapIsRef); 4404 assert(!mapIsRef);
4403 _loaded = true; 4405 _loaded = true;
4404 _upgradeCollection(map, owner); 4406 _upgradeCollection(map, owner);
4407 this.kind = _fromString(map['kind']);
4408 this.marker = map['marker'];
4405 this.index = map['index']; 4409 this.index = map['index'];
4406 this.function = map['function']; 4410 this.function = map['function'];
4407 this.location = map['location']; 4411 this.location = map['location'];
4408 this.code = map['code']; 4412 this.code = map['code'];
4409 this.variables = map['vars']; 4413 this.variables = map['vars'] ?? [];
4410 } 4414 }
4411 4415
4412 String toString() => "Frame(${function.qualifiedName} $location)"; 4416 M.FrameKind _fromString(String frameKind) {
4417 if (frameKind == null) {
4418 return M.FrameKind.regular;
4419 }
4420 switch (frameKind) {
4421 case 'kRegular': return M.FrameKind.regular;
4422 case 'kAsyncCausal': return M.FrameKind.asyncCausal;
4423 case 'kAsyncSuspensionMarker': return M.FrameKind.asyncSuspensionMarker;
4424 default:
4425 throw new UnsupportedError('Unknown FrameKind: $frameKind');
4426 }
4427 }
4428
4429 String toString() => "Frame([$kind] ${function.qualifiedName} $location)";
4413 } 4430 }
4414 4431
4415 class ServiceMessage extends ServiceObject { 4432 class ServiceMessage extends ServiceObject {
4416 int index; 4433 int index;
4417 String messageObjectId; 4434 String messageObjectId;
4418 int size; 4435 int size;
4419 ServiceFunction handler; 4436 ServiceFunction handler;
4420 SourceLocation location; 4437 SourceLocation location;
4421 4438
4422 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); 4439 ServiceMessage._empty(ServiceObject owner) : super._empty(owner);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
4514 var v = list[i]; 4531 var v = list[i];
4515 if ((v is Map) && _isServiceMap(v)) { 4532 if ((v is Map) && _isServiceMap(v)) {
4516 list[i] = owner.getFromMap(v); 4533 list[i] = owner.getFromMap(v);
4517 } else if (v is List) { 4534 } else if (v is List) {
4518 _upgradeList(v, owner); 4535 _upgradeList(v, owner);
4519 } else if (v is Map) { 4536 } else if (v is Map) {
4520 _upgradeMap(v, owner); 4537 _upgradeMap(v, owner);
4521 } 4538 }
4522 } 4539 }
4523 } 4540 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698