| 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); | 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA code generator'; | 7 String get name() => 'SSA code generator'; |
| 8 | 8 |
| 9 String generate(WorkItem work, HGraph graph) { | 9 String generate(WorkItem work, HGraph graph) { |
| 10 return measure(() { | 10 return measure(() { |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 if (element.computeType(compiler) is FunctionType) return false; | 1229 if (element.computeType(compiler) is FunctionType) return false; |
| 1230 | 1230 |
| 1231 if (!element.isClass()) { | 1231 if (!element.isClass()) { |
| 1232 compiler.cancel("Is check does not handle element", element: element); | 1232 compiler.cancel("Is check does not handle element", element: element); |
| 1233 return false; | 1233 return false; |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 List<ClassElement> subtypes = | 1236 List<ClassElement> subtypes = |
| 1237 compiler.emitter.nativeEmitter.subtypes[element]; | 1237 compiler.emitter.nativeEmitter.subtypes[element]; |
| 1238 if (subtypes === null) return false; | 1238 if (subtypes === null) return false; |
| 1239 compiler.registerStaticUse(compiler.findHelper( |
| 1240 const SourceString('dynamicIsCheck'))); |
| 1239 return true; | 1241 return true; |
| 1240 } | 1242 } |
| 1241 } | 1243 } |
| 1242 | 1244 |
| 1243 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { | 1245 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { |
| 1244 final List<HTypeGuard> guards; | 1246 final List<HTypeGuard> guards; |
| 1245 int state = 0; | 1247 int state = 0; |
| 1246 | 1248 |
| 1247 SsaOptimizedCodeGenerator(compiler, work, parameters, parameterNames) | 1249 SsaOptimizedCodeGenerator(compiler, work, parameters, parameterNames) |
| 1248 : super(compiler, work, parameters, parameterNames), | 1250 : super(compiler, work, parameters, parameterNames), |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 startBailoutSwitch(); | 1587 startBailoutSwitch(); |
| 1586 } | 1588 } |
| 1587 } | 1589 } |
| 1588 | 1590 |
| 1589 void endElse(HIf node) { | 1591 void endElse(HIf node) { |
| 1590 if (node.elseBlock.hasBailouts()) { | 1592 if (node.elseBlock.hasBailouts()) { |
| 1591 endBailoutSwitch(); | 1593 endBailoutSwitch(); |
| 1592 } | 1594 } |
| 1593 } | 1595 } |
| 1594 } | 1596 } |
| OLD | NEW |