OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 _js_helper; | 5 library _js_helper; |
6 | 6 |
7 import 'dart:_js_embedded_names' | 7 import 'dart:_js_embedded_names' |
8 show | 8 show |
9 DEFERRED_LIBRARY_URIS, | 9 DEFERRED_LIBRARY_URIS, |
10 DEFERRED_LIBRARY_HASHES, | 10 DEFERRED_LIBRARY_HASHES, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // TODO(floitsch): move this to foreign_helper.dart or similar. | 176 // TODO(floitsch): move this to foreign_helper.dart or similar. |
177 @ForceInline() | 177 @ForceInline() |
178 bool isNullTypeRti(type) { | 178 bool isNullTypeRti(type) { |
179 return JS_BUILTIN( | 179 return JS_BUILTIN( |
180 'returns:bool;effects:none;depends:none', | 180 'returns:bool;effects:none;depends:none', |
181 JsBuiltin.isGivenTypeRti, | 181 JsBuiltin.isGivenTypeRti, |
182 type, | 182 type, |
183 JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME)); | 183 JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME)); |
184 } | 184 } |
185 | 185 |
| 186 /// Returns whether the given type is void type. |
| 187 // TODO(floitsch): move this to foreign_helper.dart or similar. |
| 188 @ForceInline() |
| 189 bool isVoidType(rti) { |
| 190 return JS_BUILTIN( |
| 191 'returns:bool;effects:none;depends:none', JsBuiltin.isVoidRti, rti); |
| 192 } |
| 193 |
186 /// Returns the metadata of the given [index]. | 194 /// Returns the metadata of the given [index]. |
187 // TODO(floitsch): move this to foreign_helper.dart or similar. | 195 // TODO(floitsch): move this to foreign_helper.dart or similar. |
188 @ForceInline() | 196 @ForceInline() |
189 getMetadata(int index) { | 197 getMetadata(int index) { |
190 return JS_BUILTIN( | 198 return JS_BUILTIN( |
191 'returns:var;effects:none;depends:none', JsBuiltin.getMetadata, index); | 199 'returns:var;effects:none;depends:none', JsBuiltin.getMetadata, index); |
192 } | 200 } |
193 | 201 |
194 /// Returns the type of the given [index]. | 202 /// Returns the type of the given [index]. |
195 // TODO(floitsch): move this to foreign_helper.dart or similar. | 203 // TODO(floitsch): move this to foreign_helper.dart or similar. |
(...skipping 3600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3796 // unneeded code. | 3804 // unneeded code. |
3797 class _UnreachableError extends AssertionError { | 3805 class _UnreachableError extends AssertionError { |
3798 _UnreachableError(); | 3806 _UnreachableError(); |
3799 String toString() => "Assertion failed: Reached dead code"; | 3807 String toString() => "Assertion failed: Reached dead code"; |
3800 } | 3808 } |
3801 | 3809 |
3802 @NoInline() | 3810 @NoInline() |
3803 void assertUnreachable() { | 3811 void assertUnreachable() { |
3804 throw new _UnreachableError(); | 3812 throw new _UnreachableError(); |
3805 } | 3813 } |
OLD | NEW |