public StackMap getStackMap() { return new StackMap(destCp, dest); } }
/** * Constructs a walker. */ public Walker(StackMap sm) { info = sm.get(); }
Copier(StackMap map, ConstPool newCp, Map classnames) { super(map); srcCp = map.getConstPool(); dest = new byte[info.length]; destCp = newCp; this.classnames = classnames; }
/** * Undocumented method. Do not use; internal-use only. * * <p>This method is for javassist.convert.TransformNew. * It is called to update the stack map when * the NEW opcode (and the following DUP) is removed. * * @param where the position of the removed NEW opcode. */ public void removeNew(int where) throws CannotCompileException { byte[] data = new NewRemover(this, where).doit(); this.set(data); }
void shiftPc(int where, int gapLength, boolean exclusive) throws BadBytecode { if (where < cursor || (where == cursor && exclusive)) cursor += gapLength; if (where < mark || (where == mark && exclusive)) mark += gapLength; if (where < mark0 || (where == mark0 && exclusive)) mark0 += gapLength; etable.shiftPc(where, gapLength, exclusive); if (line != null) line.shiftPc(where, gapLength, exclusive); if (vars != null) vars.shiftPc(where, gapLength, exclusive); if (types != null) types.shiftPc(where, gapLength, exclusive); if (stack != null) stack.shiftPc(where, gapLength, exclusive); if (stack2 != null) stack2.shiftPc(where, gapLength, exclusive); }
sm.insertLocal(where, StackMapTable.typeTagOf(typeDesc), classInfo);
= (StackMap)iterator.get().getAttribute(StackMap.tag); if (sm != null) sm.removeNew(pos);
((StackMap)ai).print(out); out.println("<stack map end>");
void shiftForSwitch(int where, int gapLength) throws BadBytecode { if (stack != null) stack.shiftForSwitch(where, gapLength); if (stack2 != null) stack2.shiftForSwitch(where, gapLength); } }
/** * Updates this stack map table when a new local variable is inserted * for a new parameter. * * @param index the index of the added local variable. * @param tag the type tag of that local variable. * It is available by <code>StackMapTable.typeTagOf(char)</code>. * @param classInfo the index of the <code>CONSTANT_Class_info</code> structure * in a constant pool table. This should be zero unless the tag * is <code>ITEM_Object</code>. * * @see javassist.CtBehavior#addParameter(javassist.CtClass) * @see StackMapTable#typeTagOf(char) * @see ConstPool */ public void insertLocal(int index, int tag, int classInfo) throws BadBytecode { byte[] data = new InsertLocal(this, index, tag, classInfo).doit(); this.set(data); }
void shiftPc(int where, int gapLength, boolean exclusive) throws BadBytecode { if (where < cursor || (where == cursor && exclusive)) cursor += gapLength; if (where < mark || (where == mark && exclusive)) mark += gapLength; if (where < mark0 || (where == mark0 && exclusive)) mark0 += gapLength; etable.shiftPc(where, gapLength, exclusive); if (line != null) line.shiftPc(where, gapLength, exclusive); if (vars != null) vars.shiftPc(where, gapLength, exclusive); if (types != null) types.shiftPc(where, gapLength, exclusive); if (stack != null) stack.shiftPc(where, gapLength, exclusive); if (stack2 != null) stack2.shiftPc(where, gapLength, exclusive); }
sm.insertLocal(where, StackMapTable.typeTagOf(typeDesc), classInfo);
= (StackMap)iterator.get().getAttribute(StackMap.tag); if (sm != null) sm.removeNew(pos);
((StackMap)ai).print(out); out.println("<stack map end>");
void shiftForSwitch(int where, int gapLength) throws BadBytecode { if (stack != null) stack.shiftForSwitch(where, gapLength); if (stack2 != null) stack2.shiftForSwitch(where, gapLength); } }
/** * Converts to a <code>StackMap</code> attribute. */ public StackMap toStackMap(ConstPool cp) { return new StackMap(cp, output.toByteArray()); }
/** * Undocumented method. Do not use; internal-use only. * * <p>This method is for javassist.convert.TransformNew. * It is called to update the stack map when * the NEW opcode (and the following DUP) is removed. * * @param where the position of the removed NEW opcode. */ public void removeNew(int where) throws CannotCompileException { byte[] data = new NewRemover(this, where).doit(); this.set(data); }
private static byte[] insertGapCore1(byte[] code, int where, int gapLength, boolean exclusive, ExceptionTable etable, CodeAttribute ca) throws BadBytecode, AlignmentException { int codeLength = code.length; byte[] newcode = new byte[codeLength + gapLength]; insertGap2(code, where, gapLength, codeLength, newcode, exclusive); etable.shiftPc(where, gapLength, exclusive); LineNumberAttribute na = (LineNumberAttribute)ca.getAttribute(LineNumberAttribute.tag); if (na != null) na.shiftPc(where, gapLength, exclusive); LocalVariableAttribute va = (LocalVariableAttribute)ca.getAttribute( LocalVariableAttribute.tag); if (va != null) va.shiftPc(where, gapLength, exclusive); LocalVariableAttribute vta = (LocalVariableAttribute)ca.getAttribute( LocalVariableAttribute.typeTag); if (vta != null) vta.shiftPc(where, gapLength, exclusive); StackMapTable smt = (StackMapTable)ca.getAttribute(StackMapTable.tag); if (smt != null) smt.shiftPc(where, gapLength, exclusive); StackMap sm = (StackMap)ca.getAttribute(StackMap.tag); if (sm != null) sm.shiftPc(where, gapLength, exclusive); return newcode; }
Copier(StackMap map, ConstPool newCp, Map<String,String> classnames) { super(map); srcCp = map.getConstPool(); dest = new byte[info.length]; destCp = newCp; this.classnames = classnames; } @Override
/** * Constructs a walker. */ public Walker(StackMap sm) { info = sm.get(); }