AS3 - Decimal number type support for ABC minor_version 17 or greater

This commit is contained in:
Jindra Petk
2011-07-12 09:44:42 +02:00
parent 07ca3fee80
commit 1f25be9236
10 changed files with 272 additions and 14 deletions

View File

@@ -84,11 +84,13 @@ public class AVM2Code {
public static final int DAT_INT_INDEX = OPT_U30 + 0x0E;
public static final int DAT_UINT_INDEX = OPT_U30 + 0x0F;
public static final int DAT_DOUBLE_INDEX = OPT_U30 + 0x10;
public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x11;
public static final int DAT_DECIMAL_INDEX = OPT_U30 + 0x11;
public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x12;
public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{
new AddIns(),
new InstructionDefinition(0x9b,"add_d",new int[]{}),
new AddIIns(),
new InstructionDefinition(0xb5,"add_p",new int[]{AVM2Code.OPT_U30}),
new ApplyTypeIns(),
new AsTypeIns(),
new AsTypeLateIns(),
@@ -127,6 +129,8 @@ public class AVM2Code {
new ConvertOIns(),
new ConvertUIns(),
new ConvertSIns(),
new InstructionDefinition(0x79,"convert_m",new int[]{}),
new InstructionDefinition(0x7a,"convert_m_p",new int[]{AVM2Code.OPT_U30 /*param (?)*/}),
new DebugIns(),
new DebugFileIns(),
new DebugLineIns(),
@@ -134,9 +138,11 @@ public class AVM2Code {
new DecLocalIIns(),
new DecrementIns(),
new DecrementIIns(),
new InstructionDefinition(0x5b,"deldescendants",new int[]{}),
new DeletePropertyIns(),
new InstructionDefinition(0x6b,"deletepropertylate",new int[]{}),
new DivideIns(),
new InstructionDefinition(0xb8,"divide_p",new int[]{AVM2Code.OPT_U30}),
new DupIns(),
new DXNSIns(),
new DXNSLateIns(),
@@ -185,6 +191,10 @@ public class AVM2Code {
new IncLocalIIns(),
new IncrementIns(),
new IncrementIIns(),
new InstructionDefinition(0x9c,"increment_p",new int[]{AVM2Code.OPT_U30 /*param*/}),
new InstructionDefinition(0x9d,"inclocal_p",new int[]{AVM2Code.OPT_U30 /*param*/,AVM2Code.DAT_REGISTER_INDEX}),
new InstructionDefinition(0x9e,"decrement_p",new int[]{AVM2Code.OPT_U30 /*param*/}),
new InstructionDefinition(0x9f,"declocal_p",new int[]{AVM2Code.OPT_U30 /*param*/,AVM2Code.DAT_REGISTER_INDEX}),
new InitPropertyIns(),
new InstanceOfIns(),
new IsTypeIns(),
@@ -197,10 +207,13 @@ public class AVM2Code {
new LookupSwitchIns(),
new LShiftIns(),
new ModuloIns(),
new InstructionDefinition(0xb9,"modulo_p",new int[]{AVM2Code.OPT_U30}),
new MultiplyIns(),
new MultiplyIIns(),
new InstructionDefinition(0xb7,"multiply_p",new int[]{AVM2Code.OPT_U30}),
new NegateIns(),
new NegateIIns(),
new InstructionDefinition(0x8f,"negate_p",new int[]{AVM2Code.OPT_U30 /* param */}),
new NewActivationIns(),
new NewArrayIns(),
new NewCatchIns(),
@@ -215,6 +228,8 @@ public class AVM2Code {
new PopScopeIns(),
new PushByteIns(),
new InstructionDefinition(0x22,"pushconstant",new int[]{AVM2Code.DAT_STRING_INDEX}),
new InstructionDefinition(0x33,"pushdecimal",new int[]{AVM2Code.DAT_DECIMAL_INDEX}),
new InstructionDefinition(0x34,"pushdnan",new int[]{}),
new PushDoubleIns(),
new PushFalseIns(),
new PushIntIns(),
@@ -244,8 +259,10 @@ public class AVM2Code {
new StrictEqualsIns(),
new SubtractIns(),
new SubtractIIns(),
new InstructionDefinition(0xb6,"subtract_p",new int[]{AVM2Code.OPT_U30}),
new SwapIns(),
new ThrowIns(),
new InstructionDefinition(0xf3,"timestamp",new int[]{}),
new TypeOfIns(),
new URShiftIns(),
new InstructionDefinition(0x35,"li8",new int[]{}),