| OLD | NEW |
| 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 import 'dart:math' as math; | 5 import 'dart:math' as math; |
| 6 import 'dart:collection' show Queue; | 6 import 'dart:collection' show Queue; |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 9 import '../common/tasks.dart' show CompilerTask; | 9 import '../common/tasks.dart' show CompilerTask; |
| 10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
| (...skipping 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 List<js.Expression> arguments = <js.Expression>[]; | 2989 List<js.Expression> arguments = <js.Expression>[]; |
| 2990 for (HInstruction input in node.inputs) { | 2990 for (HInstruction input in node.inputs) { |
| 2991 use(input); | 2991 use(input); |
| 2992 arguments.add(pop()); | 2992 arguments.add(pop()); |
| 2993 } | 2993 } |
| 2994 | 2994 |
| 2995 switch (node.kind) { | 2995 switch (node.kind) { |
| 2996 case TypeInfoExpressionKind.COMPLETE: | 2996 case TypeInfoExpressionKind.COMPLETE: |
| 2997 int index = 0; | 2997 int index = 0; |
| 2998 js.Expression result = _rtiEncoder.getTypeRepresentation( | 2998 js.Expression result = _rtiEncoder.getTypeRepresentation( |
| 2999 node.dartType, (TypeVariableType variable) => arguments[index++]); | 2999 _emitter.emitter, |
| 3000 node.dartType, |
| 3001 (TypeVariableType variable) => arguments[index++]); |
| 3000 assert(index == node.inputs.length); | 3002 assert(index == node.inputs.length); |
| 3001 push(result); | 3003 push(result); |
| 3002 return; | 3004 return; |
| 3003 | 3005 |
| 3004 case TypeInfoExpressionKind.INSTANCE: | 3006 case TypeInfoExpressionKind.INSTANCE: |
| 3005 // We expect only flat types for the INSTANCE representation. | 3007 // We expect only flat types for the INSTANCE representation. |
| 3006 assert((node.dartType as InterfaceType).typeArguments.length == | 3008 assert((node.dartType as InterfaceType).typeArguments.length == |
| 3007 arguments.length); | 3009 arguments.length); |
| 3008 _registry.registerInstantiatedClass(_commonElements.listClass); | 3010 _registry.registerInstantiatedClass(_commonElements.listClass); |
| 3009 push(new js.ArrayInitializer(arguments) | 3011 push(new js.ArrayInitializer(arguments) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3031 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { | 3033 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { |
| 3032 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls); | 3034 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls); |
| 3033 }); | 3035 }); |
| 3034 } | 3036 } |
| 3035 | 3037 |
| 3036 @override | 3038 @override |
| 3037 void visitRef(HRef node) { | 3039 void visitRef(HRef node) { |
| 3038 visit(node.value); | 3040 visit(node.value); |
| 3039 } | 3041 } |
| 3040 } | 3042 } |
| OLD | NEW |