Issue #258 AS1/2 chained assignments

AS1/2 Detecting temporary registers
assignment spaces
This commit is contained in:
Jindra Pet��k
2013-07-31 22:21:50 +02:00
parent 25efe3793f
commit c63fd4ebd9
21 changed files with 193 additions and 30 deletions
@@ -640,7 +640,7 @@ public class AVM2Graph extends Graph {
}
@Override
protected void finalProcess(List<GraphTargetItem> list, int level) {
protected void finalProcess(List<GraphTargetItem> list, int level, List<Object> localData) {
if (level == 0) {
if (!list.isEmpty()) {
if (list.get(list.size() - 1) instanceof ReturnVoidAVM2Item) {
@@ -38,7 +38,7 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A
@Override
public String toString(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames);
return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames);
}
@Override
@@ -36,7 +36,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig
@Override
public String toString(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
return hilight(localRegName(localRegNames, regIndex) + "=") + value.toString(constants, localRegNames, fullyQualifiedNames);
return hilight(localRegName(localRegNames, regIndex) + " = ") + value.toString(constants, localRegNames, fullyQualifiedNames);
}
@Override
@@ -44,7 +44,7 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As
@Override
public String toString(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames);
return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames);
}
@Override
@@ -46,7 +46,7 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign
@Override
public String toString(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
return getName(constants, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames);
return getName(constants, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames);
}
public String getName(ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
@@ -48,7 +48,7 @@ public class SetSuperAVM2Item extends AVM2Item {
if (Highlighting.stripHilights(calee).equals("this.")) {
calee = "";
}
return calee + hilight("super.") + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames);
return calee + hilight("super.") + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames);
}
@Override