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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart

Issue 14986002: Make static tear-off closures a class, like instance tear-off closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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: sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart (revision 22664)
+++ sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart (working copy)
@@ -73,7 +73,7 @@
* call is not emitted.
*/
void startRootIsolate(entry) {
- _globalState = new _Manager();
+ _globalState = new _Manager(entry);
// Don't start the main loop again, if we are in a worker.
if (_globalState.isWorker) return;
@@ -188,7 +188,10 @@
/** Registry of active [_ManagerStub]s. Only used in the main [_Manager]. */
Map<int, _ManagerStub> managers;
- _Manager() {
+ /** The entry point given by [startRootIsolate]. */
+ final Function entry;
+
+ _Manager(this.entry) {
_nativeDetectEnvironment();
topEventLoop = new _EventLoop();
isolates = new Map<int, _IsolateContext>();
@@ -504,7 +507,10 @@
switch (msg['command']) {
case 'start':
_globalState.currentManagerId = msg['id'];
- Function entryPoint = _getJSFunctionFromName(msg['functionName']);
+ String functionName = msg['functionName'];
+ Function entryPoint = (functionName == null)
+ ? _globalState.entry
+ : _getJSFunctionFromName(functionName);
var replyTo = _deserializeMessage(msg['replyTo']);
var context = new _IsolateContext();
_globalState.topEventLoop.enqueue(context, () {
@@ -668,7 +674,6 @@
* name for the isolate entry point class.
*/
static void _spawnWorker(functionName, uri, replyPort) {
- if (functionName == null) functionName = 'main';
if (uri == null) uri = thisScript;
final worker = _newWorker(uri);
worker.onmessage = JS('',

Powered by Google App Engine
This is Rietveld 408576698