private static int expandLongRegs(StackFrame sf, BFunctionPointer fp) { int longIndex = 0; if (fp.getAdditionalIndexCount(BTypes.typeInt.getTag()) > 0) { if (sf.longRegs == null) { sf.longRegs = new long[0]; } long[] newLongRegs = new long[sf.longRegs.length + fp.getAdditionalIndexCount(BTypes.typeInt.getTag())]; System.arraycopy(sf.longRegs, 0, newLongRegs, 0, sf.longRegs.length); longIndex = sf.longRegs.length; sf.longRegs = newLongRegs; } return longIndex; }
private static int expandDoubleRegs(StackFrame sf, BFunctionPointer fp) { int doubleIndex = 0; if (fp.getAdditionalIndexCount(BTypes.typeFloat.getTag()) > 0) { if (sf.doubleRegs == null) { sf.doubleRegs = new double[0]; } double[] newDoubleRegs = new double[sf.doubleRegs.length + fp.getAdditionalIndexCount(BTypes.typeFloat.getTag())]; System.arraycopy(sf.doubleRegs, 0, newDoubleRegs, 0, sf.doubleRegs.length); doubleIndex = sf.doubleRegs.length; sf.doubleRegs = newDoubleRegs; } return doubleIndex; }
private static int expandRefRegs(StackFrame sf, BFunctionPointer fp) { int refIndex = 0; if (fp.getAdditionalIndexCount(BTypes.typeAny.getTag()) > 0) { if (sf.refRegs == null) { sf.refRegs = new BRefType[0]; } BRefType<?>[] newRefRegs = new BRefType[sf.refRegs.length + fp.getAdditionalIndexCount(BTypes.typeAny.getTag())]; System.arraycopy(sf.refRegs, 0, newRefRegs, 0, sf.refRegs.length); refIndex = sf.refRegs.length; sf.refRegs = newRefRegs; } return refIndex; }
private static int expandStringRegs(StackFrame sf, BFunctionPointer fp) { int stringIndex = 0; if (fp.getAdditionalIndexCount(BTypes.typeString.getTag()) > 0) { if (sf.stringRegs == null) { sf.stringRegs = new String[0]; } String[] newStringRegs = new String[sf.stringRegs.length + fp.getAdditionalIndexCount(BTypes.typeString.getTag())]; System.arraycopy(sf.stringRegs, 0, newStringRegs, 0, sf.stringRegs.length); stringIndex = sf.stringRegs.length; sf.stringRegs = newStringRegs; } return stringIndex; }
private static int expandIntRegs(StackFrame sf, BFunctionPointer fp) { int intIndex = 0; if (fp.getAdditionalIndexCount(BTypes.typeBoolean.getTag()) > 0 || fp.getAdditionalIndexCount(BTypes.typeByte.getTag()) > 0) { if (sf.intRegs == null) { sf.intRegs = new int[0]; } int[] newIntRegs = new int[sf.intRegs.length + fp.getAdditionalIndexCount(BTypes.typeBoolean.getTag()) + fp.getAdditionalIndexCount(BTypes.typeByte.getTag())]; System.arraycopy(sf.intRegs, 0, newIntRegs, 0, sf.intRegs.length); intIndex = sf.intRegs.length; sf.intRegs = newIntRegs; } return intIndex; }