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

Unified Diff: runtime/lib/isolate.cc

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase 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
Index: runtime/lib/isolate.cc
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 9cfcddf0eee6bbc6327b54ad9428e2dd6daa22ce..29ab5b7f2d2fb6bf965a9a50460f2d5e0b2ead7a 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -215,7 +215,7 @@ static RawObject* Spawn(NativeArguments* arguments, IsolateSpawnState* state) {
}
-DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 2) {
+DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0));
bool throw_exception = false;
Function& func = Function::Handle();
@@ -235,36 +235,13 @@ DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 2) {
Exceptions::ThrowArgumentError(msg);
}
- GET_NATIVE_ARGUMENT(Instance, callback, arguments->NativeArgAt(1));
- Function& callback_func = Function::Handle();
- if (callback.IsClosure()) {
- callback_func = Closure::function(callback);
- const Class& cls = Class::Handle(callback_func.Owner());
- if (!callback_func.IsClosureFunction() || !callback_func.is_static() ||
- !cls.IsTopLevel()) {
- throw_exception = true;
- }
- } else if (!callback.IsNull()) {
- throw_exception = true;
- }
- if (throw_exception) {
- const String& msg = String::Handle(String::New(
- "spawnFunction expects to be passed either a unhandled exception "
- "callback to a top-level static function, or null"));
- Exceptions::ThrowArgumentError(msg);
- }
-
#if defined(DEBUG)
Context& ctx = Context::Handle();
ctx = Closure::context(closure);
ASSERT(ctx.num_variables() == 0);
- if (!callback.IsNull()) {
- ctx = Closure::context(callback);
- ASSERT(ctx.num_variables() == 0);
- }
#endif
- return Spawn(arguments, new IsolateSpawnState(func, callback_func));
+ return Spawn(arguments, new IsolateSpawnState(func));
}

Powered by Google App Engine
This is Rietveld 408576698