Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart b/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart |
| index f2ae1a506763c0fe8b6bb84a2f9a6b61854d3aa7..268380efe2305df43c11deeb6fd0aac95169bfc7 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart |
| @@ -173,28 +173,34 @@ class SsaSimplifyInterceptors extends HBaseVisitor |
| // it with a set of classes it intercepts. |
| Set<ClassElement> interceptedClasses; |
| JavaScriptBackend backend = compiler.backend; |
| - HInstruction dominator = |
| - findDominator(node.usedBy.where((i) => i is HInvokeDynamic)); |
| + HInstruction dominator = findDominator(node.usedBy.where((i) { |
| + return i is HInvokeDynamic || i is HIs; |
|
floitsch
2014/03/11 17:07:06
Indent by two and the next line by 0.
|
| + })); |
| // If there is an instruction that dominates all others, we can |
| // use only the selector of that instruction. |
| if (dominator != null) { |
| - interceptedClasses = |
| - backend.getInterceptedClassesOn(dominator.selector.name); |
| - |
| - // If we found that we need number, we must still go through all |
| - // uses to check if they require int, or double. |
| - if (interceptedClasses.contains(backend.jsNumberClass) |
| - && !(interceptedClasses.contains(backend.jsDoubleClass) |
| - || interceptedClasses.contains(backend.jsIntClass))) { |
| - for (HInstruction user in node.usedBy) { |
| - if (user is! HInvoke) continue; |
| - Set<ClassElement> intercepted = |
| - backend.getInterceptedClassesOn(user.selector.name); |
| - if (intercepted.contains(backend.jsIntClass)) { |
| - interceptedClasses.add(backend.jsIntClass); |
| - } |
| - if (intercepted.contains(backend.jsDoubleClass)) { |
| - interceptedClasses.add(backend.jsDoubleClass); |
| + if (dominator is HIs) { |
| + // Is checks do not constrain the set of intercepted classes. |
| + interceptedClasses = backend.interceptedClasses; |
| + } else { |
| + interceptedClasses = |
| + backend.getInterceptedClassesOn(dominator.selector.name); |
| + |
| + // If we found that we need number, we must still go through all |
| + // uses to check if they require int, or double. |
| + if (interceptedClasses.contains(backend.jsNumberClass) |
| + && !(interceptedClasses.contains(backend.jsDoubleClass) |
| + || interceptedClasses.contains(backend.jsIntClass))) { |
| + for (HInstruction user in node.usedBy) { |
| + if (user is! HInvoke) continue; |
| + Set<ClassElement> intercepted = |
| + backend.getInterceptedClassesOn(user.selector.name); |
| + if (intercepted.contains(backend.jsIntClass)) { |
| + interceptedClasses.add(backend.jsIntClass); |
| + } |
| + if (intercepted.contains(backend.jsDoubleClass)) { |
| + interceptedClasses.add(backend.jsDoubleClass); |
| + } |
| } |
| } |
| } |