summaryrefslogtreecommitdiffstats
path: root/dx/src/com/android/dx
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2009-05-04 14:03:49 -0700
committerDan Bornstein <danfuzz@android.com>2009-05-04 14:03:49 -0700
commit41aecd0a6bfea1e9a6713014b2b3d56fec8c552c (patch)
tree62eaa73047897d71e65cb82af2ba8e7a60d30617 /dx/src/com/android/dx
parentd3190a0566518c28656cf5e6f41a8e8697775e26 (diff)
downloadandroid_dalvik-41aecd0a6bfea1e9a6713014b2b3d56fec8c552c.tar.gz
android_dalvik-41aecd0a6bfea1e9a6713014b2b3d56fec8c552c.tar.bz2
android_dalvik-41aecd0a6bfea1e9a6713014b2b3d56fec8c552c.zip
Tweaks, Mostly grep-based, to better conform to the coding guidelines.
Diffstat (limited to 'dx/src/com/android/dx')
-rw-r--r--dx/src/com/android/dx/cf/code/LocalsArraySet.java14
-rw-r--r--dx/src/com/android/dx/cf/code/Ropper.java23
-rw-r--r--dx/src/com/android/dx/cf/direct/ClassPathOpener.java3
-rw-r--r--dx/src/com/android/dx/command/annotool/AnnotationLister.java14
-rw-r--r--dx/src/com/android/dx/command/annotool/Main.java7
-rw-r--r--dx/src/com/android/dx/command/dump/SsaDumper.java5
-rw-r--r--dx/src/com/android/dx/dex/file/DebugInfoEncoder.java4
-rw-r--r--dx/src/com/android/dx/ssa/DeadCodeRemover.java3
-rw-r--r--dx/src/com/android/dx/ssa/DomFront.java2
-rw-r--r--dx/src/com/android/dx/ssa/SCCP.java10
-rw-r--r--dx/src/com/android/dx/ssa/SsaBasicBlock.java8
-rw-r--r--dx/src/com/android/dx/ssa/SsaConverter.java7
-rw-r--r--dx/src/com/android/dx/ssa/SsaMethod.java19
-rw-r--r--dx/src/com/android/dx/ssa/SsaRenamer.java11
-rw-r--r--dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java18
-rw-r--r--dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java16
16 files changed, 80 insertions, 84 deletions
diff --git a/dx/src/com/android/dx/cf/code/LocalsArraySet.java b/dx/src/com/android/dx/cf/code/LocalsArraySet.java
index 716117668..fa2acbe30 100644
--- a/dx/src/com/android/dx/cf/code/LocalsArraySet.java
+++ b/dx/src/com/android/dx/cf/code/LocalsArraySet.java
@@ -89,7 +89,7 @@ public class LocalsArraySet extends LocalsArray {
secondaries = new ArrayList(toCopy.secondaries.size());
int sz = toCopy.secondaries.size();
- for(int i = 0; i < sz; i++) {
+ for (int i = 0; i < sz; i++) {
LocalsArray la = toCopy.secondaries.get(i);
if (la == null) {
@@ -106,7 +106,7 @@ public class LocalsArraySet extends LocalsArray {
public void setImmutable() {
primary.setImmutable();
- for (LocalsArray la: secondaries) {
+ for (LocalsArray la : secondaries) {
if (la != null) {
la.setImmutable();
}
@@ -127,7 +127,7 @@ public class LocalsArraySet extends LocalsArray {
primary.annotate(ex);
int sz = secondaries.size();
- for(int label = 0; label < sz; label++) {
+ for (int label = 0; label < sz; label++) {
LocalsArray la = secondaries.get(label);
if (la != null) {
@@ -149,7 +149,7 @@ public class LocalsArraySet extends LocalsArray {
sb.append('\n');
int sz = secondaries.size();
- for(int label = 0; label < sz; label++) {
+ for (int label = 0; label < sz; label++) {
LocalsArray la = secondaries.get(label);
if (la != null) {
@@ -178,7 +178,7 @@ public class LocalsArraySet extends LocalsArray {
primary.makeInitialized(type);
- for (LocalsArray la: secondaries) {
+ for (LocalsArray la : secondaries) {
if (la != null) {
la.makeInitialized(type);
}
@@ -198,7 +198,7 @@ public class LocalsArraySet extends LocalsArray {
primary.set(idx, type);
- for (LocalsArray la: secondaries) {
+ for (LocalsArray la : secondaries) {
if (la != null) {
la.set(idx, type);
}
@@ -218,7 +218,7 @@ public class LocalsArraySet extends LocalsArray {
primary.invalidate(idx);
- for (LocalsArray la: secondaries) {
+ for (LocalsArray la : secondaries) {
if (la != null) {
la.invalidate(idx);
}
diff --git a/dx/src/com/android/dx/cf/code/Ropper.java b/dx/src/com/android/dx/cf/code/Ropper.java
index 6ddfb7e36..13e140169 100644
--- a/dx/src/com/android/dx/cf/code/Ropper.java
+++ b/dx/src/com/android/dx/cf/code/Ropper.java
@@ -194,13 +194,13 @@ public final class Ropper {
IntList successors = new IntList(callerBlocks.size());
/*
- * For each subroutine caller, get it's target. If the target is us,
- * add the ret target (subroutine successor) to our list
+ * For each subroutine caller, get it's target. If the
+ * target is us, add the ret target (subroutine successor)
+ * to our list
*/
- for(int label = callerBlocks.nextSetBit(0); label >= 0
- ; label = callerBlocks.nextSetBit(label+1)) {
-
+ for (int label = callerBlocks.nextSetBit(0); label >= 0;
+ label = callerBlocks.nextSetBit(label+1)) {
BasicBlock subCaller = labelToBlock(label);
successors.add(subCaller.getSuccessors().get(0));
}
@@ -221,9 +221,8 @@ public final class Ropper {
void mergeToSuccessors(Frame frame, int[] workSet) {
int sz = callerBlocks.size();
- for(int label = callerBlocks.nextSetBit(0); label >= 0
- ; label = callerBlocks.nextSetBit(label+1)) {
-
+ for (int label = callerBlocks.nextSetBit(0); label >= 0;
+ label = callerBlocks.nextSetBit(label+1)) {
BasicBlock subCaller = labelToBlock(label);
int succLabel = subCaller.getSuccessors().get(0);
@@ -1399,9 +1398,8 @@ public final class Ropper {
*/
int newSubStartLabel = mapOrAllocateLabel(subroutineStart);
- for(int label = workList.nextSetBit(0); label >= 0
- ; label = workList.nextSetBit(0)) {
-
+ for (int label = workList.nextSetBit(0); label >= 0;
+ label = workList.nextSetBit(0)) {
workList.clear(label);
int newLabel = origLabelToCopiedLabel.get(label);
@@ -1421,7 +1419,8 @@ public final class Ropper {
addOrReplaceBlockNoDelete(
new BasicBlock(b.getLabel(), b.getInsns(),
IntList.makeImmutable (newSubStartLabel),
- newSubStartLabel), labelToSubroutines.get(b.getLabel()));
+ newSubStartLabel),
+ labelToSubroutines.get(b.getLabel()));
}
/**
diff --git a/dx/src/com/android/dx/cf/direct/ClassPathOpener.java b/dx/src/com/android/dx/cf/direct/ClassPathOpener.java
index fd5546fce..927e9bd68 100644
--- a/dx/src/com/android/dx/cf/direct/ClassPathOpener.java
+++ b/dx/src/com/android/dx/cf/direct/ClassPathOpener.java
@@ -220,8 +220,7 @@ public class ClassPathOpener {
consumer.onProcessArchiveStart(file);
- for (ZipEntry one: entriesList) {
-
+ for (ZipEntry one : entriesList) {
if (one.isDirectory()) {
continue;
}
diff --git a/dx/src/com/android/dx/command/annotool/AnnotationLister.java b/dx/src/com/android/dx/command/annotool/AnnotationLister.java
index 0bd101e0d..d3fb27c42 100644
--- a/dx/src/com/android/dx/command/annotool/AnnotationLister.java
+++ b/dx/src/com/android/dx/command/annotool/AnnotationLister.java
@@ -37,7 +37,6 @@ import java.util.HashSet;
* by the {@code Main.Arguments} instance.
*/
class AnnotationLister {
-
/**
* The string name of the pseudo-class that
* contains package-wide annotations
@@ -59,7 +58,7 @@ class AnnotationLister {
/** Processes based on configuration specified in constructor. */
void process() {
- for (String path: args.files) {
+ for (String path : args.files) {
ClassPathOpener opener;
opener = new ClassPathOpener(path, true,
@@ -147,7 +146,7 @@ class AnnotationLister {
return;
}
- for (Annotation anAnn: ann.getAnnotations().getAnnotations()) {
+ for (Annotation anAnn : ann.getAnnotations().getAnnotations()) {
String annClassName
= anAnn.getType().getClassType().getClassName();
if (args.aclass.equals(annClassName)) {
@@ -181,7 +180,7 @@ class AnnotationLister {
}
- for (Annotation anAnn: ann.getAnnotations().getAnnotations()) {
+ for (Annotation anAnn : ann.getAnnotations().getAnnotations()) {
String annClassName
= anAnn.getType().getClassType().getClassName();
if (args.aclass.equals(annClassName)) {
@@ -198,7 +197,7 @@ class AnnotationLister {
* @param packageName {@code non-null;} name of package
*/
private void printMatchPackage(String packageName) {
- for(Main.PrintType pt: args.printTypes) {
+ for (Main.PrintType pt : args.printTypes) {
switch (pt) {
case CLASS:
case INNERCLASS:
@@ -219,11 +218,12 @@ class AnnotationLister {
* @param cf {@code non-null;} matching class
*/
private void printMatch(DirectClassFile cf) {
- for(Main.PrintType pt: args.printTypes) {
+ for (Main.PrintType pt : args.printTypes) {
switch (pt) {
case CLASS:
String classname;
- classname = cf.getThisClass().getClassType().getClassName();
+ classname =
+ cf.getThisClass().getClassType().getClassName();
classname = classname.replace('/','.');
System.out.println(classname);
break;
diff --git a/dx/src/com/android/dx/command/annotool/Main.java b/dx/src/com/android/dx/command/annotool/Main.java
index 4f1d9a40b..9fd1ac57a 100644
--- a/dx/src/com/android/dx/command/annotool/Main.java
+++ b/dx/src/com/android/dx/command/annotool/Main.java
@@ -87,17 +87,18 @@ public class Main {
String argParam = arg.substring(arg.indexOf('=') + 1);
try {
- for (String p: argParam.split(",")) {
+ for (String p : argParam.split(",")) {
eTypes.add(ElementType.valueOf(p.toUpperCase()));
}
} catch (IllegalArgumentException ex) {
- throw new InvalidArgumentException("invalid --element");
+ throw new InvalidArgumentException(
+ "invalid --element");
}
} else if (arg.startsWith("--print=")) {
String argParam = arg.substring(arg.indexOf('=') + 1);
try {
- for (String p: argParam.split(",")) {
+ for (String p : argParam.split(",")) {
printTypes.add(PrintType.valueOf(p.toUpperCase()));
}
} catch (IllegalArgumentException ex) {
diff --git a/dx/src/com/android/dx/command/dump/SsaDumper.java b/dx/src/com/android/dx/command/dump/SsaDumper.java
index e3dad46c6..e5e9d97db 100644
--- a/dx/src/com/android/dx/command/dump/SsaDumper.java
+++ b/dx/src/com/android/dx/command/dump/SsaDumper.java
@@ -134,7 +134,8 @@ public class SsaDumper extends BlockDumper {
BitSet preds = block.getPredecessors();
- for(int i=preds.nextSetBit(0); i>=0; i=preds.nextSetBit(i+1)) {
+ for (int i = preds.nextSetBit(0); i >= 0;
+ i = preds.nextSetBit(i+1)) {
sb.append(" pred ");
sb.append(Hex.u2(ssaMeth.blockIndexToRopLabel(i)));
sb.append('\n');
@@ -143,7 +144,7 @@ public class SsaDumper extends BlockDumper {
sb.append(" live in:" + block.getLiveInRegs());
sb.append("\n");
- for (SsaInsn insn: block.getInsns()) {
+ for (SsaInsn insn : block.getInsns()) {
sb.append(" ");
sb.append(insn.toHuman());
sb.append('\n');
diff --git a/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java b/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
index 3f722eac7..e4bed6567 100644
--- a/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
+++ b/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
@@ -392,7 +392,7 @@ public final class DebugInfoEncoder {
* entry for the 'this' pointer.
*/
if (!isStatic) {
- for (LocalList.Entry arg: methodArgs) {
+ for (LocalList.Entry arg : methodArgs) {
if (curParam == arg.getRegister()) {
lastEntryForReg[curParam] = arg;
break;
@@ -420,7 +420,7 @@ public final class DebugInfoEncoder {
mark = output.getCursor();
- for (LocalList.Entry arg: methodArgs) {
+ for (LocalList.Entry arg : methodArgs) {
if (curParam == arg.getRegister()) {
found = arg;
diff --git a/dx/src/com/android/dx/ssa/DeadCodeRemover.java b/dx/src/com/android/dx/ssa/DeadCodeRemover.java
index 4ee036754..ec960b824 100644
--- a/dx/src/com/android/dx/ssa/DeadCodeRemover.java
+++ b/dx/src/com/android/dx/ssa/DeadCodeRemover.java
@@ -101,7 +101,6 @@ public class DeadCodeRemover {
int sz = sources.size();
for (int i = 0; i < sz; i++) {
-
// Delete this insn from all usage lists.
RegisterSpec source = sources.get(i);
useList[source.getReg()].remove(insnS);
@@ -153,7 +152,7 @@ public class DeadCodeRemover {
// This register is only used in operations that have no side effect.
set.set(regV);
- for (SsaInsn use: useList[regV]) {
+ for (SsaInsn use : useList[regV]) {
RegisterSpec result = use.getResult();
if (result == null
diff --git a/dx/src/com/android/dx/ssa/DomFront.java b/dx/src/com/android/dx/ssa/DomFront.java
index 3b421844a..717d3b1ab 100644
--- a/dx/src/com/android/dx/ssa/DomFront.java
+++ b/dx/src/com/android/dx/ssa/DomFront.java
@@ -132,7 +132,7 @@ public class DomFront {
sb.append('{');
boolean comma = false;
- for (SsaBasicBlock child: node.getDomChildren()) {
+ for (SsaBasicBlock child : node.getDomChildren()) {
if (comma) {
sb.append(',');
}
diff --git a/dx/src/com/android/dx/ssa/SCCP.java b/dx/src/com/android/dx/ssa/SCCP.java
index 1d95da63c..650985ea4 100644
--- a/dx/src/com/android/dx/ssa/SCCP.java
+++ b/dx/src/com/android/dx/ssa/SCCP.java
@@ -102,11 +102,11 @@ public class SCCP {
*/
private void addUsersToWorklist(int reg, int latticeValue) {
if (latticeValue == VARYING) {
- for (SsaInsn insn: ssaMeth.getUseListForRegister(reg)) {
+ for (SsaInsn insn : ssaMeth.getUseListForRegister(reg)) {
varyingWorklist.add(insn);
}
} else {
- for (SsaInsn insn: ssaMeth.getUseListForRegister(reg)) {
+ for (SsaInsn insn : ssaMeth.getUseListForRegister(reg)) {
ssaWorklist.add(insn);
}
}
@@ -160,6 +160,7 @@ public class SCCP {
int phiResultValue = TOP;
Constant phiConstant = null;
int sourceSize = sources.size();
+
for (int i = 0; i < sourceSize; i++) {
int predBlockIndex = insn.predBlockIndexForSourcesIndex(i);
int sourceReg = sources.get(i).getReg();
@@ -194,7 +195,7 @@ public class SCCP {
* @param block Block to visit
*/
private void simulateBlock(SsaBasicBlock block) {
- for (SsaInsn insn: block.getInsns()) {
+ for (SsaInsn insn : block.getInsns()) {
if (insn instanceof PhiInsn) {
simulatePhi((PhiInsn) insn);
} else {
@@ -464,7 +465,7 @@ public class SCCP {
* Update the sources RegisterSpec's of all non-move uses.
* These will be used in later steps.
*/
- for(SsaInsn insn: ssaMeth.getUseListForRegister(reg)) {
+ for (SsaInsn insn : ssaMeth.getUseListForRegister(reg)) {
if (insn.isPhiOrMove()) {
continue;
}
@@ -478,7 +479,6 @@ public class SCCP {
RegisterSpec newSpec
= spec.withType((TypedConstant)latticeConstants[reg]);
-
nInsn.changeOneSource(index, newSpec);
}
}
diff --git a/dx/src/com/android/dx/ssa/SsaBasicBlock.java b/dx/src/com/android/dx/ssa/SsaBasicBlock.java
index 6b768e839..7b78c46ea 100644
--- a/dx/src/com/android/dx/ssa/SsaBasicBlock.java
+++ b/dx/src/com/android/dx/ssa/SsaBasicBlock.java
@@ -461,7 +461,7 @@ public final class SsaBasicBlock {
// Update us
for (int i = successorList.size() - 1 ; i >= 0; i--) {
- if(successorList.get(i) == other.index) {
+ if (successorList.get(i) == other.index) {
successorList.set(i, newSucc.index);
}
}
@@ -499,7 +499,7 @@ public final class SsaBasicBlock {
}
for (int i = successorList.size() - 1 ; i >= 0; i--) {
- if(successorList.get(i) == oldIndex) {
+ if (successorList.get(i) == oldIndex) {
successorList.set(i, newIndex);
}
}
@@ -885,7 +885,7 @@ public final class SsaBasicBlock {
// Does the move-exception result reg interfere with the
// phi moves?
- for(SsaInsn insn: toSchedule) {
+ for (SsaInsn insn : toSchedule) {
if (insn.isResultReg(moveExceptionResult)
|| insn.isRegASource(moveExceptionResult)) {
moveExceptionInterferes = true;
@@ -952,7 +952,7 @@ public final class SsaBasicBlock {
* @param visitor {@code non-null;} callback interface
*/
public void forEachInsn(SsaInsn.Visitor visitor) {
- for (SsaInsn insn: insns) {
+ for (SsaInsn insn : insns) {
insn.accept(visitor);
}
}
diff --git a/dx/src/com/android/dx/ssa/SsaConverter.java b/dx/src/com/android/dx/ssa/SsaConverter.java
index 8d31eef6b..252b1d578 100644
--- a/dx/src/com/android/dx/ssa/SsaConverter.java
+++ b/dx/src/com/android/dx/ssa/SsaConverter.java
@@ -212,8 +212,8 @@ public class SsaConverter {
// successors list is modified in loop below
BitSet successors = (BitSet)block.getSuccessors().clone();
- for(int j = successors.nextSetBit(0);
- j >= 0; j = successors.nextSetBit(j+1)) {
+ for (int j = successors.nextSetBit(0);
+ j >= 0; j = successors.nextSetBit(j+1)) {
SsaBasicBlock succ = blocks.get(j);
@@ -282,8 +282,7 @@ public class SsaConverter {
for (int bi = 0, s = ssaBlocks.size(); bi < s; bi++) {
SsaBasicBlock b = ssaBlocks.get(bi);
- for (SsaInsn insn: b.getInsns()) {
-
+ for (SsaInsn insn : b.getInsns()) {
RegisterSpec rs = insn.getResult();
if (rs != null) {
diff --git a/dx/src/com/android/dx/ssa/SsaMethod.java b/dx/src/com/android/dx/ssa/SsaMethod.java
index cc0d5b9ce..073e5153c 100644
--- a/dx/src/com/android/dx/ssa/SsaMethod.java
+++ b/dx/src/com/android/dx/ssa/SsaMethod.java
@@ -203,7 +203,7 @@ public final class SsaMethod {
blocks.add(exitBlock);
- for (SsaBasicBlock block: blocks) {
+ for (SsaBasicBlock block : blocks) {
block.exitBlockFixup(exitBlock);
}
@@ -348,7 +348,7 @@ public final class SsaMethod {
public int getCountReachableBlocks() {
int ret = 0;
- for (SsaBasicBlock b: blocks) {
+ for (SsaBasicBlock b : blocks) {
// Blocks that have been disconnected don't count.
if (b.isReachable()) {
ret++;
@@ -365,7 +365,7 @@ public final class SsaMethod {
*/
public void mapRegisters(RegisterMapper mapper) {
for (SsaBasicBlock block : getBlocks()) {
- for (SsaInsn insn: block.getInsns()) {
+ for (SsaInsn insn : block.getInsns()) {
insn.mapRegisters(mapper);
}
}
@@ -501,7 +501,7 @@ public final class SsaMethod {
RegisterSpecList sources = insn.getSources();
int szNew = sources.size();
- for(int i = 0; i < szNew; i++) {
+ for (int i = 0; i < szNew; i++) {
int reg = sources.get(i).getReg();
useList[reg].add(insn);
}
@@ -520,8 +520,9 @@ public final class SsaMethod {
if (oldSources == null) {
return;
}
+
int szNew = oldSources.size();
- for(int i = 0; i < szNew; i++) {
+ for (int i = 0; i < szNew; i++) {
if (!useList[oldSources.get(i).getReg()].remove(insn)) {
throw new RuntimeException("use not found");
}
@@ -657,7 +658,7 @@ public final class SsaMethod {
if (defn.getLocalAssignment() != null) return true;
// If not, is there a mark-local insn?
- for (SsaInsn use: getUseListForRegister(spec.getReg())) {
+ for (SsaInsn use : getUseListForRegister(spec.getReg())) {
Insn insn = use.getOriginalRopInsn();
if (insn != null
@@ -698,7 +699,7 @@ public final class SsaMethod {
* @param visitor {@code non-null;} callback interface
*/
public void forEachInsn(SsaInsn.Visitor visitor) {
- for (SsaBasicBlock block: blocks) {
+ for (SsaBasicBlock block : blocks) {
block.forEachInsn(visitor);
}
}
@@ -709,7 +710,7 @@ public final class SsaMethod {
*
*/
public void forEachPhiInsn(PhiInsn.Visitor v) {
- for (SsaBasicBlock block: blocks) {
+ for (SsaBasicBlock block : blocks) {
block.forEachPhiInsn(v);
}
}
@@ -794,7 +795,7 @@ public final class SsaMethod {
* @param deletedInsns {@code non-null;} insns to delete
*/
public void deleteInsns(Set<SsaInsn> deletedInsns) {
- for (SsaBasicBlock block: getBlocks()) {
+ for (SsaBasicBlock block : getBlocks()) {
ArrayList<SsaInsn> insns = block.getInsns();
for (int i = insns.size() - 1; i >= 0; i--) {
diff --git a/dx/src/com/android/dx/ssa/SsaRenamer.java b/dx/src/com/android/dx/ssa/SsaRenamer.java
index 9a9af3b51..10859f527 100644
--- a/dx/src/com/android/dx/ssa/SsaRenamer.java
+++ b/dx/src/com/android/dx/ssa/SsaRenamer.java
@@ -141,7 +141,8 @@ class SsaRenamer implements Runnable {
// Rename each block in dom-tree DFS order.
ssaMeth.forEachBlockDepthFirstDom(new SsaBasicBlock.Visitor() {
- public void visitBlock (SsaBasicBlock block, SsaBasicBlock unused) {
+ public void visitBlock (SsaBasicBlock block,
+ SsaBasicBlock unused) {
new BlockRenamer(block).process();
}
});
@@ -157,7 +158,7 @@ class SsaRenamer implements Runnable {
int[] versions = new int[ropRegCount];
int sz = ssaRegToRopReg.size();
- for(int i = 0; i < sz; i++) {
+ for (int i = 0; i < sz; i++) {
int ropReg = ssaRegToRopReg.get(i);
System.out.println(i +"\t" + ropReg + "["
+ versions[ropReg] + "]");
@@ -305,7 +306,7 @@ class SsaRenamer implements Runnable {
int reg = registerSpec.getReg();
// for debugging: assert that the mapped types are compatible
- if(DEBUG) {
+ if (DEBUG) {
RegisterSpec newVersion = currentMapping[reg];
if (newVersion.getBasicType() != Type.BT_VOID
&& registerSpec.getBasicFrameType()
@@ -358,7 +359,7 @@ class SsaRenamer implements Runnable {
// Store the start states for our dom children
boolean first = true;
- for (SsaBasicBlock child: block.getDomChildren()) {
+ for (SsaBasicBlock child : block.getDomChildren()) {
if (child != block) {
RegisterSpec[] childStart;
@@ -611,9 +612,7 @@ class SsaRenamer implements Runnable {
BitSet successors = block.getSuccessors();
for (int i = successors.nextSetBit(0); i >= 0;
i = successors.nextSetBit(i + 1)) {
-
SsaBasicBlock successor = ssaMeth.getBlocks().get(i);
-
successor.forEachPhiInsn(visitor);
}
}
diff --git a/dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java b/dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java
index e759fe609..43c29730a 100644
--- a/dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java
+++ b/dx/src/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java
@@ -150,13 +150,13 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
*/
private void printLocalVars() {
System.out.println("Printing local vars");
- for (Map.Entry<LocalItem, ArrayList<RegisterSpec>> e:
+ for (Map.Entry<LocalItem, ArrayList<RegisterSpec>> e :
localVariables.entrySet()) {
StringBuilder regs = new StringBuilder();
regs.append('{');
regs.append(' ');
- for(RegisterSpec reg: e.getValue()) {
+ for (RegisterSpec reg : e.getValue()) {
regs.append('v');
regs.append(reg.getReg());
regs.append(' ');
@@ -441,7 +441,7 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
* Handles all insns that want a register range for their sources.
*/
private void handleInvokeRangeInsns() {
- for(NormalSsaInsn insn : invokeRangeInsns) {
+ for (NormalSsaInsn insn : invokeRangeInsns) {
adjustAndMapSourceRangeRange(insn);
}
}
@@ -800,10 +800,9 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
* Now, insert any moves required
*/
- for (int i = resultMovesRequired.nextSetBit(0); i >= 0
- ; i = resultMovesRequired.nextSetBit(i+1)) {
- insn.changeOneSource(i,
- insertMoveBefore(insn, sources.get(i)));
+ for (int i = resultMovesRequired.nextSetBit(0); i >= 0;
+ i = resultMovesRequired.nextSetBit(i+1)) {
+ insn.changeOneSource(i, insertMoveBefore(insn, sources.get(i)));
}
return resultRangeStart;
@@ -938,9 +937,8 @@ public class FirstFitLocalCombiningAllocator extends RegisterAllocator {
* @return {@code null-ok;} associated local item or null
*/
private LocalItem getLocalItemForReg(int ssaReg) {
- for(Map.Entry<LocalItem, ArrayList<RegisterSpec>> entry:
- localVariables.entrySet()) {
-
+ for (Map.Entry<LocalItem, ArrayList<RegisterSpec>> entry :
+ localVariables.entrySet()) {
for (RegisterSpec spec : entry.getValue()) {
if (spec.getReg() == ssaReg) {
return entry.getKey();
diff --git a/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java b/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java
index 6d6065168..897cc578b 100644
--- a/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java
+++ b/dx/src/com/android/dx/ssa/back/LivenessAnalyzer.java
@@ -145,7 +145,7 @@ public class LivenessAnalyzer {
}
/**
- * From Appel algorithm 19.17
+ * From Appel algorithm 19.17.
*/
public void run() {
List<SsaInsn> useList = ssaMeth.getUseListForRegister(regV);
@@ -154,11 +154,11 @@ public class LivenessAnalyzer {
nextFunction = DONE;
if (insn instanceof PhiInsn) {
- // If s is a phi-function with V as it's ith argument
+ // If s is a phi-function with V as it's ith argument.
PhiInsn phi = (PhiInsn) insn;
- for (SsaBasicBlock pred: phi.predBlocksForReg(regV, ssaMeth)) {
-
+ for (SsaBasicBlock pred :
+ phi.predBlocksForReg(regV, ssaMeth)) {
blockN = pred;
nextFunction = LIVE_OUT_AT_BLOCK;
@@ -188,7 +188,7 @@ public class LivenessAnalyzer {
}
/**
- * "v is live-out at n"
+ * "v is live-out at n."
*/
private void liveOutAtBlock() {
if (! visitedBlocks.get(blockN.getIndex())) {
@@ -207,7 +207,7 @@ public class LivenessAnalyzer {
}
/**
- * "v is live-in at s"
+ * "v is live-in at s."
*/
private void liveInAtStatement() {
// if s is the first statement in block N
@@ -226,14 +226,14 @@ public class LivenessAnalyzer {
}
/**
- * "v is live-out at s"
+ * "v is live-out at s."
*/
private void liveOutAtStatement() {
SsaInsn statement = blockN.getInsns().get(statementIndex);
RegisterSpec rs = statement.getResult();
if (!statement.isResultReg(regV)) {
- if(rs != null) {
+ if (rs != null) {
interference.add(regV, rs.getReg());
}
nextFunction = LIVE_IN_AT_STATEMENT;