mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 18:38:12 +00:00
simplify expressions
This commit is contained in:
@@ -1516,7 +1516,7 @@ public class AVM2Code implements Cloneable {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Configuration._simplifyExpressions.get()) {
|
||||
if (Configuration.simplifyExpressions.get()) {
|
||||
stack.simplify();
|
||||
}
|
||||
visited[ip] = true;
|
||||
@@ -2086,8 +2086,7 @@ public class AVM2Code implements Cloneable {
|
||||
ins.operands[j] = updater.updateOperandOffset(target, ins.operands[j]);
|
||||
}
|
||||
}*/ //Faster, but not so universal
|
||||
{
|
||||
if (ins.definition instanceof IfTypeIns) {
|
||||
if (ins.definition instanceof IfTypeIns) {
|
||||
long target = ins.getTargetAddress();
|
||||
try {
|
||||
ins.operands[0] = updater.updateOperandOffset(ins.getAddress(), target, ins.operands[0]);
|
||||
@@ -2095,7 +2094,6 @@ public class AVM2Code implements Cloneable {
|
||||
throw new ConvertException("Invalid offset (" + ins + ")", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
ins.setAddress(updater.updateInstructionOffset(ins.getAddress()));
|
||||
}
|
||||
|
||||
|
||||
@@ -971,6 +971,9 @@ public abstract class Action implements GraphSourceItem {
|
||||
output.add(new ScriptEndItem());
|
||||
break;
|
||||
}
|
||||
if (Configuration.simplifyExpressions.get()) {
|
||||
stack.simplify();
|
||||
}
|
||||
Action action = actions.get(ip);
|
||||
if (action.isIgnored()) {
|
||||
ip++;
|
||||
@@ -1062,7 +1065,7 @@ public abstract class Action implements GraphSourceItem {
|
||||
}
|
||||
|
||||
/*ActionJump && ActionIf removed*/
|
||||
/*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) {
|
||||
/*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) {
|
||||
loopStart = ip + 1;
|
||||
isForIn = true;
|
||||
ip += 4;
|
||||
|
||||
@@ -589,9 +589,8 @@ public class Configuration {
|
||||
public static final ConfigurationItem<Boolean> _enableFlexExport = null;
|
||||
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
//@ConfigurationCategory("script")
|
||||
@ConfigurationInternal
|
||||
public static final ConfigurationItem<Boolean> _simplifyExpressions = null;
|
||||
@ConfigurationCategory("script")
|
||||
public static final ConfigurationItem<Boolean> simplifyExpressions = null;
|
||||
|
||||
private enum OSId {
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!implicitCoerce.isEmpty() && Configuration._simplifyExpressions.get()) {
|
||||
if (!implicitCoerce.isEmpty() && Configuration.simplifyExpressions.get()) {
|
||||
t = t.simplify(implicitCoerce);
|
||||
}
|
||||
return t.appendTo(writer, localData);
|
||||
|
||||
Reference in New Issue
Block a user