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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 6 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 | Annotate | Revision Log
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 class ConstantEmitter { 7 class ConstantEmitter {
8 ConstantReferenceEmitter _referenceEmitter; 8 ConstantReferenceEmitter _referenceEmitter;
9 ConstantInitializerEmitter _initializerEmitter; 9 ConstantInitializerEmitter _initializerEmitter;
10 10
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 for (int i = 0; i < values.length; i++) { 319 for (int i = 0; i < values.length; i++) {
320 valueList.add(_reference(values[i])); 320 valueList.add(_reference(values[i]));
321 } 321 }
322 return valueList; 322 return valueList;
323 } 323 }
324 324
325 jsAst.Expression maybeAddTypeArguments(InterfaceType type, 325 jsAst.Expression maybeAddTypeArguments(InterfaceType type,
326 jsAst.Expression value) { 326 jsAst.Expression value) {
327 if (type is InterfaceType && 327 if (type is InterfaceType &&
328 !type.isRaw && 328 !type.isRaw &&
329 backend.needsRti(type.element)) { 329 backend.classNeedsRti(type.element)) {
330 InterfaceType interface = type; 330 InterfaceType interface = type;
331 RuntimeTypes rti = backend.rti; 331 RuntimeTypes rti = backend.rti;
332 Iterable<String> arguments = interface.typeArguments 332 Iterable<String> arguments = interface.typeArguments
333 .toList(growable: false) 333 .toList(growable: false)
334 .map((DartType type) => rti.getTypeRepresentation(type, (_){})); 334 .map((DartType type) => rti.getTypeRepresentation(type, (_){}));
335 jsAst.Expression argumentList = 335 jsAst.Expression argumentList =
336 new jsAst.LiteralString('[${arguments.join(', ')}]'); 336 new jsAst.LiteralString('[${arguments.join(', ')}]');
337 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), 337 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()),
338 [value, argumentList]); 338 [value, argumentList]);
339 } 339 }
340 return value; 340 return value;
341 } 341 }
342 } 342 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698