not creating always new instruction definition objects

This commit is contained in:
2015-09-07 10:20:11 +02:00
parent 1bbbfebea4
commit 1badb49810
85 changed files with 1278 additions and 789 deletions
@@ -22,9 +22,7 @@ import com.jpexs.decompiler.flash.abc.ClassPath;
import com.jpexs.decompiler.flash.abc.ScriptPack;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal0Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushScopeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference;
import com.jpexs.decompiler.flash.abc.types.ABCException;
@@ -824,9 +822,9 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
body.max_stack = 1;
body.exceptions = new ABCException[0];
AVM2Code code = new AVM2Code();
code.code.add(new AVM2Instruction(0, new GetLocal0Ins(), new int[0]));
code.code.add(new AVM2Instruction(0, new PushScopeIns(), new int[0]));
code.code.add(new AVM2Instruction(0, new ReturnVoidIns(), new int[0]));
code.code.add(new AVM2Instruction(0, AVM2Instructions.GetLocal0, null));
code.code.add(new AVM2Instruction(0, AVM2Instructions.PushScope, null));
code.code.add(new AVM2Instruction(0, AVM2Instructions.ReturnVoid, null));
body.setCode(code);
Traits traits = new Traits();
traits.traits = new ArrayList<>();