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

Unified Diff: dart/frog/leg/ssa/codegen_helpers.dart

Issue 9368033: Support is checks on primitive types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 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 | « dart/frog/leg/ssa/codegen.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/codegen_helpers.dart
===================================================================
--- dart/frog/leg/ssa/codegen_helpers.dart (revision 4084)
+++ dart/frog/leg/ssa/codegen_helpers.dart (working copy)
@@ -12,7 +12,9 @@
* t0 and t1 would be marked and the resulting code would then be:
* t2 = add(4, 3);
*/
-class SsaInstructionMerger extends HGraphVisitor {
+class SsaInstructionMerger extends HBaseVisitor {
+ List<HInstruction> expectedInputs;
+
void visitGraph(HGraph graph) {
visitDominatorTree(graph);
}
@@ -24,6 +26,16 @@
return true;
}
+ void visitInstruction(HInstruction instruction) {
+ for (HInstruction input in instruction.inputs) {
+ if (!input.generateAtUseSite() && input.usedBy.length == 1) {
+ expectedInputs.add(input);
+ }
+ }
+ }
+
+ void visitIs(HIs instruction) {}
floitsch 2012/02/10 09:38:17 add comment why this is empty.
ngeoffray 2012/02/10 09:40:48 Done.
+
void visitBasicBlock(HBasicBlock block) {
// Visit each instruction of the basic block in last-to-first order.
// Keep a list of expected inputs of the current "expression" being
@@ -32,15 +44,11 @@
// The expectedInputs list holds non-trivial instructions that may
// be generated at their use site, if they occur in the correct order.
- List<HInstruction> expectedInputs = new List<HInstruction>();
+ expectedInputs = new List<HInstruction>();
// Add non-trivial inputs of instruction to expectedInputs, in
// evaluation order.
void addInputs(HInstruction instruction) {
- for (HInstruction input in instruction.inputs) {
- if (!input.generateAtUseSite() && input.usedBy.length == 1) {
- expectedInputs.add(input);
- }
- }
+ instruction.accept(this);
}
// Pop instructions from expectedInputs until instruction is found.
// Return true if it is found, or false if not.
@@ -80,6 +88,7 @@
addInputs(instruction);
}
}
+ expectedInputs = null;
}
}
« no previous file with comments | « dart/frog/leg/ssa/codegen.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698