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

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

Issue 829913006: Optimize is-check to instanceof when it eliminates an interceptor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/codegen_helpers.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index 3b5c557c617766f354cecd576021f22858df939f..88e5505d6b21c942c24a1c4e2770cbbe9ec63970 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -384,9 +384,14 @@ class SsaInstructionMerger extends HBaseVisitor {
analyzeInputs(instruction, 0);
}
- // The codegen might use the input multiple times, so it must not be
- // set generate at use site.
- void visitIs(HIs instruction) {}
+ void visitIs(HIs instruction) {
+ // In the general case the input might be used multple multiple times, so it
+ // must not be set generate at use site. If the code will generate
+ // 'instanceof' then we can generate at use site.
+ if (instruction.useInstanceOf) {
+ analyzeInputs(instruction, 0);
+ }
+ }
// A bounds check method must not have its first input generated at use site,
// because it's using it twice.
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698