Chromium Code Reviews| Index: runtime/observatory/lib/src/service/object.dart |
| diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart |
| index 0eee58f8a2ca4b30ab15fa6483da929c5693d639..dd4039d67a36804f307714c3141cade90f15eabe 100644 |
| --- a/runtime/observatory/lib/src/service/object.dart |
| +++ b/runtime/observatory/lib/src/service/object.dart |
| @@ -1896,7 +1896,7 @@ class Class extends ServiceObject with Coverage { |
| final AllocationCount promotedByLastNewGC = new AllocationCount(); |
| @observable bool get hasNoAllocations => newSpace.empty && oldSpace.empty; |
| - |
| + @observable bool traceAllocations = false; |
| @reflectable final fields = new ObservableList<Field>(); |
| @reflectable final functions = new ObservableList<ServiceFunction>(); |
| @@ -1963,6 +1963,9 @@ class Class extends ServiceObject with Coverage { |
| } |
| error = map['error']; |
| + traceAllocations = |
| + (map['_traceAllocations'] != null) ? map['_traceAllocations'] : false; |
| + |
| var allocationStats = map['_allocationStats']; |
| if (allocationStats != null) { |
| newSpace.update(allocationStats['new']); |
| @@ -1985,6 +1988,19 @@ class Class extends ServiceObject with Coverage { |
| return isolate._eval(this, expression); |
| } |
| + Future<ServiceObject> setTraceAllocations(bool enable) { |
| + return isolate.invokeRpc('_traceClassAllocation', { |
| + 'enable': enable, |
| + 'classId': id, |
| + }); |
| + } |
| + |
| + Future<ServiceObject> getAllocationProfile([String tags = 'None']) { |
| + var params = { 'tags': tags, |
| + 'classId': id }; |
| + return isolate.invokeRpc('_getCpuProfile', params); |
|
turnidge
2015/07/13 23:37:48
Calling this _getCpuProfile doesn't seem right. P
Cutch
2015/07/14 15:53:47
_getAllocationSamples
|
| + } |
| + |
| String toString() => 'Class($vmName)'; |
| } |