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 954f24e6a55799ead125c570499d447097bb3dcc..8d92783e55060077e4ac81f6c718e1c6fa79bca5 100644 |
| --- a/runtime/observatory/lib/src/service/object.dart |
| +++ b/runtime/observatory/lib/src/service/object.dart |
| @@ -767,29 +767,33 @@ abstract class VM extends ServiceObjectOwner implements M.VM { |
| return this; |
| } |
| - assert(type == 'Isolate'); |
| String id = map['id']; |
| - if (!id.startsWith(_isolateIdPrefix)) { |
| - // Currently the VM only supports upgrading Isolate ServiceObjects. |
| - throw new UnimplementedError(); |
| - } |
| - |
| - // Check cache. |
| - var isolate = _isolateCache[id]; |
| - if (isolate == null) { |
| - // Add new isolate to the cache. |
| - isolate = new ServiceObject._fromMap(this, map); |
| - _isolateCache[id] = isolate; |
| - _buildIsolateList(); |
| - |
| - // Eagerly load the isolate. |
| - isolate.load().catchError((e, stack) { |
| - Logger.root.info('Eagerly loading an isolate failed: $e\n$stack'); |
| - }); |
| - } else { |
| - isolate.update(map); |
| + if ((id != null) && id.startsWith(_isolateIdPrefix)) { |
| + // Check cache. |
| + var isolate = _isolateCache[id]; |
| + if (isolate == null) { |
| + // Add new isolate to the cache. |
| + isolate = new ServiceObject._fromMap(this, map); |
| + _isolateCache[id] = isolate; |
| + _buildIsolateList(); |
| + |
| + // Eagerly load the isolate. |
| + isolate.load().catchError((e, stack) { |
| + Logger.root.info('Eagerly loading an isolate failed: $e\n$stack'); |
| + }); |
| + } else { |
| + isolate.update(map); |
| + } |
| + return isolate; |
| } |
| - return isolate; |
| + |
| + // Build the object from the map directly. |
| + var obj = new ServiceObject._fromMap(this, map); |
| + if ((id != null) && (obj != null) && obj.canCache) { |
|
Cutch
2017/03/21 20:27:11
we shouldn't put things in the VM objects' cache h
bkonyi
2017/03/22 21:25:21
Done.
|
| + _cache[id] = obj; |
| + } |
| + return obj; |
| + |
| } |
| // Note that this function does not reload the isolate if it found |
| @@ -3008,7 +3012,7 @@ class ServiceFunction extends HeapObject implements M.Function { |
| ServiceFunction._empty(ServiceObject owner) : super._empty(owner); |
| void _update(Map map, bool mapIsRef) { |
| - _upgradeCollection(map, isolate); |
| + _upgradeCollection(map, owner); |
| super._update(map, mapIsRef); |
| name = map['name']; |