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

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

Issue 2595363002: Support for Null as bottom in dart2js (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/js_rti.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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' show 7 import 'dart:_js_embedded_names' show
8 DEFERRED_LIBRARY_URIS, 8 DEFERRED_LIBRARY_URIS,
9 DEFERRED_LIBRARY_HASHES, 9 DEFERRED_LIBRARY_HASHES,
10 GET_TYPE_FROM_NAME, 10 GET_TYPE_FROM_NAME,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 /// Returns true if the given [type] is _the_ `Function` type. 147 /// Returns true if the given [type] is _the_ `Function` type.
148 // TODO(floitsch): move this to foreign_helper.dart or similar. 148 // TODO(floitsch): move this to foreign_helper.dart or similar.
149 @ForceInline() 149 @ForceInline()
150 bool isDartFunctionTypeRti(Object type) { 150 bool isDartFunctionTypeRti(Object type) {
151 return JS_BUILTIN('returns:bool;effects:none;depends:none', 151 return JS_BUILTIN('returns:bool;effects:none;depends:none',
152 JsBuiltin.isGivenTypeRti, 152 JsBuiltin.isGivenTypeRti,
153 type, 153 type,
154 JS_GET_NAME(JsGetName.FUNCTION_CLASS_TYPE_NAME)); 154 JS_GET_NAME(JsGetName.FUNCTION_CLASS_TYPE_NAME));
155 } 155 }
156 156
157 /// Returns true if the given [type] is _the_ `Null` type.
158 @ForceInline()
159 bool isNullType(Object type) {
160 return JS_BUILTIN('returns:bool;effects:none;depends:none',
161 JsBuiltin.isGivenTypeRti,
162 type,
163 JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME));
164 }
165
157 /// Returns whether the given type is _the_ Dart Object type. 166 /// Returns whether the given type is _the_ Dart Object type.
158 // TODO(floitsch): move this to foreign_helper.dart or similar. 167 // TODO(floitsch): move this to foreign_helper.dart or similar.
159 @ForceInline() 168 @ForceInline()
160 bool isDartObjectTypeRti(type) { 169 bool isDartObjectTypeRti(type) {
161 return JS_BUILTIN('returns:bool;effects:none;depends:none', 170 return JS_BUILTIN('returns:bool;effects:none;depends:none',
162 JsBuiltin.isGivenTypeRti, 171 JsBuiltin.isGivenTypeRti,
163 type, 172 type,
164 JS_GET_NAME(JsGetName.OBJECT_CLASS_TYPE_NAME)); 173 JS_GET_NAME(JsGetName.OBJECT_CLASS_TYPE_NAME));
165 } 174 }
166 175
(...skipping 3893 matching lines...) Expand 10 before | Expand all | Expand 10 after
4060 // unneeded code. 4069 // unneeded code.
4061 class _UnreachableError extends AssertionError { 4070 class _UnreachableError extends AssertionError {
4062 _UnreachableError(); 4071 _UnreachableError();
4063 String toString() => "Assertion failed: Reached dead code"; 4072 String toString() => "Assertion failed: Reached dead code";
4064 } 4073 }
4065 4074
4066 @NoInline() 4075 @NoInline()
4067 void assertUnreachable() { 4076 void assertUnreachable() {
4068 throw new _UnreachableError(); 4077 throw new _UnreachableError();
4069 } 4078 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698