Index: sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart b/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart |
index d9fc2865689090dbc84f51569946e071dfa5f528..5511118ee603a6cf9148ffdf3f5150b14cfe79f6 100644 |
--- a/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart |
+++ b/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart |
@@ -69,6 +69,12 @@ class InvokeDynamicSpecializer { |
} else if (selector.name == '>=') { |
return const GreaterEqualSpecializer(); |
} |
+ } else if (selector.kind == SelectorKind.CALL) { |
+ if (selector.argumentCount == 1 && selector.namedArguments.length == 0) { |
+ if (selector.name == 'codeUnitAt') { |
+ return const CodeUnitAtSpecializer(); |
+ } |
+ } |
} |
return const InvokeDynamicSpecializer(); |
} |
@@ -726,3 +732,18 @@ class LessEqualSpecializer extends RelationalSpecializer { |
instruction.selector, backend.boolType); |
} |
} |
+ |
+class CodeUnitAtSpecializer extends InvokeDynamicSpecializer { |
+ const CodeUnitAtSpecializer(); |
+ |
+ BinaryOperation operation(ConstantSystem constantSystem) { |
+ return constantSystem.codeUnitAt; |
+ } |
+ |
+ HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, |
+ Compiler compiler) { |
+ // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index |
+ // bounds checking optimizations as for HIndex. |
+ return null; |
+ } |
+} |