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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 case JsBuiltin.rawRtiToJsConstructorName: 156 case JsBuiltin.rawRtiToJsConstructorName:
157 return js.js.expressionTemplateFor("#.$typeNameProperty"); 157 return js.js.expressionTemplateFor("#.$typeNameProperty");
158 158
159 case JsBuiltin.rawRuntimeType: 159 case JsBuiltin.rawRuntimeType:
160 return js.js.expressionTemplateFor("#.constructor"); 160 return js.js.expressionTemplateFor("#.constructor");
161 161
162 case JsBuiltin.createFunctionTypeRti: 162 case JsBuiltin.createFunctionTypeRti:
163 return _backend.rtiEncoder.templateForCreateFunctionType; 163 return _backend.rtiEncoder.templateForCreateFunctionType;
164 164
165 case JsBuiltin.isVoidRti:
166 return _backend.rtiEncoder.templateForIsVoidRti;
167
165 case JsBuiltin.isSubtype: 168 case JsBuiltin.isSubtype:
166 // TODO(floitsch): move this closer to where is-check properties are 169 // TODO(floitsch): move this closer to where is-check properties are
167 // built. 170 // built.
168 String isPrefix = namer.operatorIsPrefix; 171 String isPrefix = namer.operatorIsPrefix;
169 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 172 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
170 173
171 case JsBuiltin.isGivenTypeRti: 174 case JsBuiltin.isGivenTypeRti:
172 return js.js.expressionTemplateFor('#.$typeNameProperty === #'); 175 return js.js.expressionTemplateFor('#.$typeNameProperty === #');
173 176
174 case JsBuiltin.getMetadata: 177 case JsBuiltin.getMetadata:
(...skipping 17 matching lines...) Expand all
192 } 195 }
193 } 196 }
194 197
195 @override 198 @override
196 int generatedSize(OutputUnit unit) { 199 int generatedSize(OutputUnit unit) {
197 Fragment key = _emitter.outputBuffers.keys 200 Fragment key = _emitter.outputBuffers.keys
198 .firstWhere((Fragment fragment) => fragment.outputUnit == unit); 201 .firstWhere((Fragment fragment) => fragment.outputUnit == unit);
199 return _emitter.outputBuffers[key].length; 202 return _emitter.outputBuffers[key].length;
200 } 203 }
201 } 204 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698