The index of the next instruction is set to the given index. The successive call to next() returns the index that has been given to move().
next()
move()
Note that the index is into the byte array returned by get().getCode(). @see CodeAttribute#getCode()
get().getCode()
8081828384858687888990
System.out.println("calleeClassName = " + calleeClassName); System.out.println("methodCall = " + methodCall.indexOfBytecode()); methodCall.replace("{java.lang.System.out.println($args[0]); $_=null;}"); try { CodeIterator it = where.getMethodInfo().getCodeAttribute().iterator(); it.move(methodCall.indexOfBytecode() - 5); System.out.println("it.get() = " + it.get()); it.next(); System.out.println("it.get() = " + it.get()); it.next(); System.out.println("it.get() = " + it.get());
100101102103104105106107108109110
methodCall.replace("{java.lang.System.out.println($args[0]); $_=null;}"); try { CodeIterator it = where.getMethodInfo().getCodeAttribute().iterator(); it.move(methodCall.indexOfBytecode()-5); System.out.println("it.get() = " + it.get()); it.next(); System.out.println("it.get() = " + it.get()); it.next(); System.out.println("it.get() = " + it.get()); it.next(); System.out.println("it.get() = " + it.get()); it.next(); } catch (Throwable t) {
219220221222223224225226227228229
// The instruction at which this local variable has been created Integer pc = localVariableAttribute.startPc(i); // Move to the next instruction (insertionPc) CodeIterator iterator = codeAttribute.iterator(); iterator.move(pc); Integer insertionPc = iterator.next(); Javac jv = new Javac(ctClass); // Compile the code snippet
186187188189190191192193194195196
107108109110111112113114115116117
StringBuffer trace = new StringBuffer(); try { if(frames[from].isAccessible) // already parsed return; CodeIterator iterator = context.behavior.getMethodInfo().getCodeAttribute().iterator(); iterator.move(from); Stack currentStack = stack.copy(); while(iterator.hasNext()) { int index = iterator.next(); Op op = Opcodes.OPCODES.get(iterator.byteAt(index)).init(context, index); trace.append("\n").append(index).append(":").append(op.getName()).append(" --> ");
222223224225226227228229230231232
// The instruction at which this local variable has been created Integer pc = localVariableAttribute.startPc(i); // Move to the next instruction (insertionPc) CodeIterator codeIterator = codeAttribute.iterator(); codeIterator.move(pc); pc = codeIterator.next(); Bytecode b = makeBytecodeForLVStore(method, localVariableAttribute.signature(i), name, localVariableAttribute.index(i)); codeIterator.insert(pc, b.get()); codeAttribute.setMaxStack(codeAttribute.computeMaxStack());
8283848586878889909192
8384858687888990919293