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

Side by Side Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 2699073003: Support `void` as generic argument.
Patch Set: Shuffle things around to have a better `voidRti` locality. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/scanner/token.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698