OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library _isolate_helper; | 5 library _isolate_helper; |
6 | 6 |
7 import 'dart:_js_embedded_names' show | 7 import 'dart:_js_embedded_names' show |
8 CLASS_ID_EXTRACTOR, | 8 CLASS_ID_EXTRACTOR, |
9 CLASS_FIELDS_EXTRACTOR, | 9 CLASS_FIELDS_EXTRACTOR, |
10 CURRENT_SCRIPT, | 10 CURRENT_SCRIPT, |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 return true; | 645 return true; |
646 } | 646 } |
647 | 647 |
648 /** | 648 /** |
649 * Runs multiple iterations of the run-loop. If possible, each iteration is | 649 * Runs multiple iterations of the run-loop. If possible, each iteration is |
650 * run asynchronously. | 650 * run asynchronously. |
651 */ | 651 */ |
652 void _runHelper() { | 652 void _runHelper() { |
653 if (globalWindow != null) { | 653 if (globalWindow != null) { |
654 // Run each iteration from the browser's top event loop. | 654 // Run each iteration from the browser's top event loop. |
655 // TODO(vsm): Revert to original pattern. | 655 next() { |
656 // See: https://github.com/dart-lang/dev_compiler/issues/177 | |
657 Function next = () { | |
658 if (!runIteration()) return; | 656 if (!runIteration()) return; |
659 Timer.run(next); | 657 Timer.run(next); |
660 }; | 658 } |
661 next(); | 659 next(); |
662 } else { | 660 } else { |
663 // Run synchronously until no more iterations are available. | 661 // Run synchronously until no more iterations are available. |
664 while (runIteration()) {} | 662 while (runIteration()) {} |
665 } | 663 } |
666 } | 664 } |
667 | 665 |
668 /** | 666 /** |
669 * Call [_runHelper] but ensure that worker exceptions are propragated. | 667 * Call [_runHelper] but ensure that worker exceptions are propragated. |
670 */ | 668 */ |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 } | 1451 } |
1454 | 1452 |
1455 bool operator==(Object other) { | 1453 bool operator==(Object other) { |
1456 if (identical(other, this)) return true; | 1454 if (identical(other, this)) return true; |
1457 if (other is CapabilityImpl) { | 1455 if (other is CapabilityImpl) { |
1458 return identical(_id, other._id); | 1456 return identical(_id, other._id); |
1459 } | 1457 } |
1460 return false; | 1458 return false; |
1461 } | 1459 } |
1462 } | 1460 } |
OLD | NEW |