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

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

Issue 664283004: Revert "Constant fold charCodeAt via constant system" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return const EqualsSpecializer(); 62 return const EqualsSpecializer();
63 } else if (selector.name == '<') { 63 } else if (selector.name == '<') {
64 return const LessSpecializer(); 64 return const LessSpecializer();
65 } else if (selector.name == '<=') { 65 } else if (selector.name == '<=') {
66 return const LessEqualSpecializer(); 66 return const LessEqualSpecializer();
67 } else if (selector.name == '>') { 67 } else if (selector.name == '>') {
68 return const GreaterSpecializer(); 68 return const GreaterSpecializer();
69 } else if (selector.name == '>=') { 69 } else if (selector.name == '>=') {
70 return const GreaterEqualSpecializer(); 70 return const GreaterEqualSpecializer();
71 } 71 }
72 } else if (selector.kind == SelectorKind.CALL) {
73 if (selector.argumentCount == 1 && selector.namedArguments.length == 0) {
74 if (selector.name == 'codeUnitAt') {
75 return const CodeUnitAtSpecializer();
76 }
77 }
78 } 72 }
79 return const InvokeDynamicSpecializer(); 73 return const InvokeDynamicSpecializer();
80 } 74 }
81 } 75 }
82 76
83 class IndexAssignSpecializer extends InvokeDynamicSpecializer { 77 class IndexAssignSpecializer extends InvokeDynamicSpecializer {
84 const IndexAssignSpecializer(); 78 const IndexAssignSpecializer();
85 79
86 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, 80 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
87 Compiler compiler) { 81 Compiler compiler) {
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 719 }
726 720
727 HInstruction newBuiltinVariant(HInvokeDynamic instruction, 721 HInstruction newBuiltinVariant(HInvokeDynamic instruction,
728 Compiler compiler) { 722 Compiler compiler) {
729 JavaScriptBackend backend = compiler.backend; 723 JavaScriptBackend backend = compiler.backend;
730 return new HLessEqual( 724 return new HLessEqual(
731 instruction.inputs[1], instruction.inputs[2], 725 instruction.inputs[1], instruction.inputs[2],
732 instruction.selector, backend.boolType); 726 instruction.selector, backend.boolType);
733 } 727 }
734 } 728 }
735
736 class CodeUnitAtSpecializer extends InvokeDynamicSpecializer {
737 const CodeUnitAtSpecializer();
738
739 BinaryOperation operation(ConstantSystem constantSystem) {
740 return constantSystem.codeUnitAt;
741 }
742
743 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
744 Compiler compiler) {
745 // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index
746 // bounds checking optimizations as for HIndex.
747 return null;
748 }
749 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698