/** * Place the iterator after the given list index. */ public void after(int index) { before(index); next(); }
/** * Position the iterator just after the given instruction. The * instruction must belong to this method. */ public void after(Instruction ins) { before(ins); next(); }
/** * Position the iterator just after the given instruction. The * instruction must belong to this method. */ public void after(Instruction ins) { before(ins); next(); }
/** * Place the iterator after the given list index. */ public void after(int index) { before(index); next(); }
/** * Find the next instruction from the current iterator position that * matches the given one, according to the {@link Object#equals} methods of * the instruction types. This allows for matching based on template * instructions, as the equals methods of most instructions return * true if the information for the given instruction has not been filled * in. If a match is found, the iterator is placed after the matching * Instruction. If no match is found, moves the iterator to * {@link #afterLast}. * * @return true if match found */ public boolean searchForward(Instruction template) { if (template == null) return false; while (hasNext()) if (template.equalsInstruction(next())) return true; return false; }
/** * Find the next instruction from the current iterator position that * matches the given one, according to the {@link Object#equals} methods of * the instruction types. This allows for matching based on template * instructions, as the equals methods of most instructions return * true if the information for the given instruction has not been filled * in. If a match is found, the iterator is placed after the matching * Instruction. If no match is found, moves the iterator to * {@link #afterLast}. * * @return true if match found */ public boolean searchForward(Instruction template) { if (template == null) return false; while (hasNext()) if (template.equalsInstruction(next())) return true; return false; }
/** * Set the name of the class to load. */ private void setClassName(String name, Class wrapper) { if (_invalid) throw new IllegalStateException(); // remember the position of the code iterator Instruction before = (_code.hasNext()) ? _code.next() : null; _code.before(_ins); _code.next(); if (wrapper != null) _code.getstatic().setField(wrapper, "TYPE", Class.class); else setObject(name); // move to the old position if (before != null) _code.before(before); else _code.afterLast(); _invalid = true; }
/** * Set the name of the class to load. */ private void setClassName(String name, Class wrapper) { if (_invalid) throw new IllegalStateException(); // remember the position of the code iterator Instruction before = (_code.hasNext()) ? _code.next() : null; _code.before(_ins); _code.next(); if (wrapper != null) _code.getstatic().setField(wrapper, "TYPE", Class.class); else setObject(name); // move to the old position if (before != null) _code.before(before); else _code.afterLast(); _invalid = true; }
code.next(); backupCount--;
code.next(); backupCount--;
code.previous(); code.set(template.nop()); code.next();
code.previous(); code.set(template.nop()); code.next();
code.previous(); code.set(template.nop()); code.next();
code.previous(); code.set(template.nop()); code.next();
code.previous(); code.set(template.nop()); code.next();
void.class, new Class[]{ Object.class }); toret.setTarget(ret); code.next(); // jump over return
void.class, new Class[]{ Object.class }); toret.setTarget(ret); code.next(); // jump over return
void.class, new Class[]{ Object.class }); toret.setTarget(ret); code.next(); // jump over return
void.class, new Class[]{ Object.class }); toret.setTarget(ret); code.next(); // jump over return
void.class, new Class[]{ Object.class }); toret.setTarget(ret); code.next(); // jump over return