Index: runtime/lib/isolate_patch.dart |
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart |
index ad3864f1354f37d0346d232491c62732832f3478..72395e81a73185220d61e87aa2da9192e61f416d 100644 |
--- a/runtime/lib/isolate_patch.dart |
+++ b/runtime/lib/isolate_patch.dart |
@@ -35,6 +35,7 @@ class _ReceivePortImpl implements ReceivePort { |
} |
return new _ReceivePortImpl._internal(id); |
} |
+ |
_ReceivePortImpl._internal(int id) : _id = id { |
if (_portMap == null) { |
_portMap = new Map(); |
@@ -42,10 +43,15 @@ class _ReceivePortImpl implements ReceivePort { |
_portMap[id] = this; |
} |
- // Called from the VM to dispatch to the handler. |
- static void _handleMessage(int id, int replyId, var message) { |
+ // Called from the VM to retrieve the ReceivePort for a message. |
+ static _ReceivePortImpl _lookupReceivePort(int id) { |
assert(_portMap != null); |
- ReceivePort port = _portMap[id]; |
+ return _portMap[id]; |
+ } |
+ |
+ // Called from the VM to dispatch to the handler. |
+ static void _handleMessage(_ReceivePortImpl port, int replyId, var message) { |
+ assert(port != null); |
SendPort replyTo = (replyId == 0) ? null : new _SendPortImpl(replyId); |
(port._onMessage)(message, replyTo); |
} |