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

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

Issue 194663005: Take is checks into account when deriving interceptor classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698