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

Unified Diff: runtime/lib/isolate.cc

Issue 1244733002: - Implement VM parts of https://codereview.chromium.org/1240743003/ (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update isolate.status file as expected. Created 5 years, 5 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/lib/isolate_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 378e6eb18574a7f200984709e20618d9726849d1..5199f1983f23d3ffe98db36accc3e223cfa5f3c1 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -217,11 +217,15 @@ static void Spawn(Isolate* parent_isolate, IsolateSpawnState* state) {
}
-DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 4) {
+DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 7) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(1));
GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(2));
GET_NON_NULL_NATIVE_ARGUMENT(Bool, paused, arguments->NativeArgAt(3));
+ GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(4));
+ GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(5));
+ GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6));
+
if (closure.IsClosure()) {
Function& func = Function::Handle();
func = Closure::function(closure);
@@ -233,10 +237,18 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 4) {
#endif
// Get the parent function so that we get the right function name.
func = func.parent_function();
+
+ bool fatal_errors = fatalErrors.IsNull() ? true : fatalErrors.value();
+ Dart_Port on_exit_port = onExit.IsNull() ? ILLEGAL_PORT : onExit.Id();
+ Dart_Port on_error_port = onError.IsNull() ? ILLEGAL_PORT : onError.Id();
+
Spawn(isolate, new IsolateSpawnState(port.Id(),
func,
message,
- paused.value()));
+ paused.value(),
+ fatal_errors,
+ on_exit_port,
+ on_error_port));
return Object::null();
}
}
@@ -247,7 +259,7 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 4) {
}
-DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 7) {
+DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 10) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, uri, arguments->NativeArgAt(1));
GET_NON_NULL_NATIVE_ARGUMENT(Instance, args, arguments->NativeArgAt(2));
@@ -255,6 +267,9 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 7) {
GET_NON_NULL_NATIVE_ARGUMENT(Bool, paused, arguments->NativeArgAt(4));
GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(5));
GET_NATIVE_ARGUMENT(String, package_root, arguments->NativeArgAt(6));
+ GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7));
+ GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(8));
+ GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(9));
// Canonicalize the uri with respect to the current isolate.
char* error = NULL;
@@ -275,12 +290,19 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 7) {
utf8_package_root[len] = '\0';
}
+ bool fatal_errors = fatalErrors.IsNull() ? true : fatalErrors.value();
+ Dart_Port on_exit_port = onExit.IsNull() ? ILLEGAL_PORT : onExit.Id();
+ Dart_Port on_error_port = onError.IsNull() ? ILLEGAL_PORT : onError.Id();
+
IsolateSpawnState* state = new IsolateSpawnState(port.Id(),
canonical_uri,
utf8_package_root,
args,
message,
- paused.value());
+ paused.value(),
+ fatal_errors,
+ on_exit_port,
+ on_error_port);
// If we were passed a value then override the default flags state for
// checked mode.
if (!checked.IsNull()) {
« no previous file with comments | « no previous file | runtime/lib/isolate_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698