some instruction definitions implements CoerceOrConvertTypeIns

This commit is contained in:
honfika@gmail.com
2015-09-14 08:42:08 +02:00
parent 3958217d93
commit 4b7c653aa6
5 changed files with 55 additions and 5 deletions

View File

@@ -17,10 +17,15 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
public class CoerceBIns extends InstructionDefinition {
public class CoerceBIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceBIns() {
super(0x81, "coerce_b", new int[]{}, true); // stack: -1+1
@@ -35,4 +40,9 @@ public class CoerceBIns extends InstructionDefinition {
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins) {
return new TypeItem(DottedChain.BOOLEAN);
}
}

View File

@@ -17,10 +17,15 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
public class CoerceDIns extends InstructionDefinition {
public class CoerceDIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceDIns() {
super(0x84, "coerce_d", new int[]{}, true); // stack: -1+1
@@ -35,4 +40,9 @@ public class CoerceDIns extends InstructionDefinition {
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins) {
return new TypeItem(DottedChain.NUMBER);
}
}

View File

@@ -17,10 +17,15 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
public class CoerceIIns extends InstructionDefinition {
public class CoerceIIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceIIns() {
super(0x83, "coerce_i", new int[]{}, true); // stack: -1+1
@@ -35,4 +40,9 @@ public class CoerceIIns extends InstructionDefinition {
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins) {
return new TypeItem(DottedChain.INT);
}
}

View File

@@ -17,10 +17,15 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
public class CoerceOIns extends InstructionDefinition {
public class CoerceOIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceOIns() {
super(0x89, "coerce_o", new int[]{}, true); // stack: -1+1
@@ -35,4 +40,9 @@ public class CoerceOIns extends InstructionDefinition {
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins) {
return new TypeItem(DottedChain.OBJECT);
}
}

View File

@@ -17,10 +17,15 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
public class CoerceUIns extends InstructionDefinition {
public class CoerceUIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceUIns() {
super(0x88, "coerce_u", new int[]{}, true); // stack: -1+1
@@ -35,4 +40,9 @@ public class CoerceUIns extends InstructionDefinition {
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins) {
return new TypeItem(DottedChain.UINT);
}
}