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

Side by Side Diff: pkg/compiler/lib/src/js_backend/constant_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of js_backend; 5 part of js_backend;
6 6
7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant);
8 8
9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array);
10 10
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 String stripComments(String rawJavaScript) { 302 String stripComments(String rawJavaScript) {
303 return rawJavaScript.replaceAll(COMMENT_RE, ''); 303 return rawJavaScript.replaceAll(COMMENT_RE, '');
304 } 304 }
305 305
306 jsAst.Expression maybeAddTypeArguments(InterfaceType type, 306 jsAst.Expression maybeAddTypeArguments(InterfaceType type,
307 jsAst.Expression value) { 307 jsAst.Expression value) {
308 if (type is InterfaceType && 308 if (type is InterfaceType &&
309 !type.treatAsRaw && 309 !type.treatAsRaw &&
310 backend.classNeedsRti(type.element)) { 310 backend.classNeedsRti(type.element)) {
311 InterfaceType interface = type; 311 InterfaceType interface = type;
312 RuntimeTypes rti = backend.rti; 312 RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder;
313 Iterable<jsAst.Expression> arguments = interface.typeArguments 313 Iterable<jsAst.Expression> arguments = interface.typeArguments
314 .map((DartType type) => 314 .map((DartType type) =>
315 rti.getTypeRepresentationWithPlaceholders(type, (_){})); 315 rtiEncoder.getTypeRepresentationWithPlaceholders(type, (_){}));
316 jsAst.Expression argumentList = 316 jsAst.Expression argumentList =
317 new jsAst.ArrayInitializer(arguments.toList()); 317 new jsAst.ArrayInitializer(arguments.toList());
318 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), 318 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()),
319 [value, argumentList]); 319 [value, argumentList]);
320 } 320 }
321 return value; 321 return value;
322 } 322 }
323 323
324 @override 324 @override
325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { 325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) {
326 return constantReferenceGenerator(constant.referenced); 326 return constantReferenceGenerator(constant.referenced);
327 } 327 }
328 } 328 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698