update JavaExecutionEngine.java

This commit is contained in:
wangxiang
2023-07-30 00:41:59 +08:00
parent f0f6cceb7a
commit f8504c3255
5 changed files with 71 additions and 80 deletions

View File

@@ -264,27 +264,14 @@ public class Frame {
public void slotSet(int index, StackValue stackValue) {
switch (stackValue.getType()) {
case Const.T_CHAR:
throw new Error("T_CHAR未作处理");
case Const.T_INT:
slotSetInt(index, (int) stackValue.getValue());
break;
case Const.T_OBJECT:
slotSetRef(index, stackValue.getValue());
break;
case Const.T_LONG:
slotSetLong(index, (long) stackValue.getValue());
break;
case Const.T_DOUBLE:
slotSetDouble(index, (double) stackValue.getValue());
break;
case Const.T_FLOAT:
slotSetFloat(index, (float) stackValue.getValue());
break;
case Const.T_ARRAY:
throw new Error("T_ARRAY未作处理");
default:
throw new Error("无法识别的参数类型");
case Const.T_CHAR -> throw new Error("T_CHAR未作处理");
case Const.T_INT -> slotSetInt(index, (int) stackValue.getValue());
case Const.T_OBJECT -> slotSetRef(index, stackValue.getValue());
case Const.T_LONG -> slotSetLong(index, (long) stackValue.getValue());
case Const.T_DOUBLE -> slotSetDouble(index, (double) stackValue.getValue());
case Const.T_FLOAT -> slotSetFloat(index, (float) stackValue.getValue());
case Const.T_ARRAY -> throw new Error("T_ARRAY未作处理");
default -> throw new Error("无法识别的参数类型");
}
}