mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 20:35:34 +00:00
constantpool: arrays=>lists, accessing constant is synchronized (parallel decompiling thown ArrayOutOfBound exceptions, because the constantpool was modified in another thread)
This commit is contained in:
@@ -123,8 +123,8 @@ public class ABC {
|
||||
|
||||
public Set<Integer> getNsStringUsages() {
|
||||
Set<Integer> ret = new HashSet<>();
|
||||
for (int n = 1; n < constants.constant_namespace.length; n++) {
|
||||
ret.add(constants.constant_namespace[n].name_index);
|
||||
for (int n = 1; n < constants.getNamespaceCount(); n++) {
|
||||
ret.add(constants.getNamespace(n).name_index);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class ABC {
|
||||
|
||||
private void getStringUsageTypes(Map<Integer, String> ret, Traits traits, boolean classesOnly) {
|
||||
for (Trait t : traits.traits) {
|
||||
int strIndex = constants.constant_multiname[t.name_index].name_index;
|
||||
int strIndex = constants.getMultiname(t.name_index).name_index;
|
||||
String usageType = "";
|
||||
if (t instanceof TraitClass) {
|
||||
TraitClass tc = (TraitClass) t;
|
||||
@@ -165,10 +165,10 @@ public class ABC {
|
||||
getStringUsageTypes(ret, instance_info[tc.class_info].instance_traits, classesOnly);
|
||||
|
||||
if (instance_info[tc.class_info].name_index != 0) {
|
||||
setStringUsageType(ret, constants.constant_multiname[instance_info[tc.class_info].name_index].name_index, "class");
|
||||
setStringUsageType(ret, constants.getMultiname(instance_info[tc.class_info].name_index).name_index, "class");
|
||||
}
|
||||
if (instance_info[tc.class_info].super_index != 0) {
|
||||
setStringUsageType(ret, constants.constant_multiname[instance_info[tc.class_info].super_index].name_index, "class");
|
||||
setStringUsageType(ret, constants.getMultiname(instance_info[tc.class_info].super_index).name_index, "class");
|
||||
}
|
||||
|
||||
usageType = "class";
|
||||
@@ -211,17 +211,17 @@ public class ABC {
|
||||
}
|
||||
|
||||
public void renameMultiname(int multinameIndex, String newname) {
|
||||
if (multinameIndex <= 0 || multinameIndex >= constants.constant_multiname.length) {
|
||||
if (multinameIndex <= 0 || multinameIndex >= constants.getMultinameCount()) {
|
||||
throw new IllegalArgumentException("Multiname with index " + multinameIndex + " does not exist");
|
||||
}
|
||||
Set<Integer> stringUsages = getStringUsages();
|
||||
Set<Integer> namespaceUsages = getNsStringUsages();
|
||||
int strIndex = constants.constant_multiname[multinameIndex].name_index;
|
||||
int strIndex = constants.getMultiname(multinameIndex).name_index;
|
||||
if (stringUsages.contains(strIndex) || namespaceUsages.contains(strIndex)) { //name is used elsewhere as string literal
|
||||
strIndex = constants.getStringId(newname, true);
|
||||
constants.constant_multiname[multinameIndex].name_index = strIndex;
|
||||
constants.getMultiname(multinameIndex).name_index = strIndex;
|
||||
} else {
|
||||
constants.constant_string[strIndex] = newname;
|
||||
constants.setString(strIndex, newname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,29 +234,29 @@ public class ABC {
|
||||
for (int i = 0; i < instance_info.length; i++) {
|
||||
informListeners("deobfuscate", "class " + i + "/" + instance_info.length);
|
||||
if (instance_info[i].name_index != 0) {
|
||||
constants.constant_multiname[instance_info[i].name_index].name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.constant_multiname[instance_info[i].name_index].name_index, true, renameType);
|
||||
if (constants.constant_multiname[instance_info[i].name_index].namespace_index != 0) {
|
||||
constants.constant_namespace[constants.constant_multiname[instance_info[i].name_index].namespace_index].name_index =
|
||||
deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.constant_namespace[constants.constant_multiname[instance_info[i].name_index].namespace_index].name_index, renameType);
|
||||
constants.getMultiname(instance_info[i].name_index).name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(instance_info[i].name_index).name_index, true, renameType);
|
||||
if (constants.getMultiname(instance_info[i].name_index).namespace_index != 0) {
|
||||
constants.getNamespace(constants.getMultiname(instance_info[i].name_index).namespace_index).name_index =
|
||||
deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.getNamespace(constants.getMultiname(instance_info[i].name_index).namespace_index).name_index, renameType);
|
||||
}
|
||||
}
|
||||
if (instance_info[i].super_index != 0) {
|
||||
constants.constant_multiname[instance_info[i].super_index].name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.constant_multiname[instance_info[i].super_index].name_index, true, renameType);
|
||||
constants.getMultiname(instance_info[i].super_index).name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(instance_info[i].super_index).name_index, true, renameType);
|
||||
}
|
||||
}
|
||||
if (classesOnly) {
|
||||
return;
|
||||
}
|
||||
for (int i = 1; i < constants.constant_multiname.length; i++) {
|
||||
informListeners("deobfuscate", "name " + i + "/" + constants.constant_multiname.length);
|
||||
constants.constant_multiname[i].name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.constant_multiname[i].name_index, false, renameType);
|
||||
for (int i = 1; i < constants.getMultinameCount(); i++) {
|
||||
informListeners("deobfuscate", "name " + i + "/" + constants.getMultinameCount());
|
||||
constants.getMultiname(i).name_index = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(i).name_index, false, renameType);
|
||||
}
|
||||
for (int i = 1; i < constants.constant_namespace.length; i++) {
|
||||
informListeners("deobfuscate", "namespace " + i + "/" + constants.constant_namespace.length);
|
||||
if (constants.constant_namespace[i].kind != Namespace.KIND_PACKAGE) { //only packages
|
||||
for (int i = 1; i < constants.getNamespaceCount(); i++) {
|
||||
informListeners("deobfuscate", "namespace " + i + "/" + constants.getNamespaceCount());
|
||||
if (constants.getNamespace(i).kind != Namespace.KIND_PACKAGE) { //only packages
|
||||
continue;
|
||||
}
|
||||
constants.constant_namespace[i].name_index = deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.constant_namespace[i].name_index, renameType);
|
||||
constants.getNamespace(i).name_index = deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.getNamespace(i).name_index, renameType);
|
||||
}
|
||||
|
||||
//process reflection using getDefinitionByName too
|
||||
@@ -265,12 +265,12 @@ public class ABC {
|
||||
if (body.code.code.get(ip).definition instanceof CallPropertyIns) {
|
||||
int mIndex = body.code.code.get(ip).operands[0];
|
||||
if (mIndex > 0) {
|
||||
Multiname m = constants.constant_multiname[mIndex];
|
||||
Multiname m = constants.getMultiname(mIndex);
|
||||
if (m.getNameWithNamespace(constants).equals("flash.utils.getDefinitionByName")) {
|
||||
if (ip > 0) {
|
||||
if (body.code.code.get(ip - 1).definition instanceof PushStringIns) {
|
||||
int strIndex = body.code.code.get(ip - 1).operands[0];
|
||||
String fullname = constants.constant_string[strIndex];
|
||||
String fullname = constants.getString(strIndex);
|
||||
String pkg = "";
|
||||
String name = fullname;
|
||||
if (fullname.contains(".")) {
|
||||
@@ -280,11 +280,11 @@ public class ABC {
|
||||
if (!pkg.isEmpty()) {
|
||||
int pkgStrIndex = constants.getStringId(pkg, true);
|
||||
pkgStrIndex = deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, pkgStrIndex, renameType);
|
||||
pkg = constants.constant_string[pkgStrIndex];
|
||||
pkg = constants.getString(pkgStrIndex);
|
||||
}
|
||||
int nameStrIndex = constants.getStringId(name, true);
|
||||
nameStrIndex = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, nameStrIndex, true, renameType);
|
||||
name = constants.constant_string[nameStrIndex];
|
||||
name = constants.getString(nameStrIndex);
|
||||
String fullChanged = "";
|
||||
if (!pkg.isEmpty()) {
|
||||
fullChanged = pkg + ".";
|
||||
@@ -309,64 +309,70 @@ public class ABC {
|
||||
constants = new ConstantPool();
|
||||
//constant integers
|
||||
int constant_int_pool_count = ais.readU30();
|
||||
constants.constant_int = new long[constant_int_pool_count];
|
||||
constants.constant_int = new ArrayList<>(constant_int_pool_count);
|
||||
constants.addInt(0);
|
||||
for (int i = 1; i < constant_int_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_int[i] = ais.readS32();
|
||||
constants.addInt(ais.readS32());
|
||||
}
|
||||
|
||||
//constant unsigned integers
|
||||
int constant_uint_pool_count = ais.readU30();
|
||||
constants.constant_uint = new long[constant_uint_pool_count];
|
||||
constants.constant_uint = new ArrayList<>(constant_uint_pool_count);
|
||||
constants.addUInt(0);
|
||||
for (int i = 1; i < constant_uint_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_uint[i] = ais.readU32();
|
||||
constants.addUInt(ais.readU32());
|
||||
}
|
||||
|
||||
//constant double
|
||||
int constant_double_pool_count = ais.readU30();
|
||||
constants.constant_double = new double[constant_double_pool_count];
|
||||
constants.constant_double = new ArrayList<>(constant_double_pool_count);
|
||||
constants.addDouble(0);
|
||||
for (int i = 1; i < constant_double_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_double[i] = ais.readDouble();
|
||||
constants.addDouble(ais.readDouble());
|
||||
}
|
||||
|
||||
|
||||
//constant decimal
|
||||
if (minor_version >= MINORwithDECIMAL) {
|
||||
int constant_decimal_pool_count = ais.readU30();
|
||||
constants.constant_decimal = new Decimal[constant_decimal_pool_count];
|
||||
constants.constant_decimal = new ArrayList<>(constant_decimal_pool_count);
|
||||
constants.addDecimal(null);
|
||||
for (int i = 1; i < constant_decimal_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_decimal[i] = ais.readDecimal();
|
||||
constants.addDecimal(ais.readDecimal());
|
||||
}
|
||||
} else {
|
||||
constants.constant_decimal = new Decimal[0];
|
||||
constants.constant_decimal = new ArrayList<>(0);
|
||||
}
|
||||
|
||||
//constant string
|
||||
int constant_string_pool_count = ais.readU30();
|
||||
constants.constant_string = new String[constant_string_pool_count];
|
||||
constants.constant_string = new ArrayList<>(constant_string_pool_count);
|
||||
stringOffsets = new long[constant_string_pool_count];
|
||||
constants.constant_string[0] = "";
|
||||
constants.addString("");
|
||||
for (int i = 1; i < constant_string_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
long pos = ais.getPosition();
|
||||
constants.constant_string[i] = ais.readString();
|
||||
constants.addString(ais.readString());
|
||||
stringOffsets[i] = pos;
|
||||
}
|
||||
|
||||
//constant namespace
|
||||
int constant_namespace_pool_count = ais.readU30();
|
||||
constants.constant_namespace = new Namespace[constant_namespace_pool_count];
|
||||
constants.constant_namespace = new ArrayList<>(constant_namespace_pool_count);
|
||||
constants.addNamespace(null);
|
||||
for (int i = 1; i < constant_namespace_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_namespace[i] = ais.readNamespace();
|
||||
constants.addNamespace(ais.readNamespace());
|
||||
}
|
||||
|
||||
//constant namespace set
|
||||
int constant_namespace_set_pool_count = ais.readU30();
|
||||
constants.constant_namespace_set = new NamespaceSet[constant_namespace_set_pool_count];
|
||||
constants.constant_namespace_set = new ArrayList<>(constant_namespace_set_pool_count);
|
||||
constants.addNamespaceSet(null);
|
||||
for (int i = 1; i < constant_namespace_set_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_namespace_set[i] = new NamespaceSet();
|
||||
constants.addNamespaceSet(new NamespaceSet());
|
||||
int namespace_count = ais.readU30();
|
||||
constants.constant_namespace_set[i].namespaces = new int[namespace_count];
|
||||
constants.getNamespaceSet(i).namespaces = new int[namespace_count];
|
||||
for (int j = 0; j < namespace_count; j++) {
|
||||
constants.constant_namespace_set[i].namespaces[j] = ais.readU30();
|
||||
constants.getNamespaceSet(i).namespaces[j] = ais.readU30();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,9 +382,10 @@ public class ABC {
|
||||
|
||||
//constant multiname
|
||||
int constant_multiname_pool_count = ais.readU30();
|
||||
constants.constant_multiname = new Multiname[constant_multiname_pool_count];
|
||||
constants.constant_multiname = new ArrayList<>(constant_multiname_pool_count);
|
||||
constants.addMultiname(null);
|
||||
for (int i = 1; i < constant_multiname_pool_count; i++) { //index 0 not used. Values 1..n-1
|
||||
constants.constant_multiname[i] = ais.readMultiname();
|
||||
constants.addMultiname(ais.readMultiname());
|
||||
}
|
||||
|
||||
|
||||
@@ -471,48 +478,48 @@ public class ABC {
|
||||
aos.writeU16(minor_version);
|
||||
aos.writeU16(major_version);
|
||||
|
||||
aos.writeU30(constants.constant_int.length);
|
||||
for (int i = 1; i < constants.constant_int.length; i++) {
|
||||
aos.writeS32(constants.constant_int[i]);
|
||||
aos.writeU30(constants.getIntCount());
|
||||
for (int i = 1; i < constants.getIntCount(); i++) {
|
||||
aos.writeS32(constants.getInt(i));
|
||||
}
|
||||
aos.writeU30(constants.constant_uint.length);
|
||||
for (int i = 1; i < constants.constant_uint.length; i++) {
|
||||
aos.writeU32(constants.constant_uint[i]);
|
||||
aos.writeU30(constants.getUIntCount());
|
||||
for (int i = 1; i < constants.getUIntCount(); i++) {
|
||||
aos.writeU32(constants.getUInt(i));
|
||||
}
|
||||
|
||||
aos.writeU30(constants.constant_double.length);
|
||||
for (int i = 1; i < constants.constant_double.length; i++) {
|
||||
aos.writeDouble(constants.constant_double[i]);
|
||||
aos.writeU30(constants.getDoubleCount());
|
||||
for (int i = 1; i < constants.getDoubleCount(); i++) {
|
||||
aos.writeDouble(constants.getDouble(i));
|
||||
}
|
||||
|
||||
if (minor_version >= MINORwithDECIMAL) {
|
||||
aos.writeU30(constants.constant_decimal.length);
|
||||
for (int i = 1; i < constants.constant_decimal.length; i++) {
|
||||
aos.writeDecimal(constants.constant_decimal[i]);
|
||||
aos.writeU30(constants.getDecimalCount());
|
||||
for (int i = 1; i < constants.getDecimalCount(); i++) {
|
||||
aos.writeDecimal(constants.getDecimal(i));
|
||||
}
|
||||
}
|
||||
|
||||
aos.writeU30(constants.constant_string.length);
|
||||
for (int i = 1; i < constants.constant_string.length; i++) {
|
||||
aos.writeString(constants.constant_string[i]);
|
||||
aos.writeU30(constants.getStringCount());
|
||||
for (int i = 1; i < constants.getStringCount(); i++) {
|
||||
aos.writeString(constants.getString(i));
|
||||
}
|
||||
|
||||
aos.writeU30(constants.constant_namespace.length);
|
||||
for (int i = 1; i < constants.constant_namespace.length; i++) {
|
||||
aos.writeNamespace(constants.constant_namespace[i]);
|
||||
aos.writeU30(constants.getNamespaceCount());
|
||||
for (int i = 1; i < constants.getNamespaceCount(); i++) {
|
||||
aos.writeNamespace(constants.getNamespace(i));
|
||||
}
|
||||
|
||||
aos.writeU30(constants.constant_namespace_set.length);
|
||||
for (int i = 1; i < constants.constant_namespace_set.length; i++) {
|
||||
aos.writeU30(constants.constant_namespace_set[i].namespaces.length);
|
||||
for (int j = 0; j < constants.constant_namespace_set[i].namespaces.length; j++) {
|
||||
aos.writeU30(constants.constant_namespace_set[i].namespaces[j]);
|
||||
aos.writeU30(constants.getNamespaceSetCount());
|
||||
for (int i = 1; i < constants.getNamespaceSetCount(); i++) {
|
||||
aos.writeU30(constants.getNamespaceSet(i).namespaces.length);
|
||||
for (int j = 0; j < constants.getNamespaceSet(i).namespaces.length; j++) {
|
||||
aos.writeU30(constants.getNamespaceSet(i).namespaces[j]);
|
||||
}
|
||||
}
|
||||
|
||||
aos.writeU30(constants.constant_multiname.length);
|
||||
for (int i = 1; i < constants.constant_multiname.length; i++) {
|
||||
aos.writeMultiname(constants.constant_multiname[i]);
|
||||
aos.writeU30(constants.getMultinameCount());
|
||||
for (int i = 1; i < constants.getMultinameCount(); i++) {
|
||||
aos.writeMultiname(constants.getMultiname(i));
|
||||
}
|
||||
|
||||
aos.writeU30(method_info.length);
|
||||
@@ -584,7 +591,7 @@ public class ABC {
|
||||
|
||||
public MethodBody findBodyByClassAndName(String className, String methodName) {
|
||||
for (int i = 0; i < instance_info.length; i++) {
|
||||
if (className.equals(constants.constant_multiname[instance_info[i].name_index].getName(constants, new ArrayList<String>()))) {
|
||||
if (className.equals(constants.getMultiname(instance_info[i].name_index).getName(constants, new ArrayList<String>()))) {
|
||||
for (Trait t : instance_info[i].instance_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
|
||||
@@ -601,7 +608,7 @@ public class ABC {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < class_info.length; i++) {
|
||||
if (className.equals(constants.constant_multiname[instance_info[i].name_index].getName(constants, new ArrayList<String>()))) {
|
||||
if (className.equals(constants.getMultiname(instance_info[i].name_index).getName(constants, new ArrayList<String>()))) {
|
||||
for (Trait t : class_info[i].static_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
|
||||
@@ -702,8 +709,8 @@ public class ABC {
|
||||
if (t instanceof TraitSlotConst) {
|
||||
TraitSlotConst s = ((TraitSlotConst) t);
|
||||
if (s.isNamespace()) {
|
||||
String key = constants.constant_namespace[s.value_index].getName(constants);
|
||||
String val = constants.constant_multiname[s.name_index].getNameWithNamespace(constants);
|
||||
String key = constants.getNamespace(s.value_index).getName(constants);
|
||||
String val = constants.getMultiname(s.name_index).getNameWithNamespace(constants);
|
||||
namespaceMap.put(key, val);
|
||||
}
|
||||
}
|
||||
@@ -820,8 +827,8 @@ public class ABC {
|
||||
ret += c;
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < constants.constant_string.length; i++) {
|
||||
if (constants.constant_string[i].equals(ret)) {
|
||||
for (int i = 1; i < constants.getStringCount(); i++) {
|
||||
if (constants.getString(i).equals(ret)) {
|
||||
exists = true;
|
||||
rndSize += 1;
|
||||
continue loopfoo;
|
||||
@@ -879,7 +886,7 @@ public class ABC {
|
||||
if (strIndex <= 0) {
|
||||
return strIndex;
|
||||
}
|
||||
String s = constants.constant_string[strIndex];
|
||||
String s = constants.getString(strIndex);
|
||||
if (builtInNs(s) != null) {
|
||||
return strIndex;
|
||||
}
|
||||
@@ -887,7 +894,7 @@ public class ABC {
|
||||
if (!isValid) {
|
||||
String newName;
|
||||
if (namesMap.containsKey(s)) {
|
||||
newName = constants.constant_string[strIndex] = namesMap.get(s);
|
||||
newName = constants.setString(strIndex, namesMap.get(s));
|
||||
} else {
|
||||
String[] parts = null;
|
||||
if (s.contains(".")) {
|
||||
@@ -912,7 +919,7 @@ public class ABC {
|
||||
if (stringUsages.contains(strIndex)) {
|
||||
strIndex = constants.addString(newName);
|
||||
} else {
|
||||
constants.constant_string[strIndex] = newName;
|
||||
constants.setString(strIndex, newName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -923,7 +930,7 @@ public class ABC {
|
||||
if (strIndex <= 0) {
|
||||
return strIndex;
|
||||
}
|
||||
String s = constants.constant_string[strIndex];
|
||||
String s = constants.getString(strIndex);
|
||||
boolean isValid = true;
|
||||
if (isReserved(s)) {
|
||||
isValid = false;
|
||||
@@ -950,14 +957,14 @@ public class ABC {
|
||||
if (namesMap.containsKey(s)) {
|
||||
newname = namesMap.get(s);
|
||||
} else {
|
||||
newname = fooString(namesMap, constants.constant_string[strIndex], firstUppercase, DEFAULT_FOO_SIZE, stringUsageTypes.get(strIndex), renameType);
|
||||
newname = fooString(namesMap, constants.getString(strIndex), firstUppercase, DEFAULT_FOO_SIZE, stringUsageTypes.get(strIndex), renameType);
|
||||
}
|
||||
if (stringUsages.contains(strIndex) || namespaceUsages.contains(strIndex)) { //this name is already referenced as String
|
||||
strIndex = constants.addString(s); //add new index
|
||||
}
|
||||
constants.constant_string[strIndex] = newname;
|
||||
constants.setString(strIndex, newname);
|
||||
if (!namesMap.containsKey(s)) {
|
||||
namesMap.put(s, constants.constant_string[strIndex]);
|
||||
namesMap.put(s, constants.getString(strIndex));
|
||||
}
|
||||
}
|
||||
return strIndex;
|
||||
@@ -1039,13 +1046,13 @@ public class ABC {
|
||||
findMultinameUsageInTraits(class_info[c].static_traits, multinameIndex, true, c, ret, -1);
|
||||
}
|
||||
loopm:
|
||||
for (int m = 1; m < constants.constant_multiname.length; m++) {
|
||||
if (constants.constant_multiname[m].kind == Multiname.TYPENAME) {
|
||||
if (constants.constant_multiname[m].qname_index == multinameIndex) {
|
||||
for (int m = 1; m < constants.getMultinameCount(); m++) {
|
||||
if (constants.getMultiname(m).kind == Multiname.TYPENAME) {
|
||||
if (constants.getMultiname(m).qname_index == multinameIndex) {
|
||||
ret.add(new TypeNameMultinameUsage(m));
|
||||
continue;
|
||||
}
|
||||
for (int mp : constants.constant_multiname[m].params) {
|
||||
for (int mp : constants.getMultiname(m).params) {
|
||||
if (mp == multinameIndex) {
|
||||
ret.add(new TypeNameMultinameUsage(m));
|
||||
continue loopm;
|
||||
@@ -1095,7 +1102,7 @@ public class ABC {
|
||||
|
||||
public int findClassByName(String name) {
|
||||
for (int c = 0; c < instance_info.length; c++) {
|
||||
String s = constants.constant_multiname[instance_info[c].name_index].getNameWithNamespace(constants);
|
||||
String s = constants.getMultiname(instance_info[c].name_index).getNameWithNamespace(constants);
|
||||
if (name.equals(s)) {
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ public class AVM2Code implements Serializable {
|
||||
writer.appendNoHilight("null");
|
||||
} else {
|
||||
writer.appendNoHilight("\"");
|
||||
writer.appendNoHilight(constants.constant_string[n]);
|
||||
writer.appendNoHilight(constants.getString(n));
|
||||
writer.appendNoHilight("\"");
|
||||
}
|
||||
writer.newLine();
|
||||
@@ -871,10 +871,10 @@ public class AVM2Code implements Serializable {
|
||||
offsets.add((long) body.exceptions[e].target);
|
||||
|
||||
writer.appendNoHilight(" type ");
|
||||
writer.hilightSpecial(body.exceptions[e].type_index == 0 ? "null" : constants.constant_multiname[body.exceptions[e].type_index].toString(constants, new ArrayList<String>()), "try.type", e);
|
||||
writer.hilightSpecial(body.exceptions[e].type_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].type_index).toString(constants, new ArrayList<String>()), "try.type", e);
|
||||
|
||||
writer.appendNoHilight(" name ");
|
||||
writer.hilightSpecial(body.exceptions[e].name_index == 0 ? "null" : constants.constant_multiname[body.exceptions[e].name_index].toString(constants, new ArrayList<String>()), "try.name", e);
|
||||
writer.hilightSpecial(body.exceptions[e].name_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].name_index).toString(constants, new ArrayList<String>()), "try.name", e);
|
||||
writer.newLine();
|
||||
}
|
||||
|
||||
@@ -1039,7 +1039,7 @@ public class AVM2Code implements Serializable {
|
||||
for (AVM2Instruction ins : code) {
|
||||
if (ins.definition instanceof DebugIns) {
|
||||
if (ins.operands[0] == 1) {
|
||||
localRegNames.put(ins.operands[2] + 1, abc.constants.constant_string[ins.operands[1]]);
|
||||
localRegNames.put(ins.operands[2] + 1, abc.constants.getString(ins.operands[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1300,7 +1300,7 @@ public class AVM2Code implements Serializable {
|
||||
if (code.get(ip + plus + 2).definition instanceof SwapIns) {
|
||||
if (code.get(ip + plus + 4).definition instanceof PopScopeIns) {
|
||||
if (code.get(ip + plus + 3).definition instanceof SetPropertyIns) {
|
||||
functionName = abc.constants.constant_multiname[code.get(ip + plus + 3).operands[0]].getName(constants, fullyQualifiedNames);
|
||||
functionName = abc.constants.getMultiname(code.get(ip + plus + 3).operands[0]).getName(constants, fullyQualifiedNames);
|
||||
scopeStack.pop();//with
|
||||
output.remove(output.size() - 1); //with
|
||||
ip = ip + plus + 4; //+1 below
|
||||
|
||||
@@ -24,67 +24,169 @@ import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ConstantPool {
|
||||
|
||||
public long[] constant_int;
|
||||
public long[] constant_uint;
|
||||
public double[] constant_double;
|
||||
public List<Long> constant_int;
|
||||
public List<Long> constant_uint;
|
||||
public List<Double> constant_double;
|
||||
/* Only for some minor versions */
|
||||
public Decimal[] constant_decimal;
|
||||
public String[] constant_string;
|
||||
public Namespace[] constant_namespace;
|
||||
public NamespaceSet[] constant_namespace_set;
|
||||
public Multiname[] constant_multiname;
|
||||
public List<Decimal> constant_decimal;
|
||||
public List<String> constant_string;
|
||||
public List<Namespace> constant_namespace;
|
||||
public List<NamespaceSet> constant_namespace_set;
|
||||
public List<Multiname> constant_multiname;
|
||||
|
||||
public int addInt(long value) {
|
||||
constant_int = Arrays.copyOf(constant_int, constant_int.length + 1);
|
||||
constant_int[constant_int.length - 1] = value;
|
||||
return constant_int.length - 1;
|
||||
public synchronized int addInt(long value) {
|
||||
constant_int.add(value);
|
||||
return constant_int.size() - 1;
|
||||
}
|
||||
|
||||
public int addNamespace(Namespace ns) {
|
||||
constant_namespace = Arrays.copyOf(constant_namespace, constant_namespace.length + 1);
|
||||
constant_namespace[constant_namespace.length - 1] = ns;
|
||||
return constant_namespace.length - 1;
|
||||
public synchronized int addNamespace(Namespace ns) {
|
||||
constant_namespace.add(ns);
|
||||
return constant_namespace.size() - 1;
|
||||
}
|
||||
|
||||
public int addNamespaceSet(NamespaceSet nss) {
|
||||
constant_namespace_set = Arrays.copyOf(constant_namespace_set, constant_namespace_set.length + 1);
|
||||
constant_namespace_set[constant_namespace_set.length - 1] = nss;
|
||||
return constant_namespace_set.length - 1;
|
||||
public synchronized int addNamespaceSet(NamespaceSet nss) {
|
||||
constant_namespace_set.add(nss);
|
||||
return constant_namespace_set.size() - 1;
|
||||
}
|
||||
|
||||
public int addMultiname(Multiname m) {
|
||||
constant_multiname = Arrays.copyOf(constant_multiname, constant_multiname.length + 1);
|
||||
constant_multiname[constant_multiname.length - 1] = m;
|
||||
return constant_multiname.length - 1;
|
||||
public synchronized int addMultiname(Multiname m) {
|
||||
constant_multiname.add(m);
|
||||
return constant_multiname.size() - 1;
|
||||
}
|
||||
|
||||
public int addUInt(long value) {
|
||||
constant_uint = Arrays.copyOf(constant_uint, constant_uint.length + 1);
|
||||
constant_uint[constant_uint.length - 1] = value;
|
||||
return constant_uint.length - 1;
|
||||
public synchronized int addUInt(long value) {
|
||||
constant_uint.add(value);
|
||||
return constant_uint.size() - 1;
|
||||
}
|
||||
|
||||
public int addDouble(double value) {
|
||||
constant_double = Arrays.copyOf(constant_double, constant_double.length + 1);
|
||||
constant_double[constant_double.length - 1] = value;
|
||||
return constant_double.length - 1;
|
||||
public synchronized int addDouble(double value) {
|
||||
constant_double.add(value);
|
||||
return constant_double.size() - 1;
|
||||
}
|
||||
|
||||
public int addString(String value) {
|
||||
constant_string = Arrays.copyOf(constant_string, constant_string.length + 1);
|
||||
constant_string[constant_string.length - 1] = value;
|
||||
return constant_string.length - 1;
|
||||
public synchronized int addDecimal(Decimal value) {
|
||||
constant_decimal.add(value);
|
||||
return constant_decimal.size() - 1;
|
||||
}
|
||||
|
||||
public synchronized int addString(String value) {
|
||||
constant_string.add(value);
|
||||
return constant_string.size() - 1;
|
||||
}
|
||||
|
||||
public long setInt(int index, long value) {
|
||||
constant_int.set(index, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public Namespace setNamespace(int index, Namespace ns) {
|
||||
constant_namespace.set(index, ns);
|
||||
return ns;
|
||||
}
|
||||
|
||||
public NamespaceSet setNamespaceSet(int index, NamespaceSet nss) {
|
||||
constant_namespace_set.set(index, nss);
|
||||
return nss;
|
||||
}
|
||||
|
||||
public Multiname setMultiname(int index, Multiname m) {
|
||||
constant_multiname.set(index, m);
|
||||
return m;
|
||||
}
|
||||
|
||||
public long setUInt(int index, long value) {
|
||||
constant_uint.set(index, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public double setDouble(int index, double value) {
|
||||
constant_double.set(index, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public Decimal setDecimal(int index, Decimal value) {
|
||||
constant_decimal.set(index, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public String setString(int index, String value) {
|
||||
constant_string.set(index, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public long getInt(int index) {
|
||||
return constant_int.get(index);
|
||||
}
|
||||
|
||||
public Namespace getNamespace(int index) {
|
||||
return constant_namespace.get(index);
|
||||
}
|
||||
|
||||
public NamespaceSet getNamespaceSet(int index) {
|
||||
return constant_namespace_set.get(index);
|
||||
}
|
||||
|
||||
public Multiname getMultiname(int index) {
|
||||
return constant_multiname.get(index);
|
||||
}
|
||||
|
||||
public long getUInt(int index) {
|
||||
return constant_uint.get(index);
|
||||
}
|
||||
|
||||
public double getDouble(int index) {
|
||||
return constant_double.get(index);
|
||||
}
|
||||
|
||||
public Decimal getDecimal(int index) {
|
||||
return constant_decimal.get(index);
|
||||
}
|
||||
|
||||
public String getString(int index) {
|
||||
return constant_string.get(index);
|
||||
}
|
||||
|
||||
public int getIntCount() {
|
||||
return constant_int.size();
|
||||
}
|
||||
|
||||
public int getNamespaceCount() {
|
||||
return constant_namespace.size();
|
||||
}
|
||||
|
||||
public int getNamespaceSetCount() {
|
||||
return constant_namespace_set.size();
|
||||
}
|
||||
|
||||
public int getMultinameCount() {
|
||||
return constant_multiname.size();
|
||||
}
|
||||
|
||||
public int getUIntCount() {
|
||||
return constant_uint.size();
|
||||
}
|
||||
|
||||
public int getDoubleCount() {
|
||||
return constant_double.size();
|
||||
}
|
||||
|
||||
public int getDecimalCount() {
|
||||
return constant_decimal.size();
|
||||
}
|
||||
|
||||
public int getStringCount() {
|
||||
return constant_string.size();
|
||||
}
|
||||
|
||||
public int getNamespaceId(Namespace val, int index) {
|
||||
for (int n = 1; n < constant_namespace.length; n++) {
|
||||
Namespace ns = constant_namespace[n];
|
||||
for (int n = 1; n < constant_namespace.size(); n++) {
|
||||
Namespace ns = constant_namespace.get(n);
|
||||
if (ns.name_index == val.name_index && (ns.kind == val.kind)) {
|
||||
if (index == 0) {
|
||||
return n;
|
||||
@@ -96,8 +198,8 @@ public class ConstantPool {
|
||||
}
|
||||
|
||||
public int getIntId(long value) {
|
||||
for (int i = 1; i < constant_int.length; i++) {
|
||||
if (constant_int[i] == value) {
|
||||
for (int i = 1; i < constant_int.size(); i++) {
|
||||
if (constant_int.get(i) == value) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -105,8 +207,8 @@ public class ConstantPool {
|
||||
}
|
||||
|
||||
public int getUIntId(long value) {
|
||||
for (int i = 1; i < constant_uint.length; i++) {
|
||||
if (constant_uint[i] == value) {
|
||||
for (int i = 1; i < constant_uint.size(); i++) {
|
||||
if (constant_uint.get(i) == value) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -114,8 +216,8 @@ public class ConstantPool {
|
||||
}
|
||||
|
||||
public int getDoubleId(double value) {
|
||||
for (int i = 1; i < constant_double.length; i++) {
|
||||
if (Double.compare(constant_double[i], value) == 0) {
|
||||
for (int i = 1; i < constant_double.size(); i++) {
|
||||
if (Double.compare(constant_double.get(i), value) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -123,8 +225,8 @@ public class ConstantPool {
|
||||
}
|
||||
|
||||
public int getStringId(String val) {
|
||||
for (int i = 1; i < constant_string.length; i++) {
|
||||
if (constant_string[i].equals(val)) {
|
||||
for (int i = 1; i < constant_string.size(); i++) {
|
||||
if (constant_string.get(i).equals(val)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -133,8 +235,8 @@ public class ConstantPool {
|
||||
|
||||
public int getMultinameId(Multiname val) {
|
||||
loopm:
|
||||
for (int m = 1; m < constant_multiname.length; m++) {
|
||||
Multiname mul = constant_multiname[m];
|
||||
for (int m = 1; m < constant_multiname.size(); m++) {
|
||||
Multiname mul = constant_multiname.get(m);
|
||||
if (mul.kind == val.kind && mul.name_index == val.name_index && mul.namespace_index == val.namespace_index && mul.namespace_set_index == val.namespace_set_index && mul.qname_index == val.qname_index && mul.params.size() == val.params.size()) {
|
||||
for (int p = 0; p < mul.params.size(); p++) {
|
||||
if (mul.params.get(p) != val.params.get(p)) {
|
||||
@@ -212,27 +314,27 @@ public class ConstantPool {
|
||||
return;
|
||||
}
|
||||
String s = "";
|
||||
for (int i = 1; i < constant_int.length; i++) {
|
||||
output.println("INT[" + i + "]=" + constant_int[i]);
|
||||
for (int i = 1; i < constant_int.size(); i++) {
|
||||
output.println("INT[" + i + "]=" + constant_int.get(i));
|
||||
}
|
||||
for (int i = 1; i < constant_uint.length; i++) {
|
||||
output.println("UINT[" + i + "]=" + constant_uint[i]);
|
||||
for (int i = 1; i < constant_uint.size(); i++) {
|
||||
output.println("UINT[" + i + "]=" + constant_uint.get(i));
|
||||
}
|
||||
for (int i = 1; i < constant_double.length; i++) {
|
||||
output.println("Double[" + i + "]=" + constant_double[i]);
|
||||
for (int i = 1; i < constant_double.size(); i++) {
|
||||
output.println("Double[" + i + "]=" + constant_double.get(i));
|
||||
}
|
||||
for (int i = 1; i < constant_string.length; i++) {
|
||||
output.println("String[" + i + "]=" + constant_string[i]);
|
||||
for (int i = 1; i < constant_string.size(); i++) {
|
||||
output.println("String[" + i + "]=" + constant_string.get(i));
|
||||
}
|
||||
for (int i = 1; i < constant_namespace.length; i++) {
|
||||
output.println("Namespace[" + i + "]=" + constant_namespace[i].toString(this));
|
||||
for (int i = 1; i < constant_namespace.size(); i++) {
|
||||
output.println("Namespace[" + i + "]=" + constant_namespace.get(i).toString(this));
|
||||
}
|
||||
for (int i = 1; i < constant_namespace_set.length; i++) {
|
||||
output.println("NamespaceSet[" + i + "]=" + constant_namespace_set[i].toString(this));
|
||||
for (int i = 1; i < constant_namespace_set.size(); i++) {
|
||||
output.println("NamespaceSet[" + i + "]=" + constant_namespace_set.get(i).toString(this));
|
||||
}
|
||||
|
||||
for (int i = 1; i < constant_multiname.length; i++) {
|
||||
output.println("Multiname[" + i + "]=" + constant_multiname[i].toString(this, new ArrayList<String>()));
|
||||
for (int i = 1; i < constant_multiname.size(); i++) {
|
||||
output.println("Multiname[" + i + "]=" + constant_multiname.get(i).toString(this, new ArrayList<String>()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,20 +342,20 @@ public class ConstantPool {
|
||||
if (index == 0) {
|
||||
return "null";
|
||||
}
|
||||
return constant_multiname[index].toString(this, new ArrayList<String>());
|
||||
return constant_multiname.get(index).toString(this, new ArrayList<String>());
|
||||
}
|
||||
|
||||
public String namespaceToString(int index) {
|
||||
if (index == 0) {
|
||||
return "null";
|
||||
}
|
||||
return constant_namespace[index].toString(this);
|
||||
return constant_namespace.get(index).toString(this);
|
||||
}
|
||||
|
||||
public String namespaceSetToString(int index) {
|
||||
if (index == 0) {
|
||||
return "null";
|
||||
}
|
||||
return constant_namespace_set[index].toString(this);
|
||||
return constant_namespace_set.get(index).toString(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,19 +134,19 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
for (int i = 0; i < definition.operands.length; i++) {
|
||||
switch (definition.operands[i]) {
|
||||
case AVM2Code.DAT_MULTINAME_INDEX:
|
||||
s.add(constants.constant_multiname[operands[i]]);
|
||||
s.add(constants.getMultiname(operands[i]));
|
||||
break;
|
||||
case AVM2Code.DAT_STRING_INDEX:
|
||||
s.add(constants.constant_string[operands[i]]);
|
||||
s.add(constants.getString(operands[i]));
|
||||
break;
|
||||
case AVM2Code.DAT_INT_INDEX:
|
||||
s.add(Long.valueOf(constants.constant_int[operands[i]]));
|
||||
s.add(Long.valueOf(constants.getInt(operands[i])));
|
||||
break;
|
||||
case AVM2Code.DAT_UINT_INDEX:
|
||||
s.add(new Long(constants.constant_uint[operands[i]]));
|
||||
s.add(new Long(constants.getUInt(operands[i])));
|
||||
break;
|
||||
case AVM2Code.DAT_DOUBLE_INDEX:
|
||||
s.add(Double.valueOf(constants.constant_double[operands[i]]));
|
||||
s.add(Double.valueOf(constants.getDouble(operands[i])));
|
||||
break;
|
||||
case AVM2Code.DAT_OFFSET:
|
||||
s.add(new Long(offset + operands[i] + getBytes().length));
|
||||
@@ -177,7 +177,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
s.append(" null");
|
||||
} else {
|
||||
s.append(" ");
|
||||
s.append(constants.constant_multiname[operands[i]].toString(constants, fullyQualifiedNames));
|
||||
s.append(constants.getMultiname(operands[i]).toString(constants, fullyQualifiedNames));
|
||||
}
|
||||
/*s.append(" m[");
|
||||
s.append(operands[i]);
|
||||
@@ -194,7 +194,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
s.append(" null");
|
||||
} else {
|
||||
s.append(" \"");
|
||||
s.append(Helper.escapeString(constants.constant_string[operands[i]]));
|
||||
s.append(Helper.escapeString(constants.getString(operands[i])));
|
||||
s.append("\"");
|
||||
}
|
||||
break;
|
||||
@@ -203,7 +203,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
s.append(" null");
|
||||
} else {
|
||||
s.append(" ");
|
||||
s.append(constants.constant_int[operands[i]]);
|
||||
s.append(constants.getInt(operands[i]));
|
||||
}
|
||||
break;
|
||||
case AVM2Code.DAT_UINT_INDEX:
|
||||
@@ -211,7 +211,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
s.append(" null");
|
||||
} else {
|
||||
s.append(" ");
|
||||
s.append(constants.constant_uint[operands[i]]);
|
||||
s.append(constants.getUInt(operands[i]));
|
||||
}
|
||||
break;
|
||||
case AVM2Code.DAT_DOUBLE_INDEX:
|
||||
@@ -219,7 +219,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
s.append(" null");
|
||||
} else {
|
||||
s.append(" ");
|
||||
s.append(constants.constant_double[operands[i]]);
|
||||
s.append(constants.getDouble(operands[i]));
|
||||
}
|
||||
break;
|
||||
case AVM2Code.DAT_OFFSET:
|
||||
|
||||
@@ -86,10 +86,10 @@ public class InstructionDefinition implements Serializable {
|
||||
protected FullMultinameAVM2Item resolveMultiname(Stack<GraphTargetItem> stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) {
|
||||
GraphTargetItem ns = null;
|
||||
GraphTargetItem name = null;
|
||||
if (constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (constants.getMultiname(multinameIndex).needsName()) {
|
||||
name = (GraphTargetItem) stack.pop();
|
||||
}
|
||||
if (constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ns = (GraphTargetItem) stack.pop();
|
||||
}
|
||||
return new FullMultinameAVM2Item(ins, multinameIndex, name, ns);
|
||||
@@ -97,10 +97,10 @@ public class InstructionDefinition implements Serializable {
|
||||
|
||||
protected int resolvedCount(ConstantPool constants, int multinameIndex) {
|
||||
int pos = 0;
|
||||
if (constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (constants.getMultiname(multinameIndex).needsNs()) {
|
||||
pos++;
|
||||
}
|
||||
if (constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (constants.getMultiname(multinameIndex).needsName()) {
|
||||
pos++;
|
||||
}
|
||||
return pos;
|
||||
@@ -110,14 +110,14 @@ public class InstructionDefinition implements Serializable {
|
||||
protected String resolveMultinameNoPop(int pos, Stack<AVM2Item> stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins, List<String> fullyQualifiedNames) {
|
||||
String ns = "";
|
||||
String name;
|
||||
if (constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ns = "[" + stack.get(pos) + "]";
|
||||
pos++;
|
||||
}
|
||||
if (constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (constants.getMultiname(multinameIndex).needsName()) {
|
||||
name = stack.get(pos).toString();
|
||||
} else {
|
||||
name = GraphTextWriter.hilighOffset(constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames), ins.offset);
|
||||
name = GraphTextWriter.hilighOffset(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames), ins.offset);
|
||||
}
|
||||
return name + ns;
|
||||
}
|
||||
|
||||
@@ -83,10 +83,10 @@ public class ConstructPropIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class NewClassIns extends InstructionDefinition {
|
||||
HilightedTextWriter writer = new HilightedTextWriter(false);
|
||||
stack.pop().toString(writer, LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
String baseType = writer.toString();
|
||||
stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.constant_multiname[abc.instance_info[clsIndex].name_index].getName(constants, fullyQualifiedNames) + ".class extends " + baseType));
|
||||
stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.getMultiname(abc.instance_info[clsIndex].name_index).getName(constants, fullyQualifiedNames) + ".class extends " + baseType));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,10 +55,10 @@ public class CallPropLexIns extends CallPropertyIns {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -74,10 +74,10 @@ public class CallPropVoidIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -72,10 +72,10 @@ public class CallPropertyIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -71,10 +71,10 @@ public class CallSuperIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -72,10 +72,10 @@ public class CallSuperVoidIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -ins.operands[1] - 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -62,10 +62,10 @@ public class DeletePropertyIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -57,10 +57,10 @@ public class FindPropertyIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -56,10 +56,10 @@ public class FindPropertyStrictIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -58,10 +58,10 @@ public class GetDescendantsIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GetGlobalSlotIns extends InstructionDefinition {
|
||||
GraphTargetItem obj = (GraphTargetItem) scopeStack.get(0); //scope
|
||||
Multiname slotname = null;
|
||||
if (obj instanceof ExceptionAVM2Item) {
|
||||
slotname = constants.constant_multiname[((ExceptionAVM2Item) obj).exception.name_index];
|
||||
slotname = constants.getMultiname(((ExceptionAVM2Item) obj).exception.name_index);
|
||||
} else {
|
||||
|
||||
for (int t = 0; t < body.traits.traits.length; t++) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GetLexIns extends InstructionDefinition {
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
int multinameIndex = ins.operands[0];
|
||||
Multiname multiname = constants.constant_multiname[multinameIndex];
|
||||
Multiname multiname = constants.getMultiname(multinameIndex);
|
||||
stack.push(new GetLexAVM2Item(ins, multiname));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@ public class GetPropertyIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GetSlotIns extends InstructionDefinition {
|
||||
obj = obj.getThroughRegister();
|
||||
Multiname slotname = null;
|
||||
if (obj instanceof ExceptionAVM2Item) {
|
||||
slotname = constants.constant_multiname[((ExceptionAVM2Item) obj).exception.name_index];
|
||||
slotname = constants.getMultiname(((ExceptionAVM2Item) obj).exception.name_index);
|
||||
} else if (obj instanceof ClassAVM2Item) {
|
||||
slotname = ((ClassAVM2Item) obj).className;
|
||||
} else if (obj instanceof ThisAVM2Item) {
|
||||
|
||||
@@ -48,10 +48,10 @@ public class GetSuperIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -1 + 1;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -50,10 +50,10 @@ public class InitPropertyIns extends InstructionDefinition {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -2;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -133,10 +133,10 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -2;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns {
|
||||
}
|
||||
|
||||
if (obj instanceof ExceptionAVM2Item) {
|
||||
slotname = constants.constant_multiname[((ExceptionAVM2Item) obj).exception.name_index];
|
||||
slotname = constants.getMultiname(((ExceptionAVM2Item) obj).exception.name_index);
|
||||
} else if (obj instanceof ClassAVM2Item) {
|
||||
slotname = ((ClassAVM2Item) obj).className;
|
||||
} else if (obj instanceof ThisAVM2Item) {
|
||||
|
||||
@@ -64,10 +64,10 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns {
|
||||
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
int ret = -2;
|
||||
int multinameIndex = ins.operands[0];
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsName()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsName()) {
|
||||
ret--;
|
||||
}
|
||||
if (abc.constants.constant_multiname[multinameIndex].needsNs()) {
|
||||
if (abc.constants.getMultiname(multinameIndex).needsNs()) {
|
||||
ret--;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PushDoubleIns extends InstructionDefinition {
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.push(new FloatValueAVM2Item(ins, constants.constant_double[ins.operands[0]]));
|
||||
stack.push(new FloatValueAVM2Item(ins, constants.getDouble(ins.operands[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PushIntIns extends InstructionDefinition implements PushIntegerType
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.push(new IntegerValueAVM2Item(ins, constants.constant_int[ins.operands[0]]));
|
||||
stack.push(new IntegerValueAVM2Item(ins, constants.getInt(ins.operands[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PushStringIns extends InstructionDefinition {
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.push(new StringAVM2Item(ins, constants.constant_string[ins.operands[0]]));
|
||||
stack.push(new StringAVM2Item(ins, constants.getString(ins.operands[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PushUIntIns extends InstructionDefinition implements PushIntegerTyp
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.push(new IntegerValueAVM2Item(ins, constants.constant_uint[ins.operands[0]]));
|
||||
stack.push(new IntegerValueAVM2Item(ins, constants.getUInt(ins.operands[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,13 +45,13 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, java.util.Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
int multinameIndex = ins.operands[0];
|
||||
stack.push(new CoerceAVM2Item(ins, (GraphTargetItem) stack.pop(), constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames)));
|
||||
stack.push(new CoerceAVM2Item(ins, (GraphTargetItem) stack.pop(), constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTargetType(ConstantPool constants, AVM2Instruction ins, List<String> fullyQualifiedNames) {
|
||||
int multinameIndex = ins.operands[0];
|
||||
return constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames);
|
||||
return constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,13 +40,13 @@ public class DXNSIns extends InstructionDefinition {
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, ConstantPool constants, List<Object> arguments) {
|
||||
int strIndex = (int) ((Long) arguments.get(0)).longValue();
|
||||
String s = constants.constant_string[strIndex];
|
||||
String s = constants.getString(strIndex);
|
||||
System.out.println("Set default XML space " + s);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, Stack<GraphTargetItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
output.add(new DefaultXMLNamespace(ins, new StringAVM2Item(ins, constants.constant_string[ins.operands[0]])));
|
||||
output.add(new DefaultXMLNamespace(ins, new StringAVM2Item(ins, constants.getString(ins.operands[0]))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,13 +61,13 @@ public class FullMultinameAVM2Item extends AVM2Item {
|
||||
if (name != null) {
|
||||
cname = name.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
} else {
|
||||
cname = (constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames));
|
||||
cname = (constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames));
|
||||
}
|
||||
String cns = "";
|
||||
if (namespace != null) {
|
||||
cns = namespace.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
} else {
|
||||
Namespace ns = constants.constant_multiname[multinameIndex].getNamespace(constants);
|
||||
Namespace ns = constants.getMultiname(multinameIndex).getNamespace(constants);
|
||||
if ((ns != null) && (ns.name_index != 0)) {
|
||||
cns = ns.getName(constants);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
|
||||
namespace.toString(writer, localData);
|
||||
writer.append("::");
|
||||
} else {
|
||||
/*Namespace ns = constants.constant_multiname[multinameIndex].getNamespace(constants);
|
||||
/*Namespace ns = constants.getMultiname(multinameIndex).getNamespace(constants);
|
||||
if ((ns != null)&&(ns.name_index!=0)) {
|
||||
ret = hilight(ns.getName(constants) + "::")+ret;
|
||||
}*/
|
||||
@@ -93,7 +93,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
|
||||
} else {
|
||||
ConstantPool constants = localData.constantsAvm2;
|
||||
List<String> fullyQualifiedNames = localData.fullyQualifiedNames;
|
||||
writer.append(constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames));
|
||||
writer.append(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames));
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ public class NameSpaceAVM2Item extends AVM2Item {
|
||||
return writer.append("*");
|
||||
}
|
||||
ConstantPool constants = localData.constantsAvm2;
|
||||
return writer.append(constants.constant_namespace[namespaceIndex].toString(constants));
|
||||
return writer.append(constants.getNamespace(namespaceIndex).toString(constants));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ASM3Parser {
|
||||
}
|
||||
|
||||
private static int checkMultinameIndex(ConstantPool constants, int index, int line) throws ParseException {
|
||||
if ((index < 0) || (index >= constants.constant_multiname.length)) {
|
||||
if ((index < 0) || (index >= constants.getMultinameCount())) {
|
||||
throw new ParseException("Invalid multiname index", line);
|
||||
}
|
||||
return index;
|
||||
@@ -183,8 +183,8 @@ public class ASM3Parser {
|
||||
expected(s, ParsedSymbol.TYPE_BRACKET_CLOSE, "]");
|
||||
}
|
||||
loopn:
|
||||
for (int n = 1; n < constants.constant_namespace_set.length; n++) {
|
||||
int nss[] = constants.constant_namespace_set[n].namespaces;
|
||||
for (int n = 1; n < constants.getNamespaceSetCount(); n++) {
|
||||
int nss[] = constants.getNamespaceSet(n).namespaces;
|
||||
if (nss.length != namespaceList.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ public class ABCException implements Serializable {
|
||||
if (name_index == 0) {
|
||||
return "";
|
||||
}
|
||||
return constants.constant_multiname[name_index].getName(constants, fullyQualifiedNames);
|
||||
return constants.getMultiname(name_index).getName(constants, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
public String getTypeName(ConstantPool constants, List<String> fullyQualifiedNames) {
|
||||
if (type_index == 0) {
|
||||
return "*";
|
||||
}
|
||||
return constants.constant_multiname[type_index].getName(constants, fullyQualifiedNames);
|
||||
return constants.getMultiname(type_index).getName(constants, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,15 +45,15 @@ public class InstanceInfo {
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
String supIndexStr = "[nothing]";
|
||||
if (super_index > 0) {
|
||||
supIndexStr = abc.constants.constant_multiname[super_index].toString(abc.constants, fullyQualifiedNames);
|
||||
supIndexStr = abc.constants.getMultiname(super_index).toString(abc.constants, fullyQualifiedNames);
|
||||
}
|
||||
return "name_index=" + abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " super_index=" + supIndexStr + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(abc, fullyQualifiedNames);
|
||||
return "name_index=" + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " super_index=" + supIndexStr + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(abc, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
public String getClassHeaderStr(ABC abc, List<String> fullyQualifiedNames) {
|
||||
String supIndexStr = "";
|
||||
if (super_index > 0) {
|
||||
supIndexStr = " extends " + abc.constants.constant_multiname[super_index].getName(abc.constants, fullyQualifiedNames);////+" flags="+flags+" protectedNS="+protectedNS+" interfaces="+Helper.intArrToString(interfaces)+" method_index="+iinit_index
|
||||
supIndexStr = " extends " + abc.constants.getMultiname(super_index).getName(abc.constants, fullyQualifiedNames);////+" flags="+flags+" protectedNS="+protectedNS+" interfaces="+Helper.intArrToString(interfaces)+" method_index="+iinit_index
|
||||
}
|
||||
String implStr = "";
|
||||
if (interfaces.length > 0) {
|
||||
@@ -66,11 +66,11 @@ public class InstanceInfo {
|
||||
if (i > 0) {
|
||||
implStr += ", ";
|
||||
}
|
||||
implStr += abc.constants.constant_multiname[interfaces[i]].getName(abc.constants, fullyQualifiedNames);
|
||||
implStr += abc.constants.getMultiname(interfaces[i]).getName(abc.constants, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
String modifiers;
|
||||
Namespace ns = abc.constants.constant_multiname[name_index].getNamespace(abc.constants);
|
||||
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
|
||||
modifiers = ns.getPrefix(abc);
|
||||
if (!modifiers.isEmpty()) {
|
||||
modifiers += " ";
|
||||
@@ -86,11 +86,11 @@ public class InstanceInfo {
|
||||
if (isInterface()) {
|
||||
objType = "interface ";
|
||||
}
|
||||
return modifiers + objType + abc.constants.constant_multiname[name_index].getName(abc.constants, new ArrayList<String>()/* No full names here*/) + supIndexStr + implStr;
|
||||
return modifiers + objType + abc.constants.getMultiname(name_index).getName(abc.constants, new ArrayList<String>()/* No full names here*/) + supIndexStr + implStr;
|
||||
}
|
||||
|
||||
public Multiname getName(ConstantPool constants) {
|
||||
return constants.constant_multiname[name_index];
|
||||
return constants.getMultiname(name_index);
|
||||
}
|
||||
|
||||
public boolean isInterface() {
|
||||
|
||||
@@ -37,15 +37,15 @@ public class MetadataInfo {
|
||||
}
|
||||
|
||||
public String toString(ConstantPool constants) {
|
||||
String s = "name=" + constants.constant_string[name_index];
|
||||
String s = "name=" + constants.getString(name_index);
|
||||
if (keys.length > 0) {
|
||||
s += "\r\n";
|
||||
}
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
if (keys[i] == 0) {
|
||||
s += "\"" + constants.constant_string[values[i]] + "\"\r\n";
|
||||
s += "\"" + constants.getString(values[i]) + "\"\r\n";
|
||||
} else {
|
||||
s += "\"" + constants.constant_string[keys[i]] + "\"=\"" + constants.constant_string[values[i]] + "\"\r\n";
|
||||
s += "\"" + constants.getString(keys[i]) + "\"=\"" + constants.getString(values[i]) + "\"\r\n";
|
||||
}
|
||||
}
|
||||
return s;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
for (int i = 1; i <= abc.method_info[this.method_info].param_types.length; i++) {
|
||||
String paramName = "param" + i;
|
||||
if (abc.method_info[this.method_info].flagHas_paramnames() && Configuration.paramNamesEnable.get()) {
|
||||
paramName = abc.constants.constant_string[abc.method_info[this.method_info].paramNames[i - 1]];
|
||||
paramName = abc.constants.getString(abc.method_info[this.method_info].paramNames[i - 1]);
|
||||
}
|
||||
ret.put(i, paramName);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class MethodInfo {
|
||||
if (param_types[i] == 0) {
|
||||
param_typesStr += "*";
|
||||
} else {
|
||||
param_typesStr += constants.constant_multiname[param_types[i]].toString(constants, fullyQualifiedNames);
|
||||
param_typesStr += constants.getMultiname(param_types[i]).toString(constants, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,24 +222,24 @@ public class MethodInfo {
|
||||
if (i > 0) {
|
||||
paramNamesStr += ",";
|
||||
}
|
||||
paramNamesStr += constants.constant_string[paramNames[i]];
|
||||
paramNamesStr += constants.getString(paramNames[i]);
|
||||
}
|
||||
|
||||
String ret_typeStr = "";
|
||||
if (ret_type == 0) {
|
||||
ret_typeStr += "*";
|
||||
} else {
|
||||
ret_typeStr += constants.constant_multiname[ret_type].toString(constants, fullyQualifiedNames);
|
||||
ret_typeStr += constants.getMultiname(ret_type).toString(constants, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
return "param_types=" + param_typesStr + " ret_type=" + ret_typeStr + " name=\"" + constants.constant_string[name_index] + "\" flags=" + flags + " optional=" + optionalStr + " paramNames=" + paramNamesStr;
|
||||
return "param_types=" + param_typesStr + " ret_type=" + ret_typeStr + " name=\"" + constants.getString(name_index) + "\" flags=" + flags + " optional=" + optionalStr + " paramNames=" + paramNamesStr;
|
||||
}
|
||||
|
||||
public String getName(ConstantPool constants) {
|
||||
if (name_index == 0) {
|
||||
return "UNKNOWN";
|
||||
}
|
||||
return constants.constant_string[name_index];
|
||||
return constants.getString(name_index);
|
||||
}
|
||||
|
||||
public GraphTextWriter getParamStr(GraphTextWriter writer, ConstantPool constants, MethodBody body, ABC abc, List<String> fullyQualifiedNames) {
|
||||
@@ -254,7 +254,7 @@ public class MethodInfo {
|
||||
if (!localRegNames.isEmpty()) {
|
||||
writer.appendNoHilight(localRegNames.get(i + 1));
|
||||
} else if ((paramNames.length > i) && (paramNames[i] != 0) && Configuration.paramNamesEnable.get()) {
|
||||
writer.appendNoHilight(constants.constant_string[paramNames[i]]);
|
||||
writer.appendNoHilight(constants.getString(paramNames[i]));
|
||||
} else {
|
||||
writer.appendNoHilight("param" + (i + 1));
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class MethodInfo {
|
||||
if (param_types[i] == 0) {
|
||||
writer.hilightSpecial("*", "param", i);
|
||||
} else {
|
||||
writer.hilightSpecial(constants.constant_multiname[param_types[i]].getName(constants, fullyQualifiedNames), "param", i);
|
||||
writer.hilightSpecial(constants.getMultiname(param_types[i]).getName(constants, fullyQualifiedNames), "param", i);
|
||||
}
|
||||
if (optional != null) {
|
||||
if (i >= param_types.length - optional.length) {
|
||||
@@ -289,7 +289,7 @@ public class MethodInfo {
|
||||
}
|
||||
|
||||
public GraphTextWriter getReturnTypeStr(GraphTextWriter writer, ConstantPool constants, List<String> fullyQualifiedNames) {
|
||||
return writer.hilightSpecial(ret_type == 0 ? "*" : constants.constant_multiname[ret_type].getName(constants, fullyQualifiedNames), "returns");
|
||||
return writer.hilightSpecial(ret_type == 0 ? "*" : constants.getMultiname(ret_type).getName(constants, fullyQualifiedNames), "returns");
|
||||
}
|
||||
|
||||
public void setBody(MethodBody body) {
|
||||
|
||||
@@ -140,18 +140,18 @@ public class Multiname {
|
||||
if (index == 0) {
|
||||
return "null";
|
||||
}
|
||||
int type = constants.constant_namespace[index].kind;
|
||||
String name = constants.constant_namespace[index].getName(constants);
|
||||
int type = constants.getNamespace(index).kind;
|
||||
String name = constants.getNamespace(index).getName(constants);
|
||||
int sub = -1;
|
||||
for (int n = 1; n < constants.constant_namespace.length; n++) {
|
||||
if (constants.constant_namespace[n].kind == type && constants.constant_namespace[n].getName(constants).equals(name)) {
|
||||
for (int n = 1; n < constants.getNamespaceCount(); n++) {
|
||||
if (constants.getNamespace(n).kind == type && constants.getNamespace(n).getName(constants).equals(name)) {
|
||||
sub++;
|
||||
}
|
||||
if (n == index) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return constants.constant_namespace[index].getKindStr() + "(" + "\"" + Helper.escapeString(name) + "\"" + (sub > 0 ? ",\"" + sub + "\"" : "") + ")";
|
||||
return constants.getNamespace(index).getKindStr() + "(" + "\"" + Helper.escapeString(name) + "\"" + (sub > 0 ? ",\"" + sub + "\"" : "") + ")";
|
||||
}
|
||||
|
||||
private static String namespaceSetToString(ConstantPool constants, int index) {
|
||||
@@ -159,11 +159,11 @@ public class Multiname {
|
||||
return "null";
|
||||
}
|
||||
String ret = "[";
|
||||
for (int n = 0; n < constants.constant_namespace_set[index].namespaces.length; n++) {
|
||||
for (int n = 0; n < constants.getNamespaceSet(index).namespaces.length; n++) {
|
||||
if (n > 0) {
|
||||
ret += ",";
|
||||
}
|
||||
int ns = constants.constant_namespace_set[index].namespaces[n];
|
||||
int ns = constants.getNamespaceSet(index).namespaces[n];
|
||||
ret += namespaceToString(constants, ns);
|
||||
}
|
||||
ret += "]";
|
||||
@@ -174,7 +174,7 @@ public class Multiname {
|
||||
if (index == 0) {
|
||||
return "null";
|
||||
}
|
||||
return constants.constant_multiname[index].toString(constants, fullyQualifiedNames);
|
||||
return constants.getMultiname(index).toString(constants, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
public String toString(ConstantPool constants, List<String> fullyQualifiedNames) {
|
||||
@@ -182,16 +182,16 @@ public class Multiname {
|
||||
switch (kind) {
|
||||
case QNAME:
|
||||
case QNAMEA:
|
||||
return getKindStr() + "(" + namespaceToString(constants, namespace_index) + "," + "\"" + Helper.escapeString(constants.constant_string[name_index]) + "\"" + ")";
|
||||
return getKindStr() + "(" + namespaceToString(constants, namespace_index) + "," + "\"" + Helper.escapeString(constants.getString(name_index)) + "\"" + ")";
|
||||
case RTQNAME:
|
||||
case RTQNAMEA:
|
||||
return getKindStr() + "(" + "\"" + Helper.escapeString(constants.constant_string[name_index]) + "\"" + ")";
|
||||
return getKindStr() + "(" + "\"" + Helper.escapeString(constants.getString(name_index)) + "\"" + ")";
|
||||
case RTQNAMEL:
|
||||
case RTQNAMELA:
|
||||
return getKindStr() + "()";
|
||||
case MULTINAME:
|
||||
case MULTINAMEA:
|
||||
return getKindStr() + "(" + "\"" + Helper.escapeString(constants.constant_string[name_index]) + "\"" + "," + namespaceSetToString(constants, namespace_set_index) + ")";
|
||||
return getKindStr() + "(" + "\"" + Helper.escapeString(constants.getString(name_index)) + "\"" + "," + namespaceSetToString(constants, namespace_set_index) + ")";
|
||||
case MULTINAMEL:
|
||||
case MULTINAMELA:
|
||||
return getKindStr() + "(" + namespaceSetToString(constants, namespace_set_index) + ")";
|
||||
@@ -213,10 +213,10 @@ public class Multiname {
|
||||
}
|
||||
|
||||
private String typeNameToStr(ConstantPool constants, List<String> fullyQualifiedNames) {
|
||||
if (constants.constant_multiname[qname_index].name_index == name_index) {
|
||||
if (constants.getMultiname(qname_index).name_index == name_index) {
|
||||
return "ambiguousTypeName";
|
||||
}
|
||||
String typeNameStr = constants.constant_multiname[qname_index].getName(constants, fullyQualifiedNames);
|
||||
String typeNameStr = constants.getMultiname(qname_index).getName(constants, fullyQualifiedNames);
|
||||
if (!params.isEmpty()) {
|
||||
typeNameStr += ".<";
|
||||
for (int i = 0; i < params.size(); i++) {
|
||||
@@ -226,7 +226,7 @@ public class Multiname {
|
||||
if (params.get(i) == 0) {
|
||||
typeNameStr += "*";
|
||||
} else {
|
||||
typeNameStr += constants.constant_multiname[params.get(i)].getName(constants, fullyQualifiedNames);
|
||||
typeNameStr += constants.getMultiname(params.get(i)).getName(constants, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
typeNameStr += ">";
|
||||
@@ -244,7 +244,7 @@ public class Multiname {
|
||||
if (name_index == 0) {
|
||||
return (isAttribute() ? "@*" : "*");
|
||||
} else {
|
||||
String name = constants.constant_string[name_index];
|
||||
String name = constants.getString(name_index);
|
||||
if ((fullyQualifiedNames != null) && fullyQualifiedNames.contains(name)) {
|
||||
return getNameWithNamespace(constants);
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public class Multiname {
|
||||
if ((namespace_index == 0) || (namespace_index == -1)) {
|
||||
return null;
|
||||
} else {
|
||||
return constants.constant_namespace[namespace_index];
|
||||
return constants.getNamespace(namespace_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class Multiname {
|
||||
} else if (namespace_set_index == -1) {
|
||||
return null;
|
||||
} else {
|
||||
return constants.constant_namespace_set[namespace_set_index];
|
||||
return constants.getNamespaceSet(namespace_set_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class Namespace {
|
||||
|
||||
public String getNameWithKind(ConstantPool constants) {
|
||||
String kindStr = getKindStr();
|
||||
String nameStr = constants.constant_string[name_index];
|
||||
String nameStr = constants.getString(name_index);
|
||||
return kindStr + (nameStr.isEmpty() ? "" : " " + nameStr);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,6 @@ public class Namespace {
|
||||
if (name_index == 0) {
|
||||
return "-";
|
||||
}
|
||||
return constants.constant_string[name_index];
|
||||
return constants.getString(name_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NamespaceSet {
|
||||
if (i > 0) {
|
||||
s += ", ";
|
||||
}
|
||||
s += constants.constant_namespace[namespaces[i]].getNameWithKind(constants);
|
||||
s += constants.getNamespace(namespaces[i]).getNameWithKind(constants);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -83,19 +83,19 @@ public class ValueKind {
|
||||
String ret = "?";
|
||||
switch (value_kind) {
|
||||
case CONSTANT_Int:
|
||||
ret = "" + constants.constant_int[value_index];
|
||||
ret = "" + constants.getInt(value_index);
|
||||
break;
|
||||
case CONSTANT_UInt:
|
||||
ret = "" + constants.constant_uint[value_index];
|
||||
ret = "" + constants.getUInt(value_index);
|
||||
break;
|
||||
case CONSTANT_Double:
|
||||
ret = "" + constants.constant_double[value_index];
|
||||
ret = "" + constants.getDouble(value_index);
|
||||
break;
|
||||
case CONSTANT_Decimal:
|
||||
ret = "" + constants.constant_decimal[value_index];
|
||||
ret = "" + constants.getDecimal(value_index);
|
||||
break;
|
||||
case CONSTANT_Utf8:
|
||||
ret = "\"" + Helper.escapeString(constants.constant_string[value_index]) + "\"";
|
||||
ret = "\"" + Helper.escapeString(constants.getString(value_index)) + "\"";
|
||||
break;
|
||||
case CONSTANT_True:
|
||||
ret = "true";
|
||||
@@ -115,7 +115,7 @@ public class ValueKind {
|
||||
case CONSTANT_ExplicitNamespace:
|
||||
case CONSTANT_StaticProtectedNs:
|
||||
case CONSTANT_PrivateNs:
|
||||
ret = "\"" + constants.constant_namespace[value_index].getName(constants) + "\"";
|
||||
ret = "\"" + constants.getNamespace(value_index).getName(constants) + "\"";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
@@ -125,19 +125,19 @@ public class ValueKind {
|
||||
String ret = "?";
|
||||
switch (value_kind) {
|
||||
case CONSTANT_Int:
|
||||
ret = "Integer(" + constants.constant_int[value_index] + ")";
|
||||
ret = "Integer(" + constants.getInt(value_index) + ")";
|
||||
break;
|
||||
case CONSTANT_UInt:
|
||||
ret = "UInteger(" + constants.constant_uint[value_index] + ")";
|
||||
ret = "UInteger(" + constants.getUInt(value_index) + ")";
|
||||
break;
|
||||
case CONSTANT_Double:
|
||||
ret = "Double(" + constants.constant_double[value_index] + ")";
|
||||
ret = "Double(" + constants.getDouble(value_index) + ")";
|
||||
break;
|
||||
case CONSTANT_Decimal:
|
||||
ret = "Decimal(" + constants.constant_decimal[value_index] + ")";
|
||||
ret = "Decimal(" + constants.getDecimal(value_index) + ")";
|
||||
break;
|
||||
case CONSTANT_Utf8:
|
||||
ret = "Utf8(\"" + Helper.escapeString(constants.constant_string[value_index]) + "\")";
|
||||
ret = "Utf8(\"" + Helper.escapeString(constants.getString(value_index)) + "\")";
|
||||
break;
|
||||
case CONSTANT_True:
|
||||
ret = "True";
|
||||
@@ -157,7 +157,7 @@ public class ValueKind {
|
||||
case CONSTANT_ExplicitNamespace:
|
||||
case CONSTANT_StaticProtectedNs:
|
||||
case CONSTANT_PrivateNs:
|
||||
ret = constants.constant_namespace[value_index].getKindStr() + "(\"" + constants.constant_namespace[value_index].getName(constants) + "\")";
|
||||
ret = constants.getNamespace(value_index).getKindStr() + "(\"" + constants.getNamespace(value_index).getName(constants) + "\")";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -55,13 +55,13 @@ public abstract class Trait implements Serializable {
|
||||
Multiname m = getName(abc);
|
||||
if (m != null) {
|
||||
String nsname = "";
|
||||
//if (abc.constants.constant_namespace[m.namespace_index].kind == Namespace.KIND_NAMESPACE) {
|
||||
//if (abc.constants.getNamespace(m.namespace_index).kind == Namespace.KIND_NAMESPACE) {
|
||||
{
|
||||
for (ABCContainerTag abcTag : abcTags) {
|
||||
if (m.namespace_index == -1) {
|
||||
break;
|
||||
}
|
||||
nsname = abcTag.getABC().nsValueToName(abc.constants.constant_namespace[m.namespace_index].getName(abc.constants));
|
||||
nsname = abcTag.getABC().nsValueToName(abc.constants.getNamespace(m.namespace_index).getName(abc.constants));
|
||||
if (nsname.equals("-")) {
|
||||
break;
|
||||
}
|
||||
@@ -113,11 +113,11 @@ public abstract class Trait implements Serializable {
|
||||
}
|
||||
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
return abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata);
|
||||
return abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
public GraphTextWriter toString(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.appendNoHilight(abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata));
|
||||
writer.appendNoHilight(abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata));
|
||||
return writer;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public abstract class Trait implements Serializable {
|
||||
}
|
||||
|
||||
public GraphTextWriter toStringPackaged(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
Namespace ns = abc.constants.constant_multiname[name_index].getNamespace(abc.constants);
|
||||
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
String nsname = ns.getName(abc.constants);
|
||||
writer.appendNoHilight("package " + nsname).newLine();
|
||||
@@ -140,7 +140,7 @@ public abstract class Trait implements Serializable {
|
||||
}
|
||||
|
||||
public void convertPackaged(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
Namespace ns = abc.constants.constant_multiname[name_index].getNamespace(abc.constants);
|
||||
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
String nsname = ns.getName(abc.constants);
|
||||
convert(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
@@ -160,7 +160,7 @@ public abstract class Trait implements Serializable {
|
||||
if (name_index == 0) {
|
||||
return null;
|
||||
} else {
|
||||
return abc.constants.constant_multiname[name_index];
|
||||
return abc.constants.getMultiname(name_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|
||||
@Override
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
return "Class " + abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
return "Class " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
private boolean parseUsagesFromNS(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
Namespace ns = abc.constants.constant_namespace[namespace_index];
|
||||
Namespace ns = abc.constants.getNamespace(namespace_index);
|
||||
if (name.isEmpty()) {
|
||||
name = "*";
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromNS(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
Namespace ns = abc.constants.constant_namespace[namespace_index];
|
||||
Namespace ns = abc.constants.getNamespace(namespace_index);
|
||||
if (name.isEmpty()) {
|
||||
name = "*";
|
||||
}
|
||||
@@ -170,11 +170,11 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (m != null) {
|
||||
if (m.kind == Multiname.TYPENAME) {
|
||||
if (m.qname_index != 0) {
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[m.qname_index], ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (Integer i : m.params) {
|
||||
if (i != 0) {
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[i], ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -201,11 +201,11 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (m != null) {
|
||||
if (m.kind == Multiname.TYPENAME) {
|
||||
if (m.qname_index != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[m.qname_index], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (Integer i : m.params) {
|
||||
if (i != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[i], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -230,18 +230,18 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
visitedMethods.add(method_index);
|
||||
if (abc.method_info[method_index].ret_type != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[abc.method_info[method_index].ret_type], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.method_info[method_index].ret_type), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (int t : abc.method_info[method_index].param_types) {
|
||||
if (t != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[t], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(t), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
MethodBody body = abc.findBody(method_index);
|
||||
if (body != null) {
|
||||
parseImportsUsagesFromTraits(abcTags, abc, body.traits, imports, uses, ignorePackage, fullyQualifiedNames);
|
||||
for (ABCException ex : body.exceptions) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[ex.type_index], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ex.type_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (AVM2Instruction ins : body.code.code) {
|
||||
if (ins.definition instanceof NewFunctionIns) {
|
||||
@@ -258,14 +258,14 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|| (ins.definition instanceof AsTypeIns)) {
|
||||
int m = ins.operands[0];
|
||||
if (m != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[m], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
} else {
|
||||
for (int k = 0; k < ins.definition.operands.length; k++) {
|
||||
|
||||
if (ins.definition.operands[k] == AVM2Code.DAT_MULTINAME_INDEX) {
|
||||
int multinameIndex = ins.operands[k];
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[multinameIndex], ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(multinameIndex), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
private void parseImportsUsagesFromTrait(List<ABCContainerTag> abcTags, ABC abc, Trait t, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t;
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[tm.name_index], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames);
|
||||
if (tm.method_info != 0) {
|
||||
parseImportsUsagesFromMethodInfo(abcTags, abc, tm.method_info, imports, uses, ignorePackage, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
}
|
||||
@@ -290,8 +290,8 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, t.getName(abc), ignorePackage, fullyQualifiedNames);
|
||||
if (t instanceof TraitSlotConst) {
|
||||
TraitSlotConst ts = (TraitSlotConst) t;
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[ts.name_index], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[ts.type_index], ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ts.name_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ts.type_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,13 +301,13 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|
||||
String packageName = abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants);
|
||||
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[abc.instance_info[class_info].name_index], packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info[class_info].name_index), packageName, fullyQualifiedNames);
|
||||
|
||||
if (abc.instance_info[class_info].super_index > 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[abc.instance_info[class_info].super_index], packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info[class_info].super_index), packageName, fullyQualifiedNames);
|
||||
}
|
||||
for (int i : abc.instance_info[class_info].interfaces) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.constant_multiname[i], packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), packageName, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
//static
|
||||
@@ -451,7 +451,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
//constructor
|
||||
if (!abc.instance_info[class_info].isInterface()) {
|
||||
String modifier = "";
|
||||
Multiname m = abc.constants.constant_multiname[abc.instance_info[class_info].name_index];
|
||||
Multiname m = abc.constants.getMultiname(abc.instance_info[class_info].name_index);
|
||||
if (m != null) {
|
||||
Namespace ns = m.getNamespace(abc.constants);
|
||||
if (ns != null) {
|
||||
@@ -468,7 +468,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
writer.startTrait(abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length);
|
||||
writer.appendNoHilight(modifier);
|
||||
writer.appendNoHilight("function ");
|
||||
writer.appendNoHilight(abc.constants.constant_multiname[abc.instance_info[class_info].name_index].getName(abc.constants, new ArrayList<String>()/*do not want full names here*/));
|
||||
writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info[class_info].name_index).getName(abc.constants, new ArrayList<String>()/*do not want full names here*/));
|
||||
writer.appendNoHilight("(");
|
||||
bodyIndex = abc.findBodyIndex(abc.instance_info[class_info].iinit_index);
|
||||
if (bodyIndex != -1) {
|
||||
@@ -525,7 +525,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|
||||
@Override
|
||||
public Multiname getName(ABC abc) {
|
||||
return abc.constants.constant_multiname[abc.instance_info[class_info].name_index];
|
||||
return abc.constants.getMultiname(abc.instance_info[class_info].name_index);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
|
||||
@Override
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
return "Function " + abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_index + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
return "Function " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_index + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +54,7 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
}
|
||||
writer.appendNoHilight(modifier);
|
||||
writer.hilightSpecial("function ", "traittype");
|
||||
writer.hilightSpecial(abc.constants.constant_multiname[name_index].getName(abc.constants, fullyQualifiedNames), "traitname");
|
||||
writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), "traitname");
|
||||
writer.appendNoHilight("(");
|
||||
abc.method_info[method_info].getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames);
|
||||
writer.appendNoHilight(") : ");
|
||||
@@ -75,7 +75,7 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
writer.appendNoHilight(" {").newLine();
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (bodyIndex != -1) {
|
||||
abc.bodies[bodyIndex].toString(path + "." + abc.constants.constant_multiname[name_index].getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, writer, fullyQualifiedNames, null);
|
||||
abc.bodies[bodyIndex].toString(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, writer, fullyQualifiedNames, null);
|
||||
}
|
||||
writer.newLine();
|
||||
writer.appendNoHilight("}");
|
||||
@@ -90,7 +90,7 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
if (!abc.instance_info[classIndex].isInterface()) {
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (bodyIndex != -1) {
|
||||
abc.bodies[bodyIndex].convert(path + "." + abc.constants.constant_multiname[name_index].getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, fullyQualifiedNames, null, true);
|
||||
abc.bodies[bodyIndex].convert(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, fullyQualifiedNames, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
|
||||
@Override
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " MethodGetterSetter " + abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " disp_id=" + disp_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " MethodGetterSetter " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " disp_id=" + disp_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,15 +48,15 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
public String toString(ABC abc, List<String> fullyQualifiedNames) {
|
||||
String typeStr = "*";
|
||||
if (type_index > 0) {
|
||||
typeStr = abc.constants.constant_multiname[type_index].toString(abc.constants, fullyQualifiedNames);
|
||||
typeStr = abc.constants.getMultiname(type_index).toString(abc.constants, fullyQualifiedNames);
|
||||
}
|
||||
return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " SlotConst " + abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " type=" + typeStr + " value=" + (new ValueKind(value_index, value_kind)).toString(abc.constants) + " metadata=" + Helper.intArrToString(metadata);
|
||||
return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " SlotConst " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " type=" + typeStr + " value=" + (new ValueKind(value_index, value_kind)).toString(abc.constants) + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
public String getType(ConstantPool constants, List<String> fullyQualifiedNames) {
|
||||
String typeStr = "*";
|
||||
if (type_index > 0) {
|
||||
typeStr = constants.constant_multiname[type_index].getName(constants, fullyQualifiedNames);
|
||||
typeStr = constants.getMultiname(type_index).getName(constants, fullyQualifiedNames);
|
||||
}
|
||||
return typeStr;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ public class ClassNameMultinameUsage extends InsideClassMultinameUsage {
|
||||
|
||||
@Override
|
||||
public String toString(List<ABCContainerTag> abcTags, ABC abc) {
|
||||
return "class " + abc.constants.constant_multiname[abc.instance_info[classIndex].name_index].getNameWithNamespace(abc.constants);
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info[classIndex].name_index).getNameWithNamespace(abc.constants);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage {
|
||||
|
||||
@Override
|
||||
public String toString(List<ABCContainerTag> abcTags, ABC abc) throws InterruptedException {
|
||||
return "class " + abc.constants.constant_multiname[abc.instance_info[classIndex].name_index].getNameWithNamespace(abc.constants);
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info[classIndex].name_index).getNameWithNamespace(abc.constants);
|
||||
}
|
||||
|
||||
public int getMultinameIndex() {
|
||||
|
||||
@@ -35,6 +35,6 @@ public class TypeNameMultinameUsage extends MultinameUsage {
|
||||
|
||||
@Override
|
||||
public String toString(List<ABCContainerTag> abcTags, ABC abc) {
|
||||
return "TypeName " + abc.constants.constant_multiname[typename_index].toString(abc.constants, new ArrayList<String>());
|
||||
return "TypeName " + abc.constants.getMultiname(typename_index).toString(abc.constants, new ArrayList<String>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1924,8 +1924,8 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
|
||||
public void renameMultiname(int multiNameIndex) {
|
||||
String oldName = "";
|
||||
if (abcPanel.abc.constants.constant_multiname[multiNameIndex].name_index > 0) {
|
||||
oldName = abcPanel.abc.constants.constant_string[abcPanel.abc.constants.constant_multiname[multiNameIndex].name_index];
|
||||
if (abcPanel.abc.constants.getMultiname(multiNameIndex).name_index > 0) {
|
||||
oldName = abcPanel.abc.constants.getString(abcPanel.abc.constants.getMultiname(multiNameIndex).name_index);
|
||||
}
|
||||
String newName = View.showInputDialog(translate("rename.enternew"), oldName);
|
||||
if (newName != null) {
|
||||
@@ -1933,11 +1933,11 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
int mulCount = 0;
|
||||
for (ABCContainerTag cnt : abcList) {
|
||||
ABC abc = cnt.getABC();
|
||||
for (int m = 1; m < abc.constants.constant_multiname.length; m++) {
|
||||
int ni = abc.constants.constant_multiname[m].name_index;
|
||||
for (int m = 1; m < abc.constants.getMultinameCount(); m++) {
|
||||
int ni = abc.constants.getMultiname(m).name_index;
|
||||
String n = "";
|
||||
if (ni > 0) {
|
||||
n = abc.constants.constant_string[ni];
|
||||
n = abc.constants.getString(ni);
|
||||
}
|
||||
if (n.equals(oldName)) {
|
||||
abc.renameMultiname(m, newName);
|
||||
@@ -2747,7 +2747,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get());
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
View.showMessageDialog(null, translate("error.export") + ": " + ex.getLocalizedMessage(), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
View.showMessageDialog(null, translate("error.export") + ": " + ex.getClass().getName() + " " + ex.getLocalizedMessage(), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
Helper.freeMem();
|
||||
Main.stopWork();
|
||||
@@ -2791,7 +2791,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "Error during export", ex);
|
||||
View.showMessageDialog(null, translate("error.export") + ": " + ex.getLocalizedMessage());
|
||||
View.showMessageDialog(null, translate("error.export") + ": " + ex.getClass().getName() + " " + ex.getLocalizedMessage());
|
||||
}
|
||||
Main.stopWork();
|
||||
long timeAfter = System.currentTimeMillis();
|
||||
|
||||
@@ -51,21 +51,21 @@ public class ConstantsListModel implements ListModel {
|
||||
public int getSize() {
|
||||
switch (type) {
|
||||
case TYPE_UINT:
|
||||
return makeUp(constants.constant_uint.length - 1);
|
||||
return makeUp(constants.getUIntCount() - 1);
|
||||
case TYPE_INT:
|
||||
return makeUp(constants.constant_int.length - 1);
|
||||
return makeUp(constants.getIntCount() - 1);
|
||||
case TYPE_DOUBLE:
|
||||
return makeUp(constants.constant_double.length - 1);
|
||||
return makeUp(constants.getDoubleCount() - 1);
|
||||
case TYPE_DECIMAL:
|
||||
return makeUp(constants.constant_decimal.length - 1);
|
||||
return makeUp(constants.getDecimalCount() - 1);
|
||||
case TYPE_STRING:
|
||||
return makeUp(constants.constant_string.length - 1);
|
||||
return makeUp(constants.getStringCount() - 1);
|
||||
case TYPE_NAMESPACE:
|
||||
return makeUp(constants.constant_namespace.length - 1);
|
||||
return makeUp(constants.getNamespaceCount() - 1);
|
||||
case TYPE_NAMESPACESET:
|
||||
return makeUp(constants.constant_namespace_set.length - 1);
|
||||
return makeUp(constants.getNamespaceSetCount() - 1);
|
||||
case TYPE_MULTINAME:
|
||||
return makeUp(constants.constant_multiname.length - 1);
|
||||
return makeUp(constants.getMultinameCount() - 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -74,21 +74,21 @@ public class ConstantsListModel implements ListModel {
|
||||
public Object getElementAt(int index) {
|
||||
switch (type) {
|
||||
case TYPE_UINT:
|
||||
return "" + (index + 1) + ":" + constants.constant_uint[index + 1];
|
||||
return "" + (index + 1) + ":" + constants.getUInt(index + 1);
|
||||
case TYPE_INT:
|
||||
return "" + (index + 1) + ":" + constants.constant_int[index + 1];
|
||||
return "" + (index + 1) + ":" + constants.getInt(index + 1);
|
||||
case TYPE_DOUBLE:
|
||||
return "" + (index + 1) + ":" + constants.constant_double[index + 1];
|
||||
return "" + (index + 1) + ":" + constants.getDouble(index + 1);
|
||||
case TYPE_DECIMAL:
|
||||
return "" + (index + 1) + ":" + constants.constant_decimal[index + 1];
|
||||
return "" + (index + 1) + ":" + constants.getDecimal(index + 1);
|
||||
case TYPE_STRING:
|
||||
return "" + (index + 1) + ":" + Helper.escapeString(constants.constant_string[index + 1]);
|
||||
return "" + (index + 1) + ":" + Helper.escapeString(constants.getString(index + 1));
|
||||
case TYPE_NAMESPACE:
|
||||
return "" + (index + 1) + ":" + constants.constant_namespace[index + 1].getNameWithKind(constants);
|
||||
return "" + (index + 1) + ":" + constants.getNamespace(index + 1).getNameWithKind(constants);
|
||||
case TYPE_NAMESPACESET:
|
||||
return "" + (index + 1) + ":" + constants.constant_namespace_set[index + 1].toString(constants);
|
||||
return "" + (index + 1) + ":" + constants.getNamespaceSet(index + 1).toString(constants);
|
||||
case TYPE_MULTINAME:
|
||||
return "" + (index + 1) + ":" + constants.constant_multiname[index + 1].toString(constants, new ArrayList<String>());
|
||||
return "" + (index + 1) + ":" + constants.getMultiname(index + 1).toString(constants, new ArrayList<String>());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class UsageFrame extends AppFrame implements ActionListener, MouseListene
|
||||
cont.add(new JScrollPane(usageList), BorderLayout.CENTER);
|
||||
cont.add(buttonsPanel, BorderLayout.SOUTH);
|
||||
setSize(400, 300);
|
||||
setTitle(translate("dialog.title") + abc.constants.constant_multiname[multinameIndex].getNameWithNamespace(abc.constants));
|
||||
setTitle(translate("dialog.title") + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants));
|
||||
View.centerScreen(this);
|
||||
View.setWindowIcon(this);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class DecimalTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_decimal.length;
|
||||
return abc.constants.getDecimalCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ public class DecimalTableModel implements TableModel {
|
||||
if (columnIndex == 0) {
|
||||
return rowIndex;
|
||||
} else {
|
||||
return abc.constants.constant_decimal[rowIndex];
|
||||
return abc.constants.getDecimal(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class DoubleTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_double.length;
|
||||
return abc.constants.getDoubleCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,10 +118,10 @@ public class DoubleTableModel implements TableModel {
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
if (columnIndex == 0) {
|
||||
return rowIndex;
|
||||
} else if (Double.isNaN(abc.constants.constant_double[rowIndex])) {
|
||||
} else if (Double.isNaN(abc.constants.getDouble(rowIndex))) {
|
||||
return "NaN";
|
||||
} else {
|
||||
return "" + abc.constants.constant_double[rowIndex];
|
||||
return "" + abc.constants.getDouble(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class IntTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_int.length;
|
||||
return abc.constants.getIntCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ public class IntTableModel implements TableModel {
|
||||
if (columnIndex == 0) {
|
||||
return rowIndex;
|
||||
} else {
|
||||
return abc.constants.constant_int[rowIndex];
|
||||
return abc.constants.getInt(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MultinameTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_multiname.length;
|
||||
return abc.constants.getMultinameCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,31 +124,31 @@ public class MultinameTableModel implements TableModel {
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.constant_multiname[rowIndex].getKindStr();
|
||||
return abc.constants.getMultiname(rowIndex).getKindStr();
|
||||
case 2:
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
}
|
||||
if (abc.constants.constant_multiname[rowIndex].name_index == -1) {
|
||||
if (abc.constants.getMultiname(rowIndex).name_index == -1) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.constant_multiname[rowIndex].getName(abc.constants, new ArrayList<String>());
|
||||
return abc.constants.getMultiname(rowIndex).getName(abc.constants, new ArrayList<String>());
|
||||
case 3:
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
}
|
||||
if (abc.constants.constant_multiname[rowIndex].namespace_index == -1) {
|
||||
if (abc.constants.getMultiname(rowIndex).namespace_index == -1) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.constant_multiname[rowIndex].getNamespace(abc.constants).getNameWithKind(abc.constants);
|
||||
return abc.constants.getMultiname(rowIndex).getNamespace(abc.constants).getNameWithKind(abc.constants);
|
||||
case 4:
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
}
|
||||
if (abc.constants.constant_multiname[rowIndex].namespace_set_index == -1) {
|
||||
if (abc.constants.getMultiname(rowIndex).namespace_set_index == -1) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.constant_multiname[rowIndex].getNamespaceSet(abc.constants).toString(abc.constants);
|
||||
return abc.constants.getMultiname(rowIndex).getNamespaceSet(abc.constants).toString(abc.constants);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class NamespaceSetTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_namespace_set.length;
|
||||
return abc.constants.getNamespaceSetCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,7 +123,7 @@ public class NamespaceSetTableModel implements TableModel {
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.constant_namespace_set[rowIndex].toString(abc.constants);
|
||||
return abc.constants.getNamespaceSet(rowIndex).toString(abc.constants);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class NamespaceTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_namespace.length;
|
||||
return abc.constants.getNamespaceCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,12 +123,12 @@ public class NamespaceTableModel implements TableModel {
|
||||
if (rowIndex == 0) {
|
||||
return "-";
|
||||
}
|
||||
return abc.constants.constant_namespace[rowIndex].getKindStr();
|
||||
return abc.constants.getNamespace(rowIndex).getKindStr();
|
||||
case 2:
|
||||
if (rowIndex == 0) {
|
||||
return "-";
|
||||
}
|
||||
return abc.constants.constant_namespace[rowIndex].getName(abc.constants);
|
||||
return abc.constants.getNamespace(rowIndex).getName(abc.constants);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class StringTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_string.length;
|
||||
return abc.constants.getStringCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ public class StringTableModel implements TableModel {
|
||||
if (columnIndex == 0) {
|
||||
return rowIndex;
|
||||
} else {
|
||||
return abc.constants.constant_string[rowIndex];
|
||||
return abc.constants.getString(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class UIntTableModel implements TableModel {
|
||||
if (abc == null) {
|
||||
return 0;
|
||||
}
|
||||
return abc.constants.constant_uint.length;
|
||||
return abc.constants.getUIntCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ public class UIntTableModel implements TableModel {
|
||||
if (columnIndex == 0) {
|
||||
return rowIndex;
|
||||
} else {
|
||||
return abc.constants.constant_uint[rowIndex];
|
||||
return abc.constants.getUInt(rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user