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_emitter.startup_emitter; | 5 library dart2js.js_emitter.startup_emitter; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' | 7 import 'package:js_runtime/shared/embedded_names.dart' |
8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES; | 8 show JsBuiltin, METADATA, STATIC_FUNCTION_NAME_TO_CLOSURE, TYPES; |
9 | 9 |
10 import '../../common.dart'; | 10 import '../../common.dart'; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 case JsBuiltin.rawRtiToJsConstructorName: | 159 case JsBuiltin.rawRtiToJsConstructorName: |
160 return js.js.expressionTemplateFor("#.$typeNameProperty"); | 160 return js.js.expressionTemplateFor("#.$typeNameProperty"); |
161 | 161 |
162 case JsBuiltin.rawRuntimeType: | 162 case JsBuiltin.rawRuntimeType: |
163 return js.js.expressionTemplateFor("#.constructor"); | 163 return js.js.expressionTemplateFor("#.constructor"); |
164 | 164 |
165 case JsBuiltin.createFunctionTypeRti: | 165 case JsBuiltin.createFunctionTypeRti: |
166 return _backend.rtiEncoder.templateForCreateFunctionType; | 166 return _backend.rtiEncoder.templateForCreateFunctionType; |
167 | 167 |
| 168 case JsBuiltin.isVoidRti: |
| 169 return _backend.rtiEncoder.templateForIsVoidRti; |
| 170 |
168 case JsBuiltin.isSubtype: | 171 case JsBuiltin.isSubtype: |
169 // TODO(floitsch): move this closer to where is-check properties are | 172 // TODO(floitsch): move this closer to where is-check properties are |
170 // built. | 173 // built. |
171 String isPrefix = namer.operatorIsPrefix; | 174 String isPrefix = namer.operatorIsPrefix; |
172 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); | 175 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); |
173 | 176 |
174 case JsBuiltin.isGivenTypeRti: | 177 case JsBuiltin.isGivenTypeRti: |
175 return js.js.expressionTemplateFor('#.$typeNameProperty === #'); | 178 return js.js.expressionTemplateFor('#.$typeNameProperty === #'); |
176 | 179 |
177 case JsBuiltin.getMetadata: | 180 case JsBuiltin.getMetadata: |
(...skipping 17 matching lines...) Expand all Loading... |
195 } | 198 } |
196 } | 199 } |
197 | 200 |
198 @override | 201 @override |
199 int generatedSize(OutputUnit unit) { | 202 int generatedSize(OutputUnit unit) { |
200 Fragment key = _emitter.outputBuffers.keys | 203 Fragment key = _emitter.outputBuffers.keys |
201 .firstWhere((Fragment fragment) => fragment.outputUnit == unit); | 204 .firstWhere((Fragment fragment) => fragment.outputUnit == unit); |
202 return _emitter.outputBuffers[key].length; | 205 return _emitter.outputBuffers[key].length; |
203 } | 206 } |
204 } | 207 } |
OLD | NEW |