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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 312123002: Revert "Ensure that failure to start an isolate all end up in the future." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/vm/isolate.cc » ('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 c08dd1781259691cec4d3ef85c860796fb70e384..acf9968f008ce1717417c137fe51d33168ec95ed 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -200,36 +200,24 @@ void _startIsolate(Function entryPoint, bool isSpawnUri) {
keepAlivePort.close();
SendPort replyTo = message[0];
+ if (replyTo != null) {
+ // TODO(floitsch): don't send ok-message if we can't find the entry point.
+ replyTo.send("started");
+ }
if (isSpawnUri) {
assert(message.length == 3);
List<String> args = message[1];
var isolateMessage = message[2];
- if (entryPoint == null) {
- // Set to null when lookup of "main" failed in C++ code.
- if (replyTo != null) {
- replyTo.send(["error",
- "No main method in isolate library"]);
- }
- } else if (entryPoint is _MainFunctionArgsMessage) {
- if (replyTo != null) replyTo.send("started");
+ if (entryPoint is _MainFunctionArgsMessage) {
entryPoint(args, isolateMessage);
} else if (entryPoint is _MainFunctionArgs) {
- if (replyTo != null) replyTo.send("started");
entryPoint(args);
- } else if (entryPoint is _MainFunction) {
- if (replyTo != null) replyTo.send("started");
- entryPoint();
} else {
- // Report error back to spawner.
- if (replyTo != null) {
- replyTo.send(["error",
- "Incorrect parameter count on main: $entryPoint"]);
- }
+ entryPoint();
}
} else {
assert(message.length == 2);
var entryMessage = message[1];
- if (replyTo != null) replyTo.send("started");
entryPoint(entryMessage);
}
}
@@ -268,15 +256,9 @@ patch class Isolate {
controlPort.send([readyPort.sendPort, args, message]);
Completer completer = new Completer<Isolate>.sync();
readyPort.handler = (readyMessage) {
+ assert(readyMessage == 'started');
readyPort.close();
- if ('started' == readyMessage) {
- completer.complete(new Isolate(controlPort));
- } else {
- assert(readyMessage is List && readyMessage[0] == "error");
- String error = readyMessage[1];
- var remoteError = new IsolateSpawnException(error);
- completer.completeError(remoteError);
- }
+ completer.complete(new Isolate(controlPort));
};
return completer.future;
} catch (e, st) {
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698