| 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 dart._isolate_helper; | 5 library dart._isolate_helper; |
| 6 | 6 |
| 7 import 'dart:_js_embedded_names' | 7 import 'dart:_js_embedded_names' |
| 8 show | 8 show |
| 9 CLASS_ID_EXTRACTOR, | 9 CLASS_ID_EXTRACTOR, |
| 10 CLASS_FIELDS_EXTRACTOR, | 10 CLASS_FIELDS_EXTRACTOR, |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // primitives that require support for spawning workers. The field starts out | 739 // primitives that require support for spawning workers. The field starts out |
| 740 // by being null, and dart2js' type inference will track if it can have a | 740 // by being null, and dart2js' type inference will track if it can have a |
| 741 // non-null value. So by testing if this value is not null, we generate code | 741 // non-null value. So by testing if this value is not null, we generate code |
| 742 // that dart2js knows is dead when worker support isn't needed. | 742 // that dart2js knows is dead when worker support isn't needed. |
| 743 // TODO(herhut): Initialize this to false when able to track compile-time | 743 // TODO(herhut): Initialize this to false when able to track compile-time |
| 744 // constants. | 744 // constants. |
| 745 static var enableSpawnWorker; | 745 static var enableSpawnWorker; |
| 746 | 746 |
| 747 static String thisScript = computeThisScript(); | 747 static String thisScript = computeThisScript(); |
| 748 | 748 |
| 749 /// Returns the base path added to Uri.base to resolve `package:` Uris. |
| 750 /// |
| 751 /// This is used by `Isolate.resolvePackageUri` to load resources. The default |
| 752 /// value is `packages/` but users can override this by using the |
| 753 /// `defaultPackagesBase` hook. |
| 754 static String get packagesBase => |
| 755 JS('String', r'#.defaultPackagesBase || "packages/"', global); |
| 756 |
| 749 /// Associates an ID with a native worker object. | 757 /// Associates an ID with a native worker object. |
| 750 static final Expando<int> workerIds = new Expando<int>(); | 758 static final Expando<int> workerIds = new Expando<int>(); |
| 751 | 759 |
| 752 /** | 760 /** |
| 753 * The src url for the script tag that loaded this Used to create | 761 * The src url for the script tag that loaded this Used to create |
| 754 * JavaScript workers. | 762 * JavaScript workers. |
| 755 */ | 763 */ |
| 756 static String computeThisScript() { | 764 static String computeThisScript() { |
| 757 // See: https://github.com/dart-lang/dev_compiler/issues/164 | 765 // See: https://github.com/dart-lang/dev_compiler/issues/164 |
| 758 // var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT); | 766 // var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT); |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 } | 1459 } |
| 1452 | 1460 |
| 1453 bool operator ==(Object other) { | 1461 bool operator ==(Object other) { |
| 1454 if (identical(other, this)) return true; | 1462 if (identical(other, this)) return true; |
| 1455 if (other is CapabilityImpl) { | 1463 if (other is CapabilityImpl) { |
| 1456 return identical(_id, other._id); | 1464 return identical(_id, other._id); |
| 1457 } | 1465 } |
| 1458 return false; | 1466 return false; |
| 1459 } | 1467 } |
| 1460 } | 1468 } |
| OLD | NEW |