| 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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 if (element.computeType(compiler) is FunctionType) return false; | 1170 if (element.computeType(compiler) is FunctionType) return false; |
| 1171 | 1171 |
| 1172 if (!element.isClass()) { | 1172 if (!element.isClass()) { |
| 1173 compiler.cancel("Is check does not handle element", element: element); | 1173 compiler.cancel("Is check does not handle element", element: element); |
| 1174 return false; | 1174 return false; |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 List<ClassElement> subtypes = | 1177 List<ClassElement> subtypes = |
| 1178 compiler.emitter.nativeEmitter.subtypes[element]; | 1178 compiler.emitter.nativeEmitter.subtypes[element]; |
| 1179 if (subtypes === null) return false; | 1179 if (subtypes === null) return false; |
| 1180 compiler.registerStaticUse(compiler.findHelper( |
| 1181 const SourceString('dynamicIsCheck'))); |
| 1180 return true; | 1182 return true; |
| 1181 } | 1183 } |
| 1182 } | 1184 } |
| 1183 | 1185 |
| 1184 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { | 1186 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { |
| 1185 final List<HTypeGuard> guards; | 1187 final List<HTypeGuard> guards; |
| 1186 int state = 0; | 1188 int state = 0; |
| 1187 | 1189 |
| 1188 SsaOptimizedCodeGenerator(compiler, work, parameters, parameterNames) | 1190 SsaOptimizedCodeGenerator(compiler, work, parameters, parameterNames) |
| 1189 : super(compiler, work, parameters, parameterNames), | 1191 : super(compiler, work, parameters, parameterNames), |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 startBailoutSwitch(); | 1528 startBailoutSwitch(); |
| 1527 } | 1529 } |
| 1528 } | 1530 } |
| 1529 | 1531 |
| 1530 void endElse(HIf node) { | 1532 void endElse(HIf node) { |
| 1531 if (node.elseBlock.hasBailouts()) { | 1533 if (node.elseBlock.hasBailouts()) { |
| 1532 endBailoutSwitch(); | 1534 endBailoutSwitch(); |
| 1533 } | 1535 } |
| 1534 } | 1536 } |
| 1535 } | 1537 } |
| OLD | NEW |