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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart

Issue 1394213002: Split RuntimesTypes into RuntimeTypes and RuntimeTypesEncoder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.lazy_emitter; 5 library dart2js.js_emitter.lazy_emitter;
6 6
7 import 'package:js_runtime/shared/embedded_names.dart' show 7 import 'package:js_runtime/shared/embedded_names.dart' show
8 JsBuiltin, 8 JsBuiltin,
9 METADATA, 9 METADATA,
10 TYPES; 10 TYPES;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 switch (builtin) { 148 switch (builtin) {
149 case JsBuiltin.dartObjectConstructor: 149 case JsBuiltin.dartObjectConstructor:
150 return js.js.expressionTemplateYielding( 150 return js.js.expressionTemplateYielding(
151 typeAccess(_compiler.objectClass)); 151 typeAccess(_compiler.objectClass));
152 152
153 case JsBuiltin.isCheckPropertyToJsConstructorName: 153 case JsBuiltin.isCheckPropertyToJsConstructorName:
154 int isPrefixLength = namer.operatorIsPrefix.length; 154 int isPrefixLength = namer.operatorIsPrefix.length;
155 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); 155 return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
156 156
157 case JsBuiltin.isFunctionType: 157 case JsBuiltin.isFunctionType:
158 return _backend.rti.representationGenerator.templateForIsFunctionType; 158 return _backend.rtiEncoder.templateForIsFunctionType;
159 159
160 case JsBuiltin.rawRtiToJsConstructorName: 160 case JsBuiltin.rawRtiToJsConstructorName:
161 return js.js.expressionTemplateFor("#.$typeNameProperty"); 161 return js.js.expressionTemplateFor("#.$typeNameProperty");
162 162
163 case JsBuiltin.rawRuntimeType: 163 case JsBuiltin.rawRuntimeType:
164 return js.js.expressionTemplateFor("#.constructor"); 164 return js.js.expressionTemplateFor("#.constructor");
165 165
166 case JsBuiltin.createFunctionTypeRti: 166 case JsBuiltin.createFunctionTypeRti:
167 return _backend.rti.representationGenerator 167 return _backend.rtiEncoder.templateForCreateFunctionType;
168 .templateForCreateFunctionType;
169 168
170 case JsBuiltin.isSubtype: 169 case JsBuiltin.isSubtype:
171 // TODO(floitsch): move this closer to where is-check properties are 170 // TODO(floitsch): move this closer to where is-check properties are
172 // built. 171 // built.
173 String isPrefix = namer.operatorIsPrefix; 172 String isPrefix = namer.operatorIsPrefix;
174 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 173 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
175 174
176 case JsBuiltin.isGivenTypeRti: 175 case JsBuiltin.isGivenTypeRti:
177 return js.js.expressionTemplateFor('#.$typeNameProperty === #'); 176 return js.js.expressionTemplateFor('#.$typeNameProperty === #');
178 177
(...skipping 10 matching lines...) Expand all
189 reporter.internalError(NO_LOCATION_SPANNABLE, 188 reporter.internalError(NO_LOCATION_SPANNABLE,
190 "Unhandled Builtin: $builtin"); 189 "Unhandled Builtin: $builtin");
191 return null; 190 return null;
192 } 191 }
193 } 192 }
194 193
195 @override 194 @override
196 void invalidateCaches() { 195 void invalidateCaches() {
197 } 196 }
198 } 197 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/js_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/metadata_collector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698