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

Side by Side Diff: lib/isolate/frog/compiler_hooks.dart

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/world.dart ('k') | lib/isolate/frog/isolateimpl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // This file contains functions that are used in the code generated by the frog
6 // compiler.
7
8 /**
9 * Wrapper that takes the dart entry point and runs it within an isolate. The
10 * frog compiler will inject a call of the form [: startRootIsolate(main); :]
11 * when it determines that this wrapping is needed. For single-isolate
12 * applications (e.g. hello world), this call is not emitted.
13 */
14 void startRootIsolate(entry) {
15 globalState = new GlobalState();
16
17 // Don't start the main loop again, if we are in a worker.
18 if (globalState.isWorker) return;
19 final rootContext = new IsolateContext();
20 globalState.rootContext = rootContext;
21 fillStatics(rootContext);
22
23 // BUG(5151491): Setting currentContext should not be necessary, but
24 // because closures passed to the DOM as event handlers do not bind their
25 // isolate automatically we try to give them a reasonable context to live in
26 // by having a "default" isolate (the first one created).
27 globalState.currentContext = rootContext;
28
29 rootContext.eval(entry);
30 globalState.topEventLoop.run();
31 }
OLDNEW
« no previous file with comments | « frog/world.dart ('k') | lib/isolate/frog/isolateimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698