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

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

Issue 48243002: When doing SSA type propagation, refine the receiver after a call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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: sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart (revision 29343)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart (working copy)
@@ -5,6 +5,31 @@
part of ssa;
/**
+ * Remove [HTypeKnown] instructions from the graph, to make codegen
+ * analysis easier.
+ */
+class SsaTypeKnownRemover extends HBaseVisitor {
+
+ void visitGraph(HGraph graph) {
+ visitDominatorTree(graph);
+ }
+
+ void visitBasicBlock(HBasicBlock block) {
+ HInstruction instruction = block.first;
+ while (instruction != null) {
+ HInstruction next = instruction.next;
+ instruction.accept(this);
+ instruction = next;
+ }
+ }
+
+ void visitTypeKnown(HTypeKnown instruction) {
+ instruction.block.rewrite(instruction, instruction.checkedInput);
+ instruction.block.remove(instruction);
+ }
+}
+
+/**
* Instead of emitting each SSA instruction with a temporary variable
* mark instructions that can be emitted at their use-site.
* For example, in:
@@ -119,7 +144,8 @@
}
void visitTypeKnown(HTypeKnown instruction) {
- markAsGenerateAtUseSite(instruction);
+ // [HTypeKnown] instructions are removed before code generation.
+ assert(false);
}
void tryGenerateAtUseSite(HInstruction instruction) {

Powered by Google App Engine
This is Rietveld 408576698