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

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

Issue 17028011: Implement a list tracer phase, that tries to find element types in individual lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 // The index should be an int when the receiver is a string or array. 148 // The index should be an int when the receiver is a string or array.
149 // However it turns out that inserting an integer check in the optimized 149 // However it turns out that inserting an integer check in the optimized
150 // version is cheaper than having another bailout case. This is true, 150 // version is cheaper than having another bailout case. This is true,
151 // because the integer check will simply throw if it fails. 151 // because the integer check will simply throw if it fails.
152 return HType.UNKNOWN; 152 return HType.UNKNOWN;
153 } 153 }
154 154
155 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, 155 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
156 Compiler compiler) { 156 Compiler compiler) {
157 if (instruction.inputs[1].isIndexable(compiler)) { 157 if (!instruction.inputs[1].isIndexable(compiler)) return null;
158 if (!instruction.inputs[2].isInteger() && compiler.enableTypeAssertions) { 158 if (!instruction.inputs[2].isInteger() && compiler.enableTypeAssertions) {
159 // We want the right checked mode error. 159 // We want the right checked mode error.
160 return null; 160 return null;
161 }
162 HInstruction index = new HIndex(
163 instruction.inputs[1], instruction.inputs[2], instruction.selector);
164 index.instructionType =
165 new HType.inferredTypeForSelector(instruction.selector, compiler);
166 return index;
167 } 161 }
168 return null; 162 HInstruction index = new HIndex(
163 instruction.inputs[1], instruction.inputs[2], instruction.selector);
164 HType receiverType = instruction.getDartReceiver(compiler).instructionType;
165 Selector refined = receiverType.refine(instruction.selector, compiler);
166 HType type = new HType.inferredTypeForSelector(refined, compiler);
167 index.instructionType = type;
168 return index;
169 } 169 }
170 170
171 bool hasBuiltinVariant(HInvokeDynamic instruction, Compiler compiler) { 171 bool hasBuiltinVariant(HInvokeDynamic instruction, Compiler compiler) {
172 return true; 172 return true;
173 } 173 }
174 } 174 }
175 175
176 class BitNotSpecializer extends InvokeDynamicSpecializer { 176 class BitNotSpecializer extends InvokeDynamicSpecializer {
177 const BitNotSpecializer(); 177 const BitNotSpecializer();
178 178
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 BinaryOperation operation(ConstantSystem constantSystem) { 695 BinaryOperation operation(ConstantSystem constantSystem) {
696 return constantSystem.lessEqual; 696 return constantSystem.lessEqual;
697 } 697 }
698 698
699 HInstruction newBuiltinVariant(HInvokeDynamic instruction) { 699 HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
700 return new HLessEqual( 700 return new HLessEqual(
701 instruction.inputs[1], instruction.inputs[2], instruction.selector); 701 instruction.inputs[1], instruction.inputs[2], instruction.selector);
702 } 702 }
703 } 703 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698