/** * Replaces all the instructions in this code block that match the * given template with the given instruction. After this method, * the iterator will be {@link #afterLast}. * * @return the number of substitutions made */ public int replace(Instruction template, Instruction with) { beforeFirst(); int count; for (count = 0; searchForward(template); count++) set(with); return count; }
private void readCode(DataInput in, int len) throws IOException { _head.next = _tail; _tail.prev = _head; _size = 0; _byteIndexesValid = true; beforeFirst(); Instruction ins; for (int byteIndex = 0; byteIndex < len;) { ins = createInstruction(in.readUnsignedByte()); _ci.addInternal(ins); ins.byteIndex = byteIndex; ins.read(in); byteIndex += ins.getLength(); } updateInstructionPointers(); beforeFirst(); // sanity check if (!_byteIndexesValid) throw new IllegalStateException(); }
/** * Replaces all the instructions in this code block that match the * given template with the given instruction. After this method, * the iterator will be {@link #afterLast}. * * @return the number of substitutions made */ public int replace(Instruction template, Instruction with) { beforeFirst(); int count; for (count = 0; searchForward(template); count++) set(with); return count; }
private void readCode(DataInput in, int len) throws IOException { _head.next = _tail; _tail.prev = _head; _size = 0; _byteIndexesValid = true; beforeFirst(); Instruction ins; for (int byteIndex = 0; byteIndex < len;) { ins = createInstruction(in.readUnsignedByte()); _ci.addInternal(ins); ins.byteIndex = byteIndex; ins.read(in); byteIndex += ins.getLength(); } updateInstructionPointers(); beforeFirst(); // sanity check if (!_byteIndexesValid) throw new IllegalStateException(); }
/** * Return the code for the method. If the code already exists, its * iterator will be reset to the first instruction. * Acts internally through the {@link Attributes} interface. * * @param add if true, a new code attribute will be added * if not already present * @return the code for the metohd, or null if none and the * <code>add</code> param is set to false */ public Code getCode(boolean add) { Code code = (Code) getAttribute(Constants.ATTR_CODE); if (code != null) { code.beforeFirst(); return code; } if (!add) return null; return (Code) addAttribute(Constants.ATTR_CODE); }
/** * Return the code for the method. If the code already exists, its * iterator will be reset to the first instruction. * Acts internally through the {@link Attributes} interface. * * @param add if true, a new code attribute will be added * if not already present * @return the code for the metohd, or null if none and the * <code>add</code> param is set to false */ public Code getCode(boolean add) { Code code = (Code) getAttribute(Constants.ATTR_CODE); if (code != null) { code.beforeFirst(); return code; } if (!add) return null; return (Code) addAttribute(Constants.ATTR_CODE); }
/** * Adds a custom readObject method that delegates to the * {@link ObjectInputStream#readObject} method. */ private void modifyReadObjectMethod(BCMethod method, boolean full) { Code code = method.getCode(true); code.beforeFirst(); // if this instance uses synthetic detached state, note that it has // been deserialized if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) { loadManagedInstance(code, false); code.getstatic().setField(PersistenceCapable.class, "DESERIALIZED", Object.class); code.invokevirtual().setMethod(PRE + "SetDetachedState", void.class, new Class[]{ Object.class }); } if (full) { // in.defaultReadObject (); code.aload().setParam(0); code.invokevirtual().setMethod(ObjectInputStream.class, "defaultReadObject", void.class, null); code.vreturn(); } code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Adds a custom readObject method that delegates to the * {@link ObjectInputStream#readObject} method. */ private void modifyReadObjectMethod(BCMethod method, boolean full) { Code code = method.getCode(true); code.beforeFirst(); // if this instance uses synthetic detached state, note that it has // been deserialized if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) { loadManagedInstance(code, false); code.getstatic().setField(PersistenceCapable.class, "DESERIALIZED", Object.class); code.invokevirtual().setMethod(PRE + "SetDetachedState", void.class, new Class[]{ Object.class }); } if (full) { // in.defaultReadObject (); code.aload().setParam(0); code.invokevirtual().setMethod(ObjectInputStream.class, "defaultReadObject", void.class, null); code.vreturn(); } code.calculateMaxStack(); code.calculateMaxLocals(); }
_size = 0; _byteIndexesValid = false; beforeFirst(); _handlers.clear(); ((ConstantInstruction) copy).read((Instruction) entry); beforeFirst();
if (code == null) return null; code.beforeFirst();
if (code == null) return null; code.beforeFirst();
/** * Adds a custom readObject method that delegates to the * {@link ObjectInputStream#readObject} method. */ private void modifyReadObjectMethod(BCMethod method, boolean full) { Code code = method.getCode(true); code.beforeFirst(); // if this instance uses synthetic detached state, note that it has // been deserialized if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) { loadManagedInstance(code, false); code.getstatic().setField(PersistenceCapable.class, "DESERIALIZED", Object.class); code.invokevirtual().setMethod(PRE + "SetDetachedState", void.class, new Class[]{ Object.class }); } if (full) { // in.defaultReadObject (); code.aload().setParam(0); code.invokevirtual().setMethod(ObjectInputStream.class, "defaultReadObject", void.class, null); code.vreturn(); } code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Adds a custom readObject method that delegates to the * {@link ObjectInputStream#readObject} method. */ private void modifyReadObjectMethod(BCMethod method, boolean full) { Code code = method.getCode(true); code.beforeFirst(); // if this instance uses synthetic detached state, note that it has // been deserialized if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) { loadManagedInstance(code, false); code.getstatic().setField(PersistenceCapable.class, "DESERIALIZED", Object.class); code.invokevirtual().setMethod(PRE + "SetDetachedState", void.class, new Class[]{ Object.class }); } if (full) { // in.defaultReadObject (); code.aload().setParam(0); code.invokevirtual().setMethod(ObjectInputStream.class, "defaultReadObject", void.class, null); code.vreturn(); } code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Adds a custom readObject method that delegates to the * {@link ObjectInputStream#readObject} method. */ private void modifyReadObjectMethod(BCMethod method, boolean full) { Code code = method.getCode(true); code.beforeFirst(); // if this instance uses synthetic detached state, note that it has // been deserialized if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) { loadManagedInstance(code, false); code.getstatic().setField(PersistenceCapable.class, "DESERIALIZED", Object.class); code.invokevirtual().setMethod(PRE + "SetDetachedState", void.class, new Class[]{ Object.class }); } if (full) { // in.defaultReadObject (); code.aload().setParam(0); code.invokevirtual().setMethod(ObjectInputStream.class, "defaultReadObject", void.class, null); code.vreturn(); } code.calculateMaxStack(); code.calculateMaxLocals(); }
code.beforeFirst(); JumpInstruction toret; Instruction ret; code.beforeFirst(); while (code.searchForward(tmplate)) { ret = code.previous();
code.beforeFirst(); JumpInstruction toret; Instruction ret; code.beforeFirst(); while (code.searchForward(tmplate)) { ret = code.previous();
code.beforeFirst(); if (code.searchForward(template)) {
code.beforeFirst(); JumpInstruction toret; Instruction ret; code.beforeFirst(); while (code.searchForward(tmplate)) { ret = code.previous();
code.beforeFirst(); JumpInstruction toret; Instruction ret; code.beforeFirst(); while (code.searchForward(tmplate)) { ret = code.previous();
code.beforeFirst(); JumpInstruction toret; Instruction ret; code.beforeFirst(); while (code.searchForward(tmplate)) { ret = code.previous();