version apha 9

AS3: Included new undocumented instructions, new Multiname kind - Typename
AS3: Export PCode
AS3: Implemented code for executing some instructions
Many bugfixes
This commit is contained in:
Jindra Pet��k
2011-07-02 18:28:51 +02:00
parent 6f4754f481
commit eaeaa19923
578 changed files with 2900 additions and 2522 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 JPEXS
* Copyright (C) 2010-2011 JPEXS
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -111,6 +111,45 @@ public class AVM2Instruction {
return ret;
}
public List getParamsAsList(ConstantPool constants){
List s = new ArrayList();
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]]);
break;
case AVM2Code.DAT_STRING_INDEX:
s.add(constants.constant_string[operands[i]]);
break;
case AVM2Code.DAT_INT_INDEX:
s.add(new Long(constants.constant_int[operands[i]]));
break;
case AVM2Code.DAT_UINT_INDEX:
s.add(new Long(constants.constant_uint[operands[i]]));
break;
case AVM2Code.DAT_DOUBLE_INDEX:
s.add(new Double(constants.constant_double[operands[i]]));
break;
case AVM2Code.DAT_OFFSET:
s.add(new Long(offset + operands[i] + getBytes().length));
break;
case AVM2Code.DAT_CASE_BASEOFFSET:
s.add(new Long(offset + operands[i]));
break;
case AVM2Code.OPT_CASE_OFFSETS:
s.add(new Long(operands[i]));
for (int j = i + 1; j < operands.length; j++) {
s.add(new Long(offset + operands[j]));
}
break;
default:
s.add(new Long(operands[i]));
}
}
return s;
}
public String getParams(ConstantPool constants) {
String s = "";
for (int i = 0; i < definition.operands.length; i++) {