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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 503363002: Defer execution of the main isolate's entry point until the message loop. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix test Created 6 years, 4 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/bin/main.cc ('k') | tests/lib/mirrors/invocation_fuzz_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index 82e306fd007fcacce54c62f74235a8b67ecb0d7f..39826f656a469ed179aab3353180142ac6db3dd9 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -180,10 +180,29 @@ typedef _MainFunctionArgs(args);
typedef _MainFunctionArgsMessage(args, message);
/**
+ * Takes the real entry point as argument and invokes it with the
+ * initial message. Defers execution of the entry point until the
+ * isolate is in the message loop.
+ */
+void _startMainIsolate(Function entryPoint,
+ List<String> args) {
+ RawReceivePort port = new RawReceivePort();
+ port.handler = (_) {
+ port.close();
+ _startIsolate(null, // no parent port
+ entryPoint,
+ args,
+ null, // no message
+ true, // isSpawnUri
+ null, // no control port
+ null); // no capabilities
+ };
+ port.sendPort.send(null);
+}
+
+/**
* Takes the real entry point as argument and invokes it with the initial
* message.
- *
- * The initial startup message is received through the control port.
*/
void _startIsolate(SendPort parentPort,
Function entryPoint,
« no previous file with comments | « runtime/bin/main.cc ('k') | tests/lib/mirrors/invocation_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698