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

Unified Diff: pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart

Issue 1182913003: Split TypedSelector into Selector and TypeMask. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index dbc5e5f1927777336c87930863b8b1c69104f103..be3406f3ee4a243141bdc05a13aebef62f34b564 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -15,8 +15,8 @@ class InvokeDynamicSpecializer {
TypeMask computeTypeFromInputTypes(HInvokeDynamic instruction,
Compiler compiler) {
- Selector selector = instruction.selector;
- return TypeMaskFactory.inferredTypeForSelector(selector, compiler);
+ return TypeMaskFactory.inferredTypeForSelector(
+ instruction.selector, instruction.mask, compiler);
}
HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
@@ -113,9 +113,8 @@ class IndexSpecializer extends InvokeDynamicSpecializer {
}
TypeMask receiverType =
instruction.getDartReceiver(compiler).instructionType;
- Selector refined = new TypedSelector(receiverType, instruction.selector,
- compiler.world);
- TypeMask type = TypeMaskFactory.inferredTypeForSelector(refined, compiler);
+ TypeMask type = TypeMaskFactory.inferredTypeForSelector(
+ instruction.selector, receiverType, compiler);
return new HIndex(
instruction.inputs[1], instruction.inputs[2],
instruction.selector, type);
@@ -239,12 +238,9 @@ abstract class BinaryArithmeticSpecializer extends InvokeDynamicSpecializer {
Compiler compiler) {
if (selector.name == name) return selector;
JavaScriptBackend backend = compiler.backend;
- Selector newSelector = new Selector(
+ return new Selector(
SelectorKind.CALL, new Name(name, backend.interceptorsLibrary),
new CallStructure(selector.argumentCount));
- return selector.mask == null
- ? newSelector
- : new TypedSelector(selector.mask, newSelector, compiler.world);
}
}
@@ -669,10 +665,9 @@ class EqualsSpecializer extends RelationalSpecializer {
return newBuiltinVariant(instruction, compiler);
}
World world = compiler.world;
- Selector selector =
- new TypedSelector(instructionType, instruction.selector, world);
JavaScriptBackend backend = compiler.backend;
- Iterable<Element> matches = world.allFunctions.filter(selector);
+ Iterable<Element> matches = world.allFunctions.filter(
+ instruction.selector, instructionType);
// This test relies the on `Object.==` and `Interceptor.==` always being
// implemented because if the selector matches by subtype, it still will be
// a regular object or an interceptor.

Powered by Google App Engine
This is Rietveld 408576698