Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart

Issue 14052009: Improve optimization of operations on indexables by using more inferred type information and by dis… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dartc warnings. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * [InvokeDynamicSpecializer] and its subclasses are helpers to 8 * [InvokeDynamicSpecializer] and its subclasses are helpers to
9 * optimize intercepted dynamic calls. It knows what input types 9 * optimize intercepted dynamic calls. It knows what input types
10 * would be beneficial for performance, and how to change a invoke 10 * would be beneficial for performance, and how to change a invoke
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // The index should be an int when the receiver is a string or array. 123 // The index should be an int when the receiver is a string or array.
124 // However it turns out that inserting an integer check in the optimized 124 // However it turns out that inserting an integer check in the optimized
125 // version is cheaper than having another bailout case. This is true, 125 // version is cheaper than having another bailout case. This is true,
126 // because the integer check will simply throw if it fails. 126 // because the integer check will simply throw if it fails.
127 return HType.UNKNOWN; 127 return HType.UNKNOWN;
128 } 128 }
129 129
130 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, 130 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
131 Compiler compiler) { 131 Compiler compiler) {
132 if (instruction.inputs[1].isIndexable(compiler)) { 132 if (instruction.inputs[1].isIndexable(compiler)) {
133 return new HIndex( 133 HInstruction index = new HIndex(
134 instruction.inputs[1], instruction.inputs[2], instruction.selector); 134 instruction.inputs[1], instruction.inputs[2], instruction.selector);
135 index.instructionType =
136 new HType.inferredTypeForSelector(instruction.selector, compiler);
137 return index;
135 } 138 }
136 return null; 139 return null;
137 } 140 }
138 } 141 }
139 142
140 class BitNotSpecializer extends InvokeDynamicSpecializer { 143 class BitNotSpecializer extends InvokeDynamicSpecializer {
141 const BitNotSpecializer(); 144 const BitNotSpecializer();
142 145
143 UnaryOperation operation(ConstantSystem constantSystem) { 146 UnaryOperation operation(ConstantSystem constantSystem) {
144 return constantSystem.bitNot; 147 return constantSystem.bitNot;
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 624
622 BinaryOperation operation(ConstantSystem constantSystem) { 625 BinaryOperation operation(ConstantSystem constantSystem) {
623 return constantSystem.lessEqual; 626 return constantSystem.lessEqual;
624 } 627 }
625 628
626 HInstruction newBuiltinVariant(HInvokeDynamic instruction) { 629 HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
627 return new HLessEqual( 630 return new HLessEqual(
628 instruction.inputs[1], instruction.inputs[2], instruction.selector); 631 instruction.inputs[1], instruction.inputs[2], instruction.selector);
629 } 632 }
630 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698