[vm] Use correct static type for the port mapping in Dart

The keys in the map are integers.

TEST=Existing test suite.

Change-Id: I989a8be01f3abb6b50f0c0d692b84c1494a60ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206542
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
diff --git a/sdk/lib/_internal/vm/lib/isolate_patch.dart b/sdk/lib/_internal/vm/lib/isolate_patch.dart
index 34ce5e4..9703179 100644
--- a/sdk/lib/_internal/vm/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/vm/lib/isolate_patch.dart
@@ -160,8 +160,8 @@
   }
 
   /**** Internal implementation details ****/
-  _get_id() native "RawReceivePortImpl_get_id";
-  _get_sendport() native "RawReceivePortImpl_get_sendport";
+  int _get_id() native "RawReceivePortImpl_get_id";
+  SendPort _get_sendport() native "RawReceivePortImpl_get_sendport";
 
   // Called from the VM to retrieve the handler for a message.
   @pragma("vm:entry-point", "call")
@@ -186,7 +186,7 @@
   }
 
   // Call into the VM to close the VM maintained mappings.
-  _closeInternal() native "RawReceivePortImpl_closeInternal";
+  int _closeInternal() native "RawReceivePortImpl_closeInternal";
 
   // Set this port as active or inactive in the VM. If inactive, this port
   // will not be considered live even if it hasn't been explicitly closed.
@@ -195,7 +195,7 @@
   _setActive(bool active) native "RawReceivePortImpl_setActive";
 
   void set handler(Function? value) {
-    final id = this._get_id();
+    final int id = this._get_id();
     if (!_portMap.containsKey(id)) {
       _portMap[id] = <String, dynamic>{
         'port': this,
@@ -204,7 +204,7 @@
     _portMap[id]!['handler'] = value;
   }
 
-  static final _portMap = <dynamic, Map<String, dynamic>>{};
+  static final _portMap = <int, Map<String, dynamic>>{};
 }
 
 @pragma("vm:entry-point")