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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/startup_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) 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' show 7 import 'package:js_runtime/shared/embedded_names.dart' show
8 JsBuiltin, 8 JsBuiltin,
9 METADATA, 9 METADATA,
10 STATIC_FUNCTION_NAME_TO_CLOSURE, 10 STATIC_FUNCTION_NAME_TO_CLOSURE,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 switch (builtin) { 145 switch (builtin) {
146 case JsBuiltin.dartObjectConstructor: 146 case JsBuiltin.dartObjectConstructor:
147 return js.js.expressionTemplateYielding( 147 return js.js.expressionTemplateYielding(
148 typeAccess(_compiler.objectClass)); 148 typeAccess(_compiler.objectClass));
149 149
150 case JsBuiltin.isCheckPropertyToJsConstructorName: 150 case JsBuiltin.isCheckPropertyToJsConstructorName:
151 int isPrefixLength = namer.operatorIsPrefix.length; 151 int isPrefixLength = namer.operatorIsPrefix.length;
152 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); 152 return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
153 153
154 case JsBuiltin.isFunctionType: 154 case JsBuiltin.isFunctionType:
155 return _backend.rti.representationGenerator.templateForIsFunctionType; 155 return _backend.rtiEncoder.templateForIsFunctionType;
156 156
157 case JsBuiltin.rawRtiToJsConstructorName: 157 case JsBuiltin.rawRtiToJsConstructorName:
158 return js.js.expressionTemplateFor("#.$typeNameProperty"); 158 return js.js.expressionTemplateFor("#.$typeNameProperty");
159 159
160 case JsBuiltin.rawRuntimeType: 160 case JsBuiltin.rawRuntimeType:
161 return js.js.expressionTemplateFor("#.constructor"); 161 return js.js.expressionTemplateFor("#.constructor");
162 162
163 case JsBuiltin.createFunctionTypeRti: 163 case JsBuiltin.createFunctionTypeRti:
164 return _backend.rti.representationGenerator 164 return _backend.rtiEncoder.templateForCreateFunctionType;
165 .templateForCreateFunctionType;
166 165
167 case JsBuiltin.isSubtype: 166 case JsBuiltin.isSubtype:
168 // TODO(floitsch): move this closer to where is-check properties are 167 // TODO(floitsch): move this closer to where is-check properties are
169 // built. 168 // built.
170 String isPrefix = namer.operatorIsPrefix; 169 String isPrefix = namer.operatorIsPrefix;
171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 170 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
172 171
173 case JsBuiltin.isGivenTypeRti: 172 case JsBuiltin.isGivenTypeRti:
174 return js.js.expressionTemplateFor('#.$typeNameProperty === #'); 173 return js.js.expressionTemplateFor('#.$typeNameProperty === #');
175 174
(...skipping 16 matching lines...) Expand all
192 reporter.internalError(NO_LOCATION_SPANNABLE, 191 reporter.internalError(NO_LOCATION_SPANNABLE,
193 "Unhandled Builtin: $builtin"); 192 "Unhandled Builtin: $builtin");
194 return null; 193 return null;
195 } 194 }
196 } 195 }
197 196
198 @override 197 @override
199 void invalidateCaches() { 198 void invalidateCaches() {
200 } 199 }
201 } 200 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698