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

Unified Diff: lib/compiler/implementation/ssa/codegen_helpers.dart

Issue 10383062: Avoid inserting new temporaries because of HTypeConversion nodes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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: lib/compiler/implementation/ssa/codegen_helpers.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen_helpers.dart (revision 7378)
+++ lib/compiler/implementation/ssa/codegen_helpers.dart (working copy)
@@ -54,23 +54,13 @@
// they would not be alive.
void visitTypeGuard(HTypeGuard instruction) {}
- // TODO(ngeoffray): This should not be needed. The codegen should
- // cope better with this instruction.
- void visitTypeConversion(HTypeConversion instruction) {}
+ void visitTypeConversion(HTypeConversion instruction) {
+ if (!instruction.checked) generateAtUseSite.add(instruction);
+ visitInstruction(instruction);
+ }
void tryGenerateAtUseSite(HInstruction instruction) {
- // A type guard should never be generate at use site, otherwise we
- // cannot bailout.
- if (instruction is HTypeGuard) return;
-
- // A check should never be generate at use site, otherwise we
- // cannot throw.
- if (instruction is HCheck) return;
-
- // TODO(ngeoffray): This should not be needed. The codegen should
- // cope better with this instruction.
- if (instruction is HTypeConversion) return;
-
+ if (instruction.isControlFlow()) return;
generateAtUseSite.add(instruction);
}

Powered by Google App Engine
This is Rietveld 408576698