| 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 '../common/codegen.dart' show CodegenWorkItem; | 5 import '../common/codegen.dart' show CodegenWorkItem; |
| 6 import '../common/tasks.dart' show CompilerTask; | 6 import '../common/tasks.dart' show CompilerTask; |
| 7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../core_types.dart' show CoreClasses; | 10 import '../core_types.dart' show CoreClasses; |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 } | 773 } |
| 774 | 774 |
| 775 HInstruction removeIfCheckAlwaysSucceeds(HCheck node, TypeMask checkedType) { | 775 HInstruction removeIfCheckAlwaysSucceeds(HCheck node, TypeMask checkedType) { |
| 776 ClassWorld classWorld = compiler.world; | 776 ClassWorld classWorld = compiler.world; |
| 777 if (checkedType.containsAll(classWorld)) return node; | 777 if (checkedType.containsAll(classWorld)) return node; |
| 778 HInstruction input = node.checkedInput; | 778 HInstruction input = node.checkedInput; |
| 779 TypeMask inputType = input.instructionType; | 779 TypeMask inputType = input.instructionType; |
| 780 return inputType.isInMask(checkedType, classWorld) ? input : node; | 780 return inputType.isInMask(checkedType, classWorld) ? input : node; |
| 781 } | 781 } |
| 782 | 782 |
| 783 HInstruction removeCheck(HCheck node) => node.checkedInput; |
| 784 |
| 783 VariableElement findConcreteFieldForDynamicAccess( | 785 VariableElement findConcreteFieldForDynamicAccess( |
| 784 HInstruction receiver, Selector selector) { | 786 HInstruction receiver, Selector selector) { |
| 785 TypeMask receiverType = receiver.instructionType; | 787 TypeMask receiverType = receiver.instructionType; |
| 786 return compiler.world.locateSingleField(selector, receiverType); | 788 return compiler.world.locateSingleField(selector, receiverType); |
| 787 } | 789 } |
| 788 | 790 |
| 789 HInstruction visitFieldGet(HFieldGet node) { | 791 HInstruction visitFieldGet(HFieldGet node) { |
| 790 if (node.isNullCheck) return node; | 792 if (node.isNullCheck) return node; |
| 791 var receiver = node.receiver; | 793 var receiver = node.receiver; |
| 792 if (node.element == helpers.jsIndexableLength) { | 794 if (node.element == helpers.jsIndexableLength) { |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 | 2381 |
| 2380 keyedValues.forEach((receiver, values) { | 2382 keyedValues.forEach((receiver, values) { |
| 2381 result.keyedValues[receiver] = | 2383 result.keyedValues[receiver] = |
| 2382 new Map<HInstruction, HInstruction>.from(values); | 2384 new Map<HInstruction, HInstruction>.from(values); |
| 2383 }); | 2385 }); |
| 2384 | 2386 |
| 2385 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2387 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 2386 return result; | 2388 return result; |
| 2387 } | 2389 } |
| 2388 } | 2390 } |
| OLD | NEW |