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

Unified Diff: frog/corejs.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, 10 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 | « corelib/src/isolate.dart ('k') | frog/gen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/corejs.dart
diff --git a/frog/corejs.dart b/frog/corejs.dart
index 2a61f75b1824cdb7a02fdbfb059d01caaf8ecca4..e15beab53f84cf384d8ae06b5e11378596b49c22 100644
--- a/frog/corejs.dart
+++ b/frog/corejs.dart
@@ -177,15 +177,7 @@ class CoreJs {
_SETINDEX_OPERATORS : _CHECKED_SETINDEX_OPERATORS);
}
- if (useIsolates) {
- if (useWrap0) {
- w.writeln(_WRAP_CALL0_FUNCTION);
- }
- if (useWrap1) {
- w.writeln(_WRAP_CALL1_FUNCTION);
- }
- w.writeln(_ISOLATE_INIT_CODE);
- } else {
+ if (!useIsolates) {
if (useWrap0) {
w.writeln(_EMPTY_WRAP_CALL0_FUNCTION);
}
@@ -537,51 +529,14 @@ $defProp(Array.prototype, '$setindex', function(index, value) {
return this[i] = value;
});""";
-/** Snippet for `$wrap_call$0`. */
-final String _WRAP_CALL0_FUNCTION = @"""
-// Wrap a 0-arg dom-callback to bind it with the current isolate:
-function $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }
-Function.prototype.wrap$call$0 = function() {
- var isolateContext = $globalState.currentContext;
- var self = this;
- this.wrap$0 = function() {
- isolateContext.eval(self);
- $globalState.topEventLoop.run();
- };
- this.wrap$call$0 = function() { return this.wrap$0; };
- return this.wrap$0;
-}""";
-
/** Snippet for `$wrap_call$0`, in case it was not necessary. */
final String _EMPTY_WRAP_CALL0_FUNCTION =
@"function $wrap_call$0(fn) { return fn; }";
-/** Snippet for `$wrap_call$1`. */
-final String _WRAP_CALL1_FUNCTION = @"""
-// Wrap a 1-arg dom-callback to bind it with the current isolate:
-function $wrap_call$1(fn) { return fn && fn.wrap$call$1(); }
-Function.prototype.wrap$call$1 = function() {
- var isolateContext = $globalState.currentContext;
- var self = this;
- this.wrap$1 = function(arg) {
- isolateContext.eval(function() { self(arg); });
- $globalState.topEventLoop.run();
- };
- this.wrap$call$1 = function() { return this.wrap$1; };
- return this.wrap$1;
-}""";
-
/** Snippet for `$wrap_call$1`, in case it was not necessary. */
final String _EMPTY_WRAP_CALL1_FUNCTION =
@"function $wrap_call$1(fn) { return fn; }";
-/** Snippet that initializes the isolates state. */
-final String _ISOLATE_INIT_CODE = @"""
-var $globalThis = this;
-var $globals = null;
-var $globalState = null;""";
-
-
/** Snippet that initializes Function.prototype.bind. */
final String _BIND_CODE = @"""
Function.prototype.bind = Function.prototype.bind ||
« no previous file with comments | « corelib/src/isolate.dart ('k') | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698