privatize and remove some fields in Isolate response

- Remove features
- Make heaps -> _heaps
- Make tagCounters -> _tagCounters.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1156183002
This commit is contained in:
John McCutchan 2015-05-26 14:05:50 -07:00
parent aa3f983084
commit f01b6dd5b2
3 changed files with 6 additions and 34 deletions

View file

@ -1039,12 +1039,6 @@ class Isolate extends ServiceObjectOwner with Coverage {
loading = false;
_upgradeCollection(map, isolate);
if (map['rootLib'] == null ||
map['timers'] == null ||
map['heaps'] == null) {
Logger.root.severe("Malformed 'Isolate' response: $map");
return;
}
rootLibrary = map['rootLib'];
if (map['entry'] != null) {
entry = map['entry'];
@ -1052,7 +1046,7 @@ class Isolate extends ServiceObjectOwner with Coverage {
var startTimeInMillis = map['startTime'];
startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis);
notifyPropertyChange(#upTime, 0, 1);
var countersMap = map['tagCounters'];
var countersMap = map['_tagCounters'];
if (countersMap != null) {
var names = countersMap['names'];
var counts = countersMap['counters'];
@ -1087,17 +1081,9 @@ class Isolate extends ServiceObjectOwner with Coverage {
timerMap['time_bootstrap']);
timers['dart'] = timerMap['time_dart_execution'];
updateHeapsFromMap(map['heaps']);
updateHeapsFromMap(map['_heaps']);
_updateBreakpoints(map['breakpoints']);
List features = map['features'];
if (features != null) {
for (var feature in features) {
if (feature == 'io') {
ioEnabled = true;
}
}
}
pauseEvent = map['pauseEvent'];
_updateRunState();
error = map['error'];

View file

@ -26,10 +26,8 @@ var tests = [
expect(result['libraries'].length, isPositive);
expect(result['libraries'][0]['type'], equals('@Library'));
expect(result['breakpoints'].length, isZero);
expect(result['features'].length, isPositive);
expect(result['features'][0], new isInstanceOf<String>());
expect(result['heaps']['new']['type'], equals('HeapSpace'));
expect(result['heaps']['old']['type'], equals('HeapSpace'));
expect(result['_heaps']['new']['type'], equals('HeapSpace'));
expect(result['_heaps']['old']['type'], equals('HeapSpace'));
},
];

View file

@ -1516,7 +1516,7 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
}
}
{
JSONObject jsheap(&jsobj, "heaps");
JSONObject jsheap(&jsobj, "_heaps");
heap()->PrintToJSONObject(Heap::kNew, &jsheap);
heap()->PrintToJSONObject(Heap::kOld, &jsheap);
}
@ -1552,7 +1552,7 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
timer_list().PrintTimersToJSONProperty(&jsobj);
{
JSONObject tagCounters(&jsobj, "tagCounters");
JSONObject tagCounters(&jsobj, "_tagCounters");
vm_tag_counters()->PrintToJSONObject(&tagCounters);
}
if (object_store()->sticky_error() != Object::null()) {
@ -1561,21 +1561,15 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
jsobj.AddProperty("error", error, false);
}
bool is_io_enabled = false;
{
const GrowableObjectArray& libs =
GrowableObjectArray::Handle(object_store()->libraries());
intptr_t num_libs = libs.Length();
Library& lib = Library::Handle();
String& name = String::Handle();
JSONArray lib_array(&jsobj, "libraries");
for (intptr_t i = 0; i < num_libs; i++) {
lib ^= libs.At(i);
name = lib.name();
if (name.Equals(Symbols::DartIOLibName())) {
is_io_enabled = true;
}
ASSERT(!lib.IsNull());
lib_array.AddValue(lib);
}
@ -1584,12 +1578,6 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
JSONArray breakpoints(&jsobj, "breakpoints");
debugger()->PrintBreakpointsToJSONArray(&breakpoints);
}
{
JSONArray features_array(&jsobj, "features");
if (is_io_enabled) {
features_array.AddValue("io");
}
}
}