| 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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 bool isListOrSupertype(Element element) { | 1109 bool isListOrSupertype(Element element) { |
| 1110 LibraryElement coreLibrary = compiler.coreLibrary; | 1110 LibraryElement coreLibrary = compiler.coreLibrary; |
| 1111 return (element == coreLibrary.find(const SourceString('List'))) | 1111 return (element == coreLibrary.find(const SourceString('List'))) |
| 1112 || (element == coreLibrary.find(const SourceString('Collection'))) | 1112 || (element == coreLibrary.find(const SourceString('Collection'))) |
| 1113 || (element == coreLibrary.find(const SourceString('Iterable'))); | 1113 || (element == coreLibrary.find(const SourceString('Iterable'))); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 bool isSupertypeOfNativeClass(Element element) { | 1116 bool isSupertypeOfNativeClass(Element element) { |
| 1117 // TODO(ngeoffray): Check all types that are super types of native | 1117 // TODO(ngeoffray): Check all types that are super types of native |
| 1118 // classes. | 1118 // classes. |
| 1119 compiler.registerStaticUse(compiler.findHelper( |
| 1120 const SourceString('dynamicIsCheck'))); |
| 1119 return true; | 1121 return true; |
| 1120 } | 1122 } |
| 1121 } | 1123 } |
| 1122 | 1124 |
| 1123 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { | 1125 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { |
| 1124 final List<HTypeGuard> guards; | 1126 final List<HTypeGuard> guards; |
| 1125 int state = 0; | 1127 int state = 0; |
| 1126 | 1128 |
| 1127 SsaOptimizedCodeGenerator(compiler, work, buffer, parameters, parameterNames) | 1129 SsaOptimizedCodeGenerator(compiler, work, buffer, parameters, parameterNames) |
| 1128 : super(compiler, work, buffer, parameters, parameterNames), | 1130 : super(compiler, work, buffer, parameters, parameterNames), |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 startBailoutSwitch(); | 1474 startBailoutSwitch(); |
| 1473 } | 1475 } |
| 1474 } | 1476 } |
| 1475 | 1477 |
| 1476 void endElse(HIf node) { | 1478 void endElse(HIf node) { |
| 1477 if (node.elseBlock.hasBailouts()) { | 1479 if (node.elseBlock.hasBailouts()) { |
| 1478 endBailoutSwitch(); | 1480 endBailoutSwitch(); |
| 1479 } | 1481 } |
| 1480 } | 1482 } |
| 1481 } | 1483 } |
| OLD | NEW |