Not support JavaVM opcode MULTIANEWARRAY

This commit is contained in:
wangxiang
2023-07-25 18:25:02 +08:00
parent 46e57beb9f
commit ef5dda57c5
3 changed files with 28 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
# 局限性 # 局限性
* 不支持多线程 * 不支持多线程
* 不支持多维数组
* 垃圾回收依靠宿主 JVM * 垃圾回收依靠宿主 JVM
# 快速体验 # 快速体验

View File

@@ -4,10 +4,7 @@ import haidnor.jvm.instruction.comparisons.*;
import haidnor.jvm.instruction.constants.*; import haidnor.jvm.instruction.constants.*;
import haidnor.jvm.instruction.control.*; import haidnor.jvm.instruction.control.*;
import haidnor.jvm.instruction.conversions.*; import haidnor.jvm.instruction.conversions.*;
import haidnor.jvm.instruction.extended.GOTO; import haidnor.jvm.instruction.extended.*;
import haidnor.jvm.instruction.extended.GOTO_W;
import haidnor.jvm.instruction.extended.IFNONNULL;
import haidnor.jvm.instruction.extended.IFNULL;
import haidnor.jvm.instruction.loads.*; import haidnor.jvm.instruction.loads.*;
import haidnor.jvm.instruction.math.*; import haidnor.jvm.instruction.math.*;
import haidnor.jvm.instruction.references.*; import haidnor.jvm.instruction.references.*;
@@ -613,7 +610,7 @@ public abstract class InstructionFactory {
throw new Error("Not support JavaVM opcode WIDE"); throw new Error("Not support JavaVM opcode WIDE");
} }
case Const.MULTIANEWARRAY -> { case Const.MULTIANEWARRAY -> {
throw new Error("Not support JavaVM opcode MULTIANEWARRAY"); return new MULTIANEWARRAY(codeStream);
} }
case Const.IFNULL -> { case Const.IFNULL -> {
return new IFNULL(codeStream); return new IFNULL(codeStream);

View File

@@ -0,0 +1,25 @@
package haidnor.jvm.instruction.extended;
import haidnor.jvm.instruction.Instruction;
import haidnor.jvm.runtime.Frame;
import haidnor.jvm.util.CodeStream;
public class MULTIANEWARRAY extends Instruction {
public final int index;
public final int dimensions;
public MULTIANEWARRAY(CodeStream codeStream) {
super(codeStream);
this.index = codeStream.readUnsignedShort(this);
this.dimensions = codeStream.readUnsignedByte(this);
throw new UnsupportedOperationException("MULTIANEWARRAY");
}
@Override
public void execute(Frame frame) {
throw new UnsupportedOperationException("MULTIANEWARRAY");
}
}