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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 11879047: Add a new class InvokeDynamicSpecializer and subclasses that know what input types are beneficial f… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 17124)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -230,30 +230,11 @@
return new HInvokeDynamicMethod(
node.selector, node.inputs.getRange(1, node.inputs.length - 1));
}
+ HInstruction instruction =
+ node.specializer.tryConvertToBuiltin(node, types);
+ if (instruction != null) return instruction;
Selector selector = node.selector;
-
- // TODO(ngeoffray): Move this logic into a separate class.
- if (selector.kind == SelectorKind.INDEX
- && input.isIndexablePrimitive(types)) {
- if (selector.name == const SourceString('[]')) {
- return new HIndex(node.inputs[1], node.inputs[2]);
- } else if (input.isMutableArray(types)) {
- assert(selector.name == const SourceString('[]='));
- return new HIndexAssign(node.inputs[1], node.inputs[2], node.inputs[3]);
- }
- } else if (selector.kind == SelectorKind.OPERATOR) {
- if (selector.name == const SourceString('unary-')) {
- if (input.isNumber(types)) {
- return new HNegate(input);
- }
- } else if (selector.name == const SourceString('~')) {
- if (input.isNumber(types)) {
- return new HBitNot(input);
- }
- }
- }
-
SourceString selectorName = selector.name;
Element target;
if (input.isExtendableArray(types)) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698