Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: runtime/lib/isolate_patch.dart

Issue 47233002: - Revert parts of r29315 while attempting to reproduce (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
===================================================================
--- runtime/lib/isolate_patch.dart (revision 29315)
+++ runtime/lib/isolate_patch.dart (working copy)
@@ -151,6 +151,8 @@
final int _id;
}
+_getPortInternal() native "isolate_getPortInternal";
+
typedef _MainFunction();
typedef _MainFunctionArgs(args);
typedef _MainFunctionArgsMessage(args, message);
@@ -159,18 +161,10 @@
* Takes the real entry point as argument and invokes it with the initial
* message.
*
- * The initial message is received through the control port variable.
+ * The initial message is (currently) received through the global port variable.
*/
void _startIsolate(Function entryPoint, bool isSpawnUri) {
- ignoreHandler(message) {
- // Messages on the current Isolate's control port are dropped after the
- // initial startup message has been received.
- }
-
- isolateStartHandler(message) {
- // We received the initial startup message. Ignore all further messages.
- Isolate._self.handler = ignoreHandler;
-
+ Isolate._port.first.then((message) {
SendPort replyTo = message[0];
// TODO(floitsch): don't send ok-message if we can't find the entry point.
replyTo.send("started");
@@ -190,9 +184,7 @@
var entryMessage = message[1];
entryPoint(entryMessage);
}
- }
-
- Isolate._self.handler = isolateStartHandler;
+ });
}
patch class Isolate {
@@ -236,11 +228,11 @@
return completer.future;
}
- static final RawReceivePort _self = _mainPort;
- static RawReceivePort get _mainPort native "Isolate_mainPort";
+ static final ReceivePort _port =
+ new ReceivePort.fromRawReceivePort(_getPortInternal());
static SendPort _spawnFunction(Function topLevelFunction)
- native "Isolate_spawnFunction";
+ native "isolate_spawnFunction";
- static SendPort _spawnUri(String uri) native "Isolate_spawnUri";
+ static SendPort _spawnUri(String uri) native "isolate_spawnUri";
}
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698