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 e6825786f50c19d78f6a89c78e46cec34b9a391f..c25d7dbad205f0674c76eb6250952885aee8fb49 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('_setTraceClassAllocation', { |
+ 'enable': enable, |
+ 'classId': id, |
+ }); |
+ } |
+ |
+ Future<ServiceObject> getAllocationSamples([String tags = 'None']) { |
+ var params = { 'tags': tags, |
+ 'classId': id }; |
+ return isolate.invokeRpc('_getAllocationSamples', params); |
+ } |
+ |
String toString() => 'Class($vmName)'; |
} |