protected void replace0(int pos, Bytecode bytecode, int size) throws BadBytecode { byte[] code = bytecode.get(); edited = true; int gap = code.length - size; for (int i = 0; i < size; ++i) iterator.writeByte(NOP, pos + i); if (gap > 0) pos = iterator.insertGapAt(pos, gap, false).position; iterator.write(code, pos); iterator.insert(bytecode.getExceptionTable(), pos); maxLocals = bytecode.getMaxLocals(); maxStack = bytecode.getMaxStack(); }
/** * Converts to a <code>CodeAttribute</code>. */ public CodeAttribute toCodeAttribute() { return new CodeAttribute(constPool, maxStack, maxLocals, get(), tryblocks); }
private static void insertAuxInitializer(CodeAttribute codeAttr, Bytecode initializer, int stacksize) throws BadBytecode { CodeIterator it = codeAttr.iterator(); int index = it.skipSuperConstructor(); if (index < 0) { index = it.skipThisConstructor(); if (index >= 0) return; // this() is called. // Neither this() or super() is called. } int pos = it.insertEx(initializer.get()); it.insert(initializer.getExceptionTable(), pos); int maxstack = codeAttr.getMaxStack(); if (maxstack < stacksize) codeAttr.setMaxStack(stacksize); }
protected void replace0(int pos, Bytecode bytecode, int size) throws BadBytecode { byte[] code = bytecode.get(); edited = true; int gap = code.length - size; for (int i = 0; i < size; ++i) iterator.writeByte(NOP, pos + i); if (gap > 0) pos = iterator.insertGapAt(pos, gap, false).position; iterator.write(code, pos); iterator.insert(bytecode.getExceptionTable(), pos); maxLocals = bytecode.getMaxLocals(); maxStack = bytecode.getMaxStack(); }
private static void insertAuxInitializer(CodeAttribute codeAttr, Bytecode initializer, int stacksize) throws BadBytecode { CodeIterator it = codeAttr.iterator(); int index = it.skipSuperConstructor(); if (index < 0) { index = it.skipThisConstructor(); if (index >= 0) return; // this() is called. // Neither this() or super() is called. } int pos = it.insertEx(initializer.get()); it.insert(initializer.getExceptionTable(), pos); int maxstack = codeAttr.getMaxStack(); if (maxstack < stacksize) codeAttr.setMaxStack(stacksize); }
/** * Converts to a <code>CodeAttribute</code>. */ public CodeAttribute toCodeAttribute() { return new CodeAttribute(constPool, maxStack, maxLocals, get(), tryblocks); }
maxLocals = b.getMaxLocals(); int pos = iterator.append(b.get()); iterator.append(b.getExceptionTable(), pos); etable.setHandlerPc(index, pos);
int pos = it.insertEx(code.get()); it.insert(code.getExceptionTable(), pos); int maxstack = codeAttr.getMaxStack();
protected void makeCode(CtClass[] paramTypes, ConstPool cp) { Bytecode save = new Bytecode(cp, 0, 0); Bytecode load = new Bytecode(cp, 0, 0); int var = maxLocals; int len = (paramTypes == null) ? 0 : paramTypes.length; load.addAload(var); makeCode2(save, load, 0, len, paramTypes, var + 1); save.addAstore(var); saveCode = save.get(); loadCode = load.get(); }
ca.setMaxLocals(b.getMaxLocals()); iterator.skipConstructor(); int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
int pos = it.insertEx(code.get()); it.insert(code.getExceptionTable(), pos); int maxstack = codeAttr.getMaxStack();
protected void makeCode(CtClass[] paramTypes, ConstPool cp) { Bytecode save = new Bytecode(cp, 0, 0); Bytecode load = new Bytecode(cp, 0, 0); int var = maxLocals; int len = (paramTypes == null) ? 0 : paramTypes.length; load.addAload(var); makeCode2(save, load, 0, len, paramTypes, var + 1); save.addAstore(var); saveCode = save.get(); loadCode = load.get(); }
ca.setMaxLocals(locals); int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); if (rebuild)
maxLocals = b.getMaxLocals(); int pos = iterator.append(b.get()); iterator.append(b.getExceptionTable(), pos); etable.setHandlerPc(index, pos);
ca.setMaxStack(stack); index = iterator.insertAt(index, b.get()); iterator.insert(b.getExceptionTable(), index); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
ca.setMaxLocals(b.getMaxLocals()); iterator.skipConstructor(); int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
int pos = iterator.append(b.get()); ca.getExceptionTable().add(getStartPosOfBody(ca), len, len, cp.addClassInfo(exceptionType));
ca.setMaxLocals(locals); int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); if (rebuild)
int pos = iterator.append(b.get()); ca.getExceptionTable().add(getStartPosOfBody(ca), len, len, cp.addClassInfo(exceptionType));