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

Unified Diff: runtime/vm/isolate.cc

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More comments. 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/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index d8ab9a53852f0d8d4789fda623e5a59226beacad..f540b60cd0ce39cc4362ee461f42003bfd286b77 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -519,7 +519,18 @@ static bool RunIsolate(uword parameter) {
ASSERT(result.IsFunction());
Function& func = Function::Handle(isolate);
func ^= result.raw();
- result = DartEntry::InvokeFunction(func, Object::empty_array());
+ func = func.ImplicitClosureFunction();
+
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, Instance::Handle(func.ImplicitStaticClosure()));
+
+ const Library& lib = Library::Handle(Library::IsolateLibrary());
+ const String& entry_name = String::Handle(String::New("_startIsolate"));
+ const Function& entry_point =
+ Function::Handle(lib.LookupLocalFunction(entry_name));
+ ASSERT(entry_point.IsFunction() && !entry_point.IsNull());
+
+ result = DartEntry::InvokeFunction(entry_point, args);
if (result.IsError()) {
StoreError(isolate, result);
return false;
@@ -977,8 +988,7 @@ static char* GetRootScriptUri(Isolate* isolate) {
}
-IsolateSpawnState::IsolateSpawnState(const Function& func,
- const Function& callback_func)
+IsolateSpawnState::IsolateSpawnState(const Function& func)
: isolate_(NULL),
script_url_(NULL),
library_url_(NULL),
@@ -993,12 +1003,7 @@ IsolateSpawnState::IsolateSpawnState(const Function& func,
const String& func_name = String::Handle(func.name());
function_name_ = strdup(func_name.ToCString());
- if (!callback_func.IsNull()) {
- const String& callback_name = String::Handle(callback_func.name());
- exception_callback_name_ = strdup(callback_name.ToCString());
- } else {
- exception_callback_name_ = strdup("_unhandledExceptionCallback");
- }
+ exception_callback_name_ = strdup("_unhandledExceptionCallback");
}
« no previous file with comments | « runtime/vm/isolate.h ('k') | sdk/lib/isolate/isolate.dart » ('j') | sdk/lib/isolate/isolate.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698