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

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

Issue 10824371: Add an optional parameter to the dominatedUsers function in case we want to analyze the whole block, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/nodes.dart
===================================================================
--- lib/compiler/implementation/ssa/nodes.dart (revision 10938)
+++ lib/compiler/implementation/ssa/nodes.dart (working copy)
@@ -932,16 +932,17 @@
}
// Compute the set of users of this instruction that is dominated by
- // [other].
- Set<HInstruction> dominatedUsers(HInstruction other) {
+ // [other] or [otherBlock].
+ Set<HInstruction> dominatedUsers(HInstruction other,
kasperl 2012/08/20 11:37:22 I'd prefer two different entry points for this:
+ [HBasicBlock otherBlock = null]) {
// Keep track of all instructions that we have to deal with later
// and count the number of them that are in the current block.
Set<HInstruction> users = new Set<HInstruction>();
int usersInCurrentBlock = 0;
+ if (otherBlock == null) otherBlock = other.block;
// Run through all the users and see if they are dominated or
- // potentially dominated by [other].
- HBasicBlock otherBlock = other.block;
+ // potentially dominated by [otherBlock].
kasperl 2012/08/20 11:37:22 Here you're adding all the users that are dominate
for (int i = 0, length = usedBy.length; i < length; i++) {
HInstruction current = usedBy[i];
if (current !== other && otherBlock.dominates(current.block)) {
@@ -950,7 +951,7 @@
}
}
- // Run through all the phis in the same block as [other] and remove them
+ // Run through all the phis in otherBlock and remove them
// from the users set.
if (usersInCurrentBlock > 0) {
for (HPhi phi = otherBlock.phis.first; phi !== null; phi = phi.next) {
@@ -961,9 +962,9 @@
}
}
- // Run through all the instructions before [other] and remove them
+ // Run through all the instructions before otherBlock and remove them
kasperl 2012/08/20 11:37:22 This should still be all instructions before [othe
// from the users set.
- if (usersInCurrentBlock > 0) {
+ if (other != null && usersInCurrentBlock > 0) {
HInstruction current = otherBlock.first;
while (current !== other) {
if (users.contains(current)) {
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | lib/compiler/implementation/ssa/optimize.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698