/** * Calls the constructor {@code constructor} using {@code args} and assigns * the new instance to {@code target}. */ public <T> void newInstance(Local<T> target, MethodId<T, Void> constructor, Local<?>... args) { if (target == null) { throw new IllegalArgumentException(); } addInstruction(new ThrowingCstInsn(Rops.NEW_INSTANCE, sourcePosition, RegisterSpecList.EMPTY, catches, constructor.declaringType.constant)); moveResult(target, true); invokeDirect(constructor, null, target, args); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** {@inheritDoc} */ @Override public String getInlineString() { return getConstant().toHuman() + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
private <D, R> void invoke(Rop rop, MethodId<D, R> method, Local<? super R> target, Local<? extends D> object, Local<?>... args) { addInstruction(new ThrowingCstInsn(rop, sourcePosition, concatenate(object, args), catches, method.constant)); if (target != null) { moveResult(target, false); } }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** * Copies the value in the static field {@code fieldId} to {@code target}. */ public <V> void sget(FieldId<?, ? extends V> fieldId, Local<V> target) { addInstruction(new ThrowingCstInsn(Rops.opGetStatic(target.type.ropType), sourcePosition, RegisterSpecList.EMPTY, catches, fieldId.constant)); moveResult(target, true); }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** * Tests if the value in {@code source} is assignable to {@code type}. If it * is, {@code target} is assigned to 1; otherwise {@code target} is assigned * to 0. */ public void instanceOfType(Local<?> target, Local<?> source, TypeId<?> type) { addInstruction(new ThrowingCstInsn(Rops.INSTANCE_OF, sourcePosition, RegisterSpecList.make(source.spec()), catches, type.constant)); moveResult(target, true); }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** * Copies the value in {@code source} to the static field {@code fieldId}. */ public <V> void sput(FieldId<?, V> fieldId, Local<? extends V> source) { addInstruction(new ThrowingCstInsn(Rops.opPutStatic(source.type.ropType), sourcePosition, RegisterSpecList.make(source.spec()), catches, fieldId.constant)); }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingCstInsn(getOpcode(), getPosition(), sources, catches, getConstant()); }
/** * Assigns {@code target} to a newly allocated array of length {@code * length}. The array's type is the same as {@code target}'s type. */ public <T> void newArray(Local<T> target, Local<Integer> length) { addInstruction(new ThrowingCstInsn(Rops.opNewArray(target.type.ropType), sourcePosition, RegisterSpecList.make(length.spec()), catches, target.type.constant)); moveResult(target, true); }
/** {@inheritDoc} */ @Override public String getInlineString() { Constant cst = getConstant(); String constantString = cst.toHuman(); if (cst instanceof CstString) { constantString = ((CstString) cst).toQuoted(); } return constantString + " " + ThrowingInsn.toCatchString(catches); }