| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.js_backend.helpers; | 5 library dart2js.js_backend.helpers; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show Identifiers, Uris; | 8 import '../common/names.dart' show Identifiers, Uris; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../core_types.dart' show CommonElements, ElementEnvironment; | 10 import '../core_types.dart' show CommonElements, ElementEnvironment; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 assert(loadedLibraries.containsLibrary(DART_JS_HELPER)); | 97 assert(loadedLibraries.containsLibrary(DART_JS_HELPER)); |
| 98 | 98 |
| 99 // TODO(johnniwinther): Avoid these. Currently needed to ensure resolution | 99 // TODO(johnniwinther): Avoid these. Currently needed to ensure resolution |
| 100 // of the classes for various queries in native behavior computation, | 100 // of the classes for various queries in native behavior computation, |
| 101 // inference and codegen. | 101 // inference and codegen. |
| 102 _env.getThisType(jsArrayClass); | 102 _env.getThisType(jsArrayClass); |
| 103 _env.getThisType(jsExtendableArrayClass); | 103 _env.getThisType(jsExtendableArrayClass); |
| 104 } | 104 } |
| 105 | 105 |
| 106 LibraryEntity _jsHelperLibrary; | 106 LibraryEntity _jsHelperLibrary; |
| 107 LibraryEntity get jsHelperLibrary => _jsHelperLibrary ??= _env.lookupLibrary(D
ART_JS_HELPER); | 107 LibraryEntity get jsHelperLibrary => |
| 108 _jsHelperLibrary ??= _env.lookupLibrary(DART_JS_HELPER); |
| 108 | 109 |
| 109 LibraryEntity _asyncLibrary; | 110 LibraryEntity _asyncLibrary; |
| 110 LibraryEntity get asyncLibrary => _asyncLibrary ??= _env.lookupLibrary(Uris.da
rt_async); | 111 LibraryEntity get asyncLibrary => |
| 112 _asyncLibrary ??= _env.lookupLibrary(Uris.dart_async); |
| 111 | 113 |
| 112 LibraryEntity _interceptorsLibrary; | 114 LibraryEntity _interceptorsLibrary; |
| 113 LibraryEntity get interceptorsLibrary => _interceptorsLibrary ??= _env.lookupL
ibrary(DART_INTERCEPTORS); | 115 LibraryEntity get interceptorsLibrary => |
| 116 _interceptorsLibrary ??= _env.lookupLibrary(DART_INTERCEPTORS); |
| 114 | 117 |
| 115 LibraryEntity _foreignLibrary; | 118 LibraryEntity _foreignLibrary; |
| 116 LibraryEntity get foreignLibrary => _foreignLibrary ??= _env.lookupLibrary(DAR
T_FOREIGN_HELPER); | 119 LibraryEntity get foreignLibrary => |
| 120 _foreignLibrary ??= _env.lookupLibrary(DART_FOREIGN_HELPER); |
| 117 | 121 |
| 118 LibraryEntity _isolateHelperLibrary; | 122 LibraryEntity _isolateHelperLibrary; |
| 119 LibraryEntity get isolateHelperLibrary => _isolateHelperLibrary ??= _env.looku
pLibrary(DART_ISOLATE_HELPER); | 123 LibraryEntity get isolateHelperLibrary => |
| 124 _isolateHelperLibrary ??= _env.lookupLibrary(DART_ISOLATE_HELPER); |
| 120 | 125 |
| 121 /// Reference to the internal library to lookup functions to always inline. | 126 /// Reference to the internal library to lookup functions to always inline. |
| 122 LibraryEntity _internalLibrary; | 127 LibraryEntity _internalLibrary; |
| 123 LibraryEntity get internalLibrary => _internalLibrary ??= _env.lookupLibrary(U
ris.dart__internal); | 128 LibraryEntity get internalLibrary => |
| 129 _internalLibrary ??= _env.lookupLibrary(Uris.dart__internal); |
| 124 | 130 |
| 125 FunctionEntity _assertTest; | 131 FunctionEntity _assertTest; |
| 126 FunctionEntity get assertTest => | 132 FunctionEntity get assertTest => |
| 127 _assertTest ??= _findHelperFunction('assertTest'); | 133 _assertTest ??= _findHelperFunction('assertTest'); |
| 128 | 134 |
| 129 FunctionEntity _assertThrow; | 135 FunctionEntity _assertThrow; |
| 130 FunctionEntity get assertThrow => | 136 FunctionEntity get assertThrow => |
| 131 _assertThrow ??= _findHelperFunction('assertThrow'); | 137 _assertThrow ??= _findHelperFunction('assertThrow'); |
| 132 | 138 |
| 133 FunctionEntity _assertHelper; | 139 FunctionEntity _assertHelper; |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 ClassEntity get annotationReturnsClass => _findHelperClass('Returns'); | 780 ClassEntity get annotationReturnsClass => _findHelperClass('Returns'); |
| 775 | 781 |
| 776 ClassEntity get annotationJSNameClass => _findHelperClass('JSName'); | 782 ClassEntity get annotationJSNameClass => _findHelperClass('JSName'); |
| 777 | 783 |
| 778 FunctionEntity get toStringForNativeObject => | 784 FunctionEntity get toStringForNativeObject => |
| 779 _findHelperFunction('toStringForNativeObject'); | 785 _findHelperFunction('toStringForNativeObject'); |
| 780 | 786 |
| 781 FunctionEntity get hashCodeForNativeObject => | 787 FunctionEntity get hashCodeForNativeObject => |
| 782 _findHelperFunction('hashCodeForNativeObject'); | 788 _findHelperFunction('hashCodeForNativeObject'); |
| 783 } | 789 } |
| OLD | NEW |