| OLD | NEW |
| 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 code_generator_dependencies; | 5 library code_generator_dependencies; |
| 6 | 6 |
| 7 import '../backend_helpers.dart' show | 7 import '../backend_helpers.dart' show |
| 8 BackendHelpers; | 8 BackendHelpers; |
| 9 import '../js_backend.dart'; | 9 import '../js_backend.dart'; |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 int getTypeVariableIndex(TypeVariableType variable) { | 223 int getTypeVariableIndex(TypeVariableType variable) { |
| 224 return variable.element.index; | 224 return variable.element.index; |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) { | 227 bool needsSubstitutionForTypeVariableAccess(ClassElement cls) { |
| 228 ClassWorld classWorld = _compiler.world; | 228 ClassWorld classWorld = _compiler.world; |
| 229 if (classWorld.isUsedAsMixin(cls)) return true; | 229 if (classWorld.isUsedAsMixin(cls)) return true; |
| 230 | 230 |
| 231 return _compiler.world.anyStrictSubclassOf(cls, (ClassElement subclass) { | 231 Iterable<ClassElement> subclasses = _compiler.world.strictSubclassesOf(cls); |
| 232 return subclasses.any((ClassElement subclass) { |
| 232 return !_backend.rti.isTrivialSubstitution(subclass, cls); | 233 return !_backend.rti.isTrivialSubstitution(subclass, cls); |
| 233 }); | 234 }); |
| 234 } | 235 } |
| 235 | 236 |
| 236 js.Expression generateTypeRepresentation(DartType dartType, | 237 js.Expression generateTypeRepresentation(DartType dartType, |
| 237 List<js.Expression> arguments, | 238 List<js.Expression> arguments, |
| 238 CodegenRegistry registry) { | 239 CodegenRegistry registry) { |
| 239 int variableIndex = 0; | 240 int variableIndex = 0; |
| 240 js.Expression representation = _backend.rtiEncoder.getTypeRepresentation( | 241 js.Expression representation = _backend.rtiEncoder.getTypeRepresentation( |
| 241 dartType, | 242 dartType, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 FunctionElement get closureFromTearOff => _backend.helpers.closureFromTearOff; | 294 FunctionElement get closureFromTearOff => _backend.helpers.closureFromTearOff; |
| 294 | 295 |
| 295 js.Name registerOneShotInterceptor(Selector selector) { | 296 js.Name registerOneShotInterceptor(Selector selector) { |
| 296 return _backend.registerOneShotInterceptor(selector); | 297 return _backend.registerOneShotInterceptor(selector); |
| 297 } | 298 } |
| 298 | 299 |
| 299 bool mayGenerateInstanceofCheck(DartType type) { | 300 bool mayGenerateInstanceofCheck(DartType type) { |
| 300 return _backend.mayGenerateInstanceofCheck(type); | 301 return _backend.mayGenerateInstanceofCheck(type); |
| 301 } | 302 } |
| 302 } | 303 } |
| OLD | NEW |