Skip to content

Commit

Permalink
add more insn.
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclf committed Dec 20, 2024
1 parent 0586aa5 commit 427c4cd
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ protected InsnNode decode(InsnData insn) throws DecodeException {
return constClsInsn;
}

case 0x6e: {
ArgType clsType = ArgType.object("NewTarget");
InsnNode constClsInsn = new ConstClassNode(clsType);
constClsInsn.setResult(InsnArg.reg(accRegister, ArgType.OBJECT));
return constClsInsn;
}

case 0xad: {
ArgType clsType = ArgType.object("ldsymbol");
InsnNode constClsInsn = new ConstClassNode(clsType);
Expand All @@ -196,18 +203,55 @@ protected InsnNode decode(InsnData insn) throws DecodeException {
return insn(InsnType.MOVE, InsnArg.reg(accRegister, ArgType.NARROW),
getRegisterArg(asmItem, 1, ArgType.NARROW));

case 0xa2:
case 0xa0:
case 0x57:
case 0x55:{
InsnArg arg = InsnArg.wrapArg(new ConstClassNode(ArgType.object("null")));
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.NE);
}

case 0xa1:
case 0x9f:
case 0x56:
case 0x54:{
InsnArg arg = InsnArg.wrapArg(new ConstClassNode(ArgType.object("null")));
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.EQ);
}

case 0xa5:
case 0xa3:
case 0x58:
case 0x5a:{
InsnArg arg = InsnArg.wrapArg(new ConstClassNode(ArgType.object("undefined")));
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.EQ);
}

case 0xa6:
case 0xa4:
case 0x59:
case 0x5b:{
InsnArg arg = InsnArg.wrapArg(new ConstClassNode(ArgType.object("undefined")));
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.NE);
}

case 0xa7:
case 0xa9:
case 0x5e:
case 0x5c:{
InsnArg arg = InsnArg.reg(getIntOpUnit(asmItem, 1), ArgType.NARROW);
return new IfNode(getIntOpUnit(asmItem, 2) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.EQ);
}

case 0xaa:
case 0xa8:
case 0x5f:
case 0x5d:{
InsnArg arg = InsnArg.reg(getIntOpUnit(asmItem, 1), ArgType.NARROW);
return new IfNode(getIntOpUnit(asmItem, 2) + asmItem.getCodeOffset(), InsnArg.reg(accRegister, ArgType.NARROW), arg, IfOp.NE);
}


case 0x13:
return cmp(getRegisterByOpIndex(asmItem, 2), accRegister, accRegister, InsnType.CMP_G, ArgType.NARROW);

Expand Down Expand Up @@ -327,11 +371,15 @@ protected InsnNode decode(InsnData insn) throws DecodeException {
case 0x4f: // jeqz
case 0x50:
case 0x9a:
case 0x9d:
case 0x52:
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), accRegister, IfOp.EQ);

case 0x9b:
case 0x9c:
case 0x9e:
case 0x51: // jnez
case 0x53:
return new IfNode(getIntOpUnit(asmItem, 1) + asmItem.getCodeOffset(), accRegister, IfOp.NE);

case 0x98:
Expand Down

0 comments on commit 427c4cd

Please sign in to comment.