You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pc...@apache.org on 2006/07/01 00:37:29 UTC
svn commit: r418401 [24/32] - in /incubator/openjpa/trunk: openjpa-lib/
openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/
openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/
openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/ openjpa-lib/src/...
Modified: incubator/openjpa/trunk/serp/src/main/java/serp/bytecode/Code.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/serp/src/main/java/serp/bytecode/Code.java?rev=418401&r1=418400&r2=418401&view=diff
==============================================================================
--- incubator/openjpa/trunk/serp/src/main/java/serp/bytecode/Code.java (original)
+++ incubator/openjpa/trunk/serp/src/main/java/serp/bytecode/Code.java Fri Jun 30 15:37:18 2006
@@ -1,13 +1,10 @@
/*
* Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
@@ -15,42 +12,37 @@
*/
package serp.bytecode;
-import serp.bytecode.lowlevel.*;
-
-import serp.bytecode.visitor.*;
-
import java.io.*;
-
import java.util.*;
-
+import serp.bytecode.lowlevel.*;
+import serp.bytecode.visitor.*;
/**
- * <p>Representation of a code block of a class.
- * The methods of this class mimic those of the same name in the
- * {@link java.util.ListIterator} class. Note that the size and index
- * information of the code block will change as opcodes are added.</p>
- *
- * <p>Code blocks are usually obtained from a {@link BCMethod}, but can also
- * be constructed via the default constructor. Blocks created this way can
- * be used to provide template instructions to the various search/replace
- * methods in this class.</p>
- *
- * <p>The code class contains methods named after most JVM instructions, each
- * of which adds the matching opcode to the code block at the
- * current iterator position. It also contains generic versions of various
- * JVM instructions whose opcodes are not set until their properties are set
- * with additional information. Almost all instruction types are able to
- * 'morph' their opcode on the fly as the arguments to the instruction change.
- * Thus the developer can initially call, for example, the <code>aload</code>
- * opcode, but later change the type to load to <code>int</code> and the
- * opcode will automatically morph to the <code>iload</code> opcode.</p>
- *
- * @author Abe White
+ * Representation of a code block of a class.
+ * The methods of this class mimic those of the same name in the
+ * {@link java.util.ListIterator} class. Note that the size and index
+ * information of the code block will change as opcodes are added.
+ * Code blocks are usually obtained from a {@link BCMethod}, but can also
+ * be constructed via the default constructor. Blocks created this way can
+ * be used to provide template instructions to the various search/replace
+ * methods in this class.
+ * The code class contains methods named after most JVM instructions, each
+ * of which adds the matching opcode to the code block at the
+ * current iterator position. It also contains generic versions of various
+ * JVM instructions whose opcodes are not set until their properties are set
+ * with additional information. Almost all instruction types are able to
+ * 'morph' their opcode on the fly as the arguments to the instruction change.
+ * Thus the developer can initially call, for example, the <code>aload</code>
+ * opcode, but later change the type to load to <code>int</code> and the
+ * opcode will automatically morph to the <code>iload</code> opcode.
+ *
+ * @author Abe White
*/
public class Code extends Attribute {
private final CodeEntry _head;
private final CodeEntry _tail;
private CodeIterator _ci;
+
private int _maxStack = 0;
private int _maxLocals = 0;
private int _size = 0;
@@ -69,21 +61,20 @@
}
/**
- * The public constructor is for creating template code modules
- * that produce {@link Instruction}s used in matching through
- * the various <code>search</code> and <code>replace</code>
- * methods.
+ * The public constructor is for creating template code modules
+ * that produce {@link Instruction}s used in matching through
+ * the various <code>search</code> and <code>replace</code> methods.
*/
public Code() {
- this(0,
- new Project().loadClass("", null).declareMethod("", void.class, null));
+ this(0, new Project().loadClass("", null).
+ declareMethod("", void.class, null));
}
/**
- * The owning method.
+ * The owning method.
*/
public BCMethod getMethod() {
- return (BCMethod) getOwner();
+ return(BCMethod) getOwner();
}
Collection getAttributesHolder() {
@@ -95,154 +86,129 @@
////////////////////////////
/**
- * Return the maximum stack depth set for this code block.
+ * Return the maximum stack depth set for this code block.
*/
public int getMaxStack() {
return _maxStack;
}
/**
- * Set the maximum stack depth for this code block.
+ * Set the maximum stack depth for this code block.
*/
public void setMaxStack(int max) {
_maxStack = max;
}
/**
- * Return the maximum number of local variables (including params)
- * set for this method.
+ * Return the maximum number of local variables(including params)
+ * set for this method.
*/
public int getMaxLocals() {
return _maxLocals;
}
/**
- * Set the maximum number of local variables (including params) in
- * this method.
+ * Set the maximum number of local variables(including params) in
+ * this method.
*/
public void setMaxLocals(int max) {
_maxLocals = max;
}
/**
- * Return the local variable index for the paramIndex'th parameter to
- * the method. Local variable indexes differ from parameter indexes
- * because:
- * a) non-static methods use the 0th local variable for the 'this' ptr, and
- * b) double and long values occupy two spots in the local
- * variable array.
- * Returns -1 if the given index is not valid.
+ * Return the local variable index for the paramIndex'th parameter to
+ * the method. Local variable indexes differ from parameter indexes because:
+ * a) non-static methods use the 0th local variable for the 'this' ptr, and
+ * b) double and long values occupy two spots in the local variable array.
+ * Returns -1 if the given index is not valid.
*/
public int getLocalsIndex(int paramIndex) {
- if (paramIndex < 0) {
+ if (paramIndex < 0)
return -1;
- }
int pos = 0;
-
- if (!getMethod().isStatic()) {
+ if (!getMethod().isStatic())
pos = 1;
- }
String[] params = getMethod().getParamNames();
-
for (int i = 0; i < paramIndex; i++, pos++) {
- if (i == params.length) {
+ if (i == params.length)
return -1;
- }
-
- if (params[i].equals(long.class.getName()) ||
- params[i].equals(double.class.getName())) {
+ if (params[i].equals(long.class.getName())
+ || params[i].equals(double.class.getName()))
pos++;
- }
}
return pos;
}
/**
- * Return the parameter index for the given local index, or -1 if
- * the given local does not reference a param.
- *
- * @see #getLocalsIndex
+ * Return the parameter index for the given local index, or -1 if
+ * the given local does not reference a param.
+ *
+ * @see #getLocalsIndex
*/
public int getParamsIndex(int localIndex) {
int pos = 0;
-
- if (!getMethod().isStatic()) {
+ if (!getMethod().isStatic())
pos = 1;
- }
String[] params = getMethod().getParamNames();
-
for (int i = 0; i < params.length; i++, pos++) {
- if (localIndex == pos) {
+ if (localIndex == pos)
return i;
- }
-
- if (params[i].equals(long.class.getName()) ||
- params[i].equals(double.class.getName())) {
+ if (params[i].equals(long.class.getName())
+ || params[i].equals(double.class.getName()))
pos++;
- }
}
return -1;
}
/**
- * Return the next available local variable index.
+ * Return the next available local variable index.
*/
public int getNextLocalsIndex() {
calculateMaxLocals();
-
return getMaxLocals();
}
/**
- * Calculate and set the number of locals needed based on
- * the instructions used and the parameters of the method this code
- * block is a part of.
- *
- * @see #setMaxLocals
+ * Calculate and set the number of locals needed based on
+ * the instructions used and the parameters of the method this code
+ * block is a part of.
+ *
+ * @see #setMaxLocals
*/
public void calculateMaxLocals() {
- // start off assuming the max number needed is the
+ // start off assuming the max number needed is the
// number for all the params
String[] params = getMethod().getParamNames();
int max = 0;
-
- if ((params.length == 0) && !getMethod().isStatic()) {
+ if (params.length == 0 && !getMethod().isStatic())
max = 1;
- } else if (params.length > 0) {
+ else if (params.length > 0) {
max = getLocalsIndex(params.length - 1) + 1;
-
- if (params[params.length - 1].equals(long.class.getName()) ||
- params[params.length - 1].equals(double.class.getName())) {
+ if (params[params.length - 1].equals(long.class.getName())
+ || params[params.length - 1].equals(double.class.getName()))
max++;
- }
}
// check to see if there are any store instructions that
// try to reference beyond that point
StoreInstruction store;
int current;
-
- for (CodeEntry entry = _head.next; entry != _tail;
- entry = entry.next) {
+ for (CodeEntry entry = _head.next; entry != _tail; entry = entry.next) {
current = 0;
-
if (entry instanceof StoreInstruction) {
store = (StoreInstruction) entry;
current = store.getLocal() + 1;
-
- if (store.getType().equals(long.class) ||
- store.getType().equals(double.class)) {
+ if (store.getType().equals(long.class)
+ || store.getType().equals(double.class))
current++;
- }
- if (current > max) {
+ if (current > max)
max = current;
- }
}
}
@@ -250,10 +216,10 @@
}
/**
- * Calculate and set the maximum stack depth needed for
- * the instructions used.
- *
- * @see #setMaxStack
+ * Calculate and set the maximum stack depth needed for
+ * the instructions used.
+ *
+ * @see #setMaxStack
*/
public void calculateMaxStack() {
int stack = 0;
@@ -261,22 +227,18 @@
ExceptionHandler[] handlers = getExceptionHandlers();
Instruction ins;
-
- for (CodeEntry entry = _head.next; entry != _tail;
- entry = entry.next) {
+ for (CodeEntry entry = _head.next; entry != _tail; entry = entry.next) {
ins = (Instruction) entry;
stack += ins.getStackChange();
// if this is the start of a try, the exception will be placed
// on the stack
for (int j = 0; j < handlers.length; j++)
- if (handlers[j].getTryStart() == ins) {
+ if (handlers[j].getTryStart() == ins)
stack++;
- }
- if (stack > max) {
+ if (stack > max)
max = stack;
- }
}
setMaxStack(max);
@@ -287,151 +249,139 @@
///////////////////////////////
/**
- * Return the exception handlers active in this code block, or an
- * empty array if none.
+ * Return the exception handlers active in this code block, or an
+ * empty array if none.
*/
public ExceptionHandler[] getExceptionHandlers() {
- return (ExceptionHandler[]) _handlers.toArray(new ExceptionHandler[_handlers.size()]);
+ return(ExceptionHandler[]) _handlers.toArray
+ (new ExceptionHandler[_handlers.size()]);
}
/**
- * Return the exception handler that catches the given exception type;
- * if multiple handlers catch the given type, which is returned is
- * undefined.
+ * Return the exception handler that catches the given exception type;
+ * if multiple handlers catch the given type, which is returned is
+ * undefined.
*/
public ExceptionHandler getExceptionHandler(String catchType) {
- catchType = getProject().getNameCache().getExternalForm(catchType, false);
+ catchType = getProject().getNameCache().
+ getExternalForm(catchType, false);
String type;
ExceptionHandler[] handlers = getExceptionHandlers();
-
for (int i = 0; i < handlers.length; i++) {
type = handlers[i].getCatchName();
- if (((type == null) && (catchType == null)) ||
- ((type != null) && type.equals(catchType))) {
+ if ((type == null && catchType == null)
+ || (type != null && type.equals(catchType)))
return handlers[i];
- }
}
return null;
}
/**
- * Return the exception handler that catches the given exception type;
- * if multiple handlers catch the given type, which is returned is
- * undefined.
+ * Return the exception handler that catches the given exception type;
+ * if multiple handlers catch the given type, which is returned is
+ * undefined.
*/
public ExceptionHandler getExceptionHandler(Class catchType) {
- if (catchType == null) {
+ if (catchType == null)
return getExceptionHandler((String) null);
- }
-
return getExceptionHandler(catchType.getName());
}
/**
- * Return the exception handler that catches the given exception type;
- * if multiple handlers catch the given type, which is returned is
- * undefined.
+ * Return the exception handler that catches the given exception type;
+ * if multiple handlers catch the given type, which is returned is
+ * undefined.
*/
public ExceptionHandler getExceptionHandler(BCClass catchType) {
- if (catchType == null) {
+ if (catchType == null)
return getExceptionHandler((String) null);
- }
-
return getExceptionHandler(catchType.getName());
}
/**
- * Return all exception handlers that catch the given exception type,
- * or an empty array if none.
+ * Return all exception handlers that catch the given exception type,
+ * or an empty array if none.
*/
public ExceptionHandler[] getExceptionHandlers(String catchType) {
- catchType = getProject().getNameCache().getExternalForm(catchType, false);
+ catchType = getProject().getNameCache().
+ getExternalForm(catchType, false);
List matches = new LinkedList();
String type;
ExceptionHandler[] handlers = getExceptionHandlers();
-
for (int i = 0; i < handlers.length; i++) {
type = handlers[i].getCatchName();
- if (((type == null) && (catchType == null)) ||
- ((type != null) && type.equals(catchType))) {
+ if ((type == null && catchType == null)
+ || (type != null && type.equals(catchType)))
matches.add(handlers[i]);
- }
}
- return (ExceptionHandler[]) matches.toArray(new ExceptionHandler[matches.size()]);
+ return(ExceptionHandler[]) matches.toArray
+ (new ExceptionHandler[matches.size()]);
}
/**
- * Return all exception handlers that catch the given exception type,
- * or an empty array if none.
+ * Return all exception handlers that catch the given exception type,
+ * or an empty array if none.
*/
public ExceptionHandler[] getExceptionHandlers(Class catchType) {
- if (catchType == null) {
+ if (catchType == null)
return getExceptionHandlers((String) null);
- }
-
return getExceptionHandlers(catchType.getName());
}
/**
- * Return all exception handlers that catch the given exception type,
- * or an empty array if none.
+ * Return all exception handlers that catch the given exception type,
+ * or an empty array if none.
*/
public ExceptionHandler[] getExceptionHandlers(BCClass catchType) {
- if (catchType == null) {
+ if (catchType == null)
return getExceptionHandlers((String) null);
- }
-
return getExceptionHandlers(catchType.getName());
}
/**
- * Set the exception handlers for this code block. This method is useful
- * for importing all handlers from another code block. Set to null or
- * empty array if none.
+ * Set the exception handlers for this code block. This method is useful
+ * for importing all handlers from another code block. Set to null or
+ * empty array if none.
*/
public void setExceptionHandlers(ExceptionHandler[] handlers) {
clearExceptionHandlers();
-
- if (handlers != null) {
+ if (handlers != null)
for (int i = 0; i < handlers.length; i++)
addExceptionHandler(handlers[i]);
- }
}
/**
- * Import the given exception handler from another code block.
- */
+ * Import the given exception handler from another code block.
+ */
public ExceptionHandler addExceptionHandler(ExceptionHandler handler) {
ExceptionHandler newHandler = addExceptionHandler();
newHandler.read(handler);
-
return newHandler;
}
/**
- * Add an exception handler to this code block.
+ * Add an exception handler to this code block.
*/
public ExceptionHandler addExceptionHandler() {
ExceptionHandler handler = new ExceptionHandler(this);
_handlers.add(handler);
-
return handler;
}
/**
- * Add an exception handler to this code block.
- *
- * @param tryStart the first instruction of the try {} block
- * @param tryEnd the last instruction of the try {} block
- * @param handlerStart the first instruction of the catch {} block
- * @param catchType the type of exception being caught
- */
+ * Add an exception handler to this code block.
+ *
+ * @param tryStart the first instruction of the try {} block
+ * @param tryEnd the last instruction of the try {} block
+ * @param handlerStart the first instruction of the catch {} block
+ * @param catchType the type of exception being caught
+ */
public ExceptionHandler addExceptionHandler(Instruction tryStart,
Instruction tryEnd, Instruction handlerStart, String catchType) {
ExceptionHandler handler = addExceptionHandler();
@@ -439,54 +389,46 @@
handler.setTryEnd(tryEnd);
handler.setHandlerStart(handlerStart);
handler.setCatch(catchType);
-
return handler;
}
/**
- * Add an exception handler to this code block.
- *
- * @param tryStart the first instruction of the try {} block
- * @param tryEnd the last instruction of the try {} block
- * @param handlerStart the first instruction of the catch {} block
- * @param catchType the type of exception being caught
+ * Add an exception handler to this code block.
+ *
+ * @param tryStart the first instruction of the try {} block
+ * @param tryEnd the last instruction of the try {} block
+ * @param handlerStart the first instruction of the catch {} block
+ * @param catchType the type of exception being caught
*/
public ExceptionHandler addExceptionHandler(Instruction tryStart,
Instruction tryEnd, Instruction handlerStart, Class catchType) {
String catchName = null;
-
- if (catchType != null) {
+ if (catchType != null)
catchName = catchType.getName();
- }
-
return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName);
}
/**
- * Add an exception handler to this code block.
- *
- * @param tryStart the first instruction of the try {} block
- * @param tryEnd the last instruction of the try {} block
- * @param handlerStart the first instruction of the catch {} block
- * @param catchType the type of exception being caught
+ * Add an exception handler to this code block.
+ *
+ * @param tryStart the first instruction of the try {} block
+ * @param tryEnd the last instruction of the try {} block
+ * @param handlerStart the first instruction of the catch {} block
+ * @param catchType the type of exception being caught
*/
public ExceptionHandler addExceptionHandler(Instruction tryStart,
Instruction tryEnd, Instruction handlerStart, BCClass catchType) {
String catchName = null;
-
- if (catchType != null) {
+ if (catchType != null)
catchName = catchType.getName();
- }
-
return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName);
}
/**
- * Clear all exception handlers.
+ * Clear all exception handlers.
*/
public void clearExceptionHandlers() {
ExceptionHandler handler;
-
for (Iterator itr = _handlers.iterator(); itr.hasNext();) {
handler = (ExceptionHandler) itr.next();
itr.remove();
@@ -495,49 +437,43 @@
}
/**
- * Remove the exception handler that catches the given type.
+ * Remove the exception handler that catches the given type.
*/
public boolean removeExceptionHandler(String catchType) {
return removeExceptionHandler(getExceptionHandler(catchType));
}
/**
- * Remove the exception handler that catches the given type.
- *
- * @return true if the handler was removed, false otherwise
+ * Remove the exception handler that catches the given type.
+ *
+ * @return true if the handler was removed, false otherwise
*/
public boolean removeExceptionHandler(Class catchType) {
- if (catchType == null) {
+ if (catchType == null)
return removeExceptionHandler((String) null);
- }
-
return removeExceptionHandler(catchType.getName());
}
/**
- * Remove the exception handler that catches the given type.
- *
- * @return true if the handler was removed, false otherwise
+ * Remove the exception handler that catches the given type.
+ *
+ * @return true if the handler was removed, false otherwise
*/
public boolean removeExceptionHandler(BCClass catchType) {
- if (catchType == null) {
+ if (catchType == null)
return removeExceptionHandler((String) null);
- }
-
return removeExceptionHandler(catchType.getName());
}
/**
- * Remove an exception handler from this code block. The given handler
- * must belong to this code block.
+ * Remove an exception handler from this code block. The given handler
+ * must belong to this code block.
*/
public boolean removeExceptionHandler(ExceptionHandler handler) {
- if ((handler == null) || !_handlers.remove(handler)) {
+ if (handler == null || !_handlers.remove(handler))
return false;
- }
handler.invalidate();
-
return true;
}
@@ -546,45 +482,42 @@
/////////////////////////
/**
- * Return the number of instructions in the method.
+ * Return the number of instructions in the method.
*/
public int size() {
return _size;
}
/**
- * Reset the position of the instruction iterator to the first opcode.
+ * Reset the position of the instruction iterator to the first opcode.
*/
public void beforeFirst() {
_ci = new CodeIterator(_head, -1);
}
/**
- * Set the position of the instruction iterator to after the last opcode.
+ * Set the position of the instruction iterator to after the last opcode.
*/
public void afterLast() {
- if (_size == 0) {
+ if (_size == 0)
_ci = new CodeIterator(_head, -1);
- } else {
+ else
_ci = new CodeIterator(_tail.prev, _size - 1);
- }
}
/**
- * Position the iterator just before the given instruction. The
- * instruction must belong to this method.
+ * Position the iterator just before the given instruction. The
+ * instruction must belong to this method.
*/
public void before(Instruction ins) {
- if (ins.getCode() != this) {
+ if (ins.getCode() != this)
throw new IllegalArgumentException("ins.code != this");
- }
-
_ci = new CodeIterator(ins.prev, CodeIterator.UNSET);
}
/**
- * Position the iterator just after the given instruction. The
- * instruction must belong to this method.
+ * Position the iterator just after the given instruction. The
+ * instruction must belong to this method.
*/
public void after(Instruction ins) {
before(ins);
@@ -592,67 +525,63 @@
}
/**
- * Return true if a subsequent call to {@link #next} will return an
- * instruction.
+ * Return true if a subsequent call to {@link #next} will return an
+ * instruction.
*/
public boolean hasNext() {
return _ci.hasNext();
}
/**
- * Return true if a subsequent call to {@link #previous} will return an
- * instruction.
+ * Return true if a subsequent call to {@link #previous} will return an
+ * instruction.
*/
public boolean hasPrevious() {
return _ci.hasPrevious();
}
/**
- * Return the next instruction.
+ * Return the next instruction.
*/
public Instruction next() {
- return (Instruction) _ci.next();
+ return(Instruction) _ci.next();
}
/**
- * Return the index of the next instruction, or {@link #size} if at end.
+ * Return the index of the next instruction, or {@link #size} if at end.
*/
public int nextIndex() {
return _ci.nextIndex();
}
/**
- * Return the previous instruction.
+ * Return the previous instruction.
*/
public Instruction previous() {
- return (Instruction) _ci.previous();
+ return(Instruction) _ci.previous();
}
/**
- * Return the index of the previous instruction, or -1 if at beginning.
+ * Return the index of the previous instruction, or -1 if at beginning.
*/
public int previousIndex() {
return _ci.previousIndex();
}
/**
- * Place the iterator before the given list index.
+ * Place the iterator before the given list index.
*/
public void before(int index) {
- if ((index < 0) || (index >= _size)) {
+ if (index < 0 || index >= _size)
throw new IndexOutOfBoundsException(String.valueOf(index));
- }
CodeEntry entry = _head;
-
- for (int i = 0; i < index; entry = entry.next, i++)
- ;
-
+ for (int i = 0; i < index; entry = entry.next, i++);
_ci = new CodeIterator(entry, index - 1);
}
/**
- * Place the iterator after the given list index.
+ * Place the iterator after the given list index.
*/
public void after(int index) {
before(index);
@@ -660,131 +589,112 @@
}
/**
- * 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
+ * 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) {
+ if (template == null)
return false;
- }
-
while (hasNext())
-
- if (template.equalsInstruction(next())) {
+ if (template.equalsInstruction(next()))
return true;
- }
-
return false;
}
/**
- * Find the closest previous 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 before the matching Instruction. If no match is found,
- * moves the iterator to {@link #beforeFirst}.
- *
- * @return true if match found
+ * Find the closest previous 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 before the matching Instruction. If no match is found,
+ * moves the iterator to {@link #beforeFirst}.
+ *
+ * @return true if match found
*/
public boolean searchBackward(Instruction template) {
- if (template == null) {
+ if (template == null)
return false;
- }
-
while (hasPrevious())
-
- if (template.equalsInstruction(previous())) {
+ if (template.equalsInstruction(previous()))
return true;
- }
-
return false;
}
/**
- * Adds a copy of the given instruction.
- *
- * @return the newly added instruction
+ * Adds a copy of the given instruction.
+ *
+ * @return the newly added instruction
*/
public Instruction add(Instruction ins) {
Instruction newIns = createInstruction(ins.getOpcode());
newIns.read(ins);
_ci.add(newIns);
-
return newIns;
}
/**
- * Replaces the last iterated instruction with a copy of the given one.
- * This method will also make sure that all jump points
- * that referenced the old opcode are updated correctly.
- *
- * @return the newly added instruction
- *
- * @see ListIterator#set
+ * Replaces the last iterated instruction with a copy of the given one.
+ * This method will also make sure that all jump points
+ * that referenced the old opcode are updated correctly.
+ *
+ * @return the newly added instruction
+ *
+ * @see ListIterator#set
*/
public Instruction set(Instruction ins) {
Instruction newIns = createInstruction(ins.getOpcode());
newIns.read(ins);
_ci.set(newIns);
-
return newIns;
}
/**
- * 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
+ * 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;
}
/**
- * Equivalent to looping over each given template/replacement
- * pair and calling {@link #replace(Instruction,Instruction)} for each.
+ * Equivalent to looping over each given template/replacement
+ * pair and calling {@link #replace(Instruction,Instruction)} for each.
*/
public int replace(Instruction[] templates, Instruction[] with) {
- if ((templates == null) || (with == null)) {
+ if (templates == null || with == null)
return 0;
- }
int count = 0;
-
for (int i = 0; i < templates.length; i++) {
- if (with == null) {
+ if (with == null)
count += replace(templates[i], null);
- } else {
+ else
count += replace(templates[i], with[i]);
- }
}
-
return count;
}
/**
- * Remove the last iterated instruction.
- *
- * @see ListIterator#remove
+ * Remove the last iterated instruction.
+ *
+ * @see ListIterator#remove
*/
public void remove() {
_ci.remove();
@@ -795,1149 +705,1129 @@
//////////////////////////
/**
- * Load a class constant onto the stack.
- * For primitive types, this translates into a
- * getstatic for the TYPE field of the primitive's wrapper type.
- * For non-primitives, things get much more complex. Suffice it to
- * say that the operation involves adding synthetic static fields
- * and even methods to the class. Note that this instruction requires
- * up to 3 stack positions to execute.
+ * Load a class constant onto the stack.
+ * For primitive types, this translates into a
+ * getstatic for the TYPE field of the primitive's wrapper type.
+ * For non-primitives, things get much more complex. Suffice it to
+ * say that the operation involves adding synthetic static fields
+ * and even methods to the class. Note that this instruction requires
+ * up to 3 stack positions to execute.
*/
public ClassConstantInstruction classconstant() {
- return new ClassConstantInstruction(getMethod().getDeclarer(), this,
- nop());
+ return new ClassConstantInstruction(getMethod().getDeclarer(),
+ this, nop());
}
/**
- * Add the <code>nop</code> opcode.
+ * Add the <code>nop</code> opcode.
*/
public Instruction nop() {
return addInstruction(Constants.NOP);
}
/**
- * Load some constant onto the stack. The {@link ConstantInstruction}
- * type takes any constant and correctly translates it into the proper
- * opcode, depending on the constant type and value. For example,
- * if the constant value is set to 0L, the opcode will be set to
- * <code>lconst0</code>.
+ * Load some constant onto the stack. The {@link ConstantInstruction}
+ * type takes any constant and correctly translates it into the proper
+ * opcode, depending on the constant type and value. For example,
+ * if the constant value is set to 0L, the opcode will be set to
+ * <code>lconst0</code>.
*/
public ConstantInstruction constant() {
- return (ConstantInstruction) addInstruction(new ConstantInstruction(
- this));
+ return(ConstantInstruction) addInstruction
+ (new ConstantInstruction(this));
}
/**
- * Load a local variable onto the stack. This instruction will result
- * in a <code>nop</code> until its type and local index are set.
+ * Load a local variable onto the stack. This instruction will result
+ * in a <code>nop</code> until its type and local index are set.
*/
public LoadInstruction xload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this));
}
/**
- * Load an int local variable onto the stack. This instruction will
- * result in a <code>nop</code> until its local index is set.
+ * Load an int local variable onto the stack. This instruction will
+ * result in a <code>nop</code> until its local index is set.
*/
public LoadInstruction iload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this).setType(
- int.class));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this).
+ setType(int.class));
}
/**
- * Load a long local variable onto the stack. This instruction will
- * result in a <code>nop</code> until its local index is set.
+ * Load a long local variable onto the stack. This instruction will
+ * result in a <code>nop</code> until its local index is set.
*/
public LoadInstruction lload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this).setType(
- long.class));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this).
+ setType(long.class));
}
/**
- * Load a float local variable onto the stack. This instruction will
- * result in a <code>nop</code> until its local index is set.
+ * Load a float local variable onto the stack. This instruction will
+ * result in a <code>nop</code> until its local index is set.
*/
public LoadInstruction fload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this).setType(
- float.class));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this).
+ setType(float.class));
}
/**
- * Load a double local variable onto the stack. This instruction will
- * result in a <code>nop</code> until its local index is set.
+ * Load a double local variable onto the stack. This instruction will
+ * result in a <code>nop</code> until its local index is set.
*/
public LoadInstruction dload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this).setType(
- double.class));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this).
+ setType(double.class));
}
/**
- * Load an object local variable onto the stack. This instruction will
- * result in a <code>nop</code> until its local index is set.
+ * Load an object local variable onto the stack. This instruction will
+ * result in a <code>nop</code> until its local index is set.
*/
public LoadInstruction aload() {
- return (LoadInstruction) addInstruction(new LoadInstruction(this).setType(
- Object.class));
+ return(LoadInstruction) addInstruction(new LoadInstruction(this).
+ setType(Object.class));
}
/**
- * Store a value from the stack into a local variable. This instruction
- * will result in a <code>nop</code> until its type and local index are
- * set.
+ * Store a value from the stack into a local variable. This instruction
+ * will result in a <code>nop</code> until its type and local index are set.
*/
public StoreInstruction xstore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this));
}
/**
- * Store an int value from the stack into a local variable. This
- * instruction will result in a <code>nop</code> until its local index is
- * set.
+ * Store an int value from the stack into a local variable. This
+ * instruction will result in a <code>nop</code> until its local index is
+ * set.
*/
public StoreInstruction istore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this).setType(
- int.class));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this).
+ setType(int.class));
}
/**
- * Store a long value from the stack into a local variable. This
- * instruction will result in a <code>nop</code> until its local index is
- * set.
+ * Store a long value from the stack into a local variable. This
+ * instruction will result in a <code>nop</code> until its local index is
+ * set.
*/
public StoreInstruction lstore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this).setType(
- long.class));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this).
+ setType(long.class));
}
/**
- * Store a float value from the stack into a local variable. This
- * instruction will result in a <code>nop</code> until its local index is
- * set.
+ * Store a float value from the stack into a local variable. This
+ * instruction will result in a <code>nop</code> until its local index is
+ * set.
*/
public StoreInstruction fstore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this).setType(
- float.class));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this).
+ setType(float.class));
}
/**
- * Store a double value from the stack into a local variable. This
- * instruction will result in a <code>nop</code> until its local index is
- * set.
+ * Store a double value from the stack into a local variable. This
+ * instruction will result in a <code>nop</code> until its local index is
+ * set.
*/
public StoreInstruction dstore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this).setType(
- double.class));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this).
+ setType(double.class));
}
/**
- * Store an object value from the stack into a local variable. This
- * instruction will result in a <code>nop</code> until its local index is
- * set.
+ * Store an object value from the stack into a local variable. This
+ * instruction will result in a <code>nop</code> until its local index is
+ * set.
*/
public StoreInstruction astore() {
- return (StoreInstruction) addInstruction(new StoreInstruction(this).setType(
- Object.class));
+ return(StoreInstruction) addInstruction(new StoreInstruction(this).
+ setType(Object.class));
}
/**
- * Add the <code>ret</code> opcode, used in implementing
- * <code>finally</code> clauses.
+ * Add the <code>ret</code> opcode, used in implementing
+ * <code>finally</code> clauses.
*/
public RetInstruction ret() {
- return (RetInstruction) addInstruction(Constants.RET);
+ return(RetInstruction) addInstruction(Constants.RET);
}
/**
- * Add the <code>iinc</code> opcode.
+ * Add the <code>iinc</code> opcode.
*/
public IIncInstruction iinc() {
- return (IIncInstruction) addInstruction(Constants.IINC);
+ return(IIncInstruction) addInstruction(Constants.IINC);
}
/**
- * Add the <code>wide</code> opcode.
+ * Add the <code>wide</code> opcode.
*/
public WideInstruction wide() {
- return (WideInstruction) addInstruction(Constants.WIDE);
+ return(WideInstruction) addInstruction(Constants.WIDE);
}
/**
- * Load an array value onto the stack. This instruction will result
- * in a <code>nop</code> until its type is set.
+ * Load an array value onto the stack. This instruction will result
+ * in a <code>nop</code> until its type is set.
*/
public ArrayLoadInstruction xaload() {
- return (ArrayLoadInstruction) addInstruction(new ArrayLoadInstruction(
- this));
+ return(ArrayLoadInstruction) addInstruction
+ (new ArrayLoadInstruction(this));
}
/**
- * Load an int array value onto the stack; the <code>iaload</code>
- * opcode.
+ * Load an int array value onto the stack; the <code>iaload</code> opcode.
*/
public ArrayLoadInstruction iaload() {
- return (ArrayLoadInstruction) addInstruction(Constants.IALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.IALOAD);
}
/**
- * Load a long array value onto the stack; the <code>laload</code>
- * opcode.
+ * Load a long array value onto the stack; the <code>laload</code> opcode.
*/
public ArrayLoadInstruction laload() {
- return (ArrayLoadInstruction) addInstruction(Constants.LALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.LALOAD);
}
/**
- * Load a float array value onto the stack; the <code>faload</code>
- * opcode.
+ * Load a float array value onto the stack; the <code>faload</code> opcode.
*/
public ArrayLoadInstruction faload() {
- return (ArrayLoadInstruction) addInstruction(Constants.FALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.FALOAD);
}
/**
- * Load a double array value onto the stack; the <code>daload</code>
- * opcode.
+ * Load a double array value onto the stack; the <code>daload</code> opcode.
*/
public ArrayLoadInstruction daload() {
- return (ArrayLoadInstruction) addInstruction(Constants.DALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.DALOAD);
}
/**
- * Load an object array value onto the stack; the <code>aaload</code>
- * opcode.
+ * Load an object array value onto the stack; the <code>aaload</code>
+ * opcode.
*/
public ArrayLoadInstruction aaload() {
- return (ArrayLoadInstruction) addInstruction(Constants.AALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.AALOAD);
}
/**
- * Load a byte array value onto the stack; the <code>baload</code>
- * opcode.
+ * Load a byte array value onto the stack; the <code>baload</code> opcode.
*/
public ArrayLoadInstruction baload() {
- return (ArrayLoadInstruction) addInstruction(Constants.BALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.BALOAD);
}
/**
- * Load a char array value onto the stack; the <code>caload</code>
- * opcode.
+ * Load a char array value onto the stack; the <code>caload</code> opcode.
*/
public ArrayLoadInstruction caload() {
- return (ArrayLoadInstruction) addInstruction(Constants.CALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.CALOAD);
}
/**
- * Load a short array value onto the stack; the <code>saload</code>
- * opcode.
+ * Load a short array value onto the stack; the <code>saload</code> opcode.
*/
public ArrayLoadInstruction saload() {
- return (ArrayLoadInstruction) addInstruction(Constants.SALOAD);
+ return(ArrayLoadInstruction) addInstruction(Constants.SALOAD);
}
/**
- * Store a value from the stack into an array. This instruction
- * will result in a <code>nop</code> until its type is set.
+ * Store a value from the stack into an array. This instruction
+ * will result in a <code>nop</code> until its type is set.
*/
public ArrayStoreInstruction xastore() {
- return (ArrayStoreInstruction) addInstruction(new ArrayStoreInstruction(
- this));
+ return(ArrayStoreInstruction) addInstruction
+ (new ArrayStoreInstruction(this));
}
/**
- * Store an int value from the stack into an array; the
- * <code>iastore</code> opcode.
+ * Store an int value from the stack into an array; the
+ * <code>iastore</code> opcode.
*/
public ArrayStoreInstruction iastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.IASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.IASTORE);
}
/**
- * Store a long value from the stack into an array; the
- * <code>lastore</code> opcode.
+ * Store a long value from the stack into an array; the
+ * <code>lastore</code> opcode.
*/
public ArrayStoreInstruction lastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.LASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.LASTORE);
}
/**
- * Store a float value from the stack into an array; the
- * <code>fastore</code> opcode.
+ * Store a float value from the stack into an array; the
+ * <code>fastore</code> opcode.
*/
public ArrayStoreInstruction fastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.FASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.FASTORE);
}
/**
- * Store a double value from the stack into an array; the
- * <code>dastore</code> opcode.
+ * Store a double value from the stack into an array; the
+ * <code>dastore</code> opcode.
*/
public ArrayStoreInstruction dastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.DASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.DASTORE);
}
/**
- * Store an object value from the stack into an array; the
- * <code>aastore</code> opcode.
+ * Store an object value from the stack into an array; the
+ * <code>aastore</code> opcode.
*/
public ArrayStoreInstruction aastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.AASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.AASTORE);
}
/**
- * Store a byte value from the stack into an array; the
- * <code>bastore</code> opcode.
+ * Store a byte value from the stack into an array; the
+ * <code>bastore</code> opcode.
*/
public ArrayStoreInstruction bastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.BASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.BASTORE);
}
/**
- * Store a char value from the stack into an array; the
- * <code>castore</code> opcode.
+ * Store a char value from the stack into an array; the
+ * <code>castore</code> opcode.
*/
public ArrayStoreInstruction castore() {
- return (ArrayStoreInstruction) addInstruction(Constants.CASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.CASTORE);
}
/**
- * Store a short value from the stack into an array; the
- * <code>sastore</code> opcode.
+ * Store a short value from the stack into an array; the
+ * <code>sastore</code> opcode.
*/
public ArrayStoreInstruction sastore() {
- return (ArrayStoreInstruction) addInstruction(Constants.SASTORE);
+ return(ArrayStoreInstruction) addInstruction(Constants.SASTORE);
}
/**
- * The <code>pop</code> opcode.
+ * The <code>pop</code> opcode.
*/
public StackInstruction pop() {
- return (StackInstruction) addInstruction(Constants.POP);
+ return(StackInstruction) addInstruction(Constants.POP);
}
/**
- * The <code>pop2</code> opcode.
+ * The <code>pop2</code> opcode.
*/
public StackInstruction pop2() {
- return (StackInstruction) addInstruction(Constants.POP2);
+ return(StackInstruction) addInstruction(Constants.POP2);
}
/**
- * The <code>dup</code> opcode.
+ * The <code>dup</code> opcode.
*/
public StackInstruction dup() {
- return (StackInstruction) addInstruction(Constants.DUP);
+ return(StackInstruction) addInstruction(Constants.DUP);
}
/**
- * The <code>dupx1</code> opcode.
+ * The <code>dupx1</code> opcode.
*/
public StackInstruction dupx1() {
- return (StackInstruction) addInstruction(Constants.DUPX1);
+ return(StackInstruction) addInstruction(Constants.DUPX1);
}
/**
- * The <code>dupx2</code> opcode.
+ * The <code>dupx2</code> opcode.
*/
public StackInstruction dupx2() {
- return (StackInstruction) addInstruction(Constants.DUPX2);
+ return(StackInstruction) addInstruction(Constants.DUPX2);
}
/**
- * The <code>dup2</code> opcode.
+ * The <code>dup2</code> opcode.
*/
public StackInstruction dup2() {
- return (StackInstruction) addInstruction(Constants.DUP2);
+ return(StackInstruction) addInstruction(Constants.DUP2);
}
/**
- * The <code>dup2x1</code> opcode.
+ * The <code>dup2x1</code> opcode.
*/
public StackInstruction dup2x1() {
- return (StackInstruction) addInstruction(Constants.DUP2X1);
+ return(StackInstruction) addInstruction(Constants.DUP2X1);
}
/**
- * The <code>dup2x2</code> opcode.
+ * The <code>dup2x2</code> opcode.
*/
public StackInstruction dup2x2() {
- return (StackInstruction) addInstruction(Constants.DUP2X2);
+ return(StackInstruction) addInstruction(Constants.DUP2X2);
}
/**
- * The <code>swap</code> opcode.
+ * The <code>swap</code> opcode.
*/
public StackInstruction swap() {
- return (StackInstruction) addInstruction(Constants.SWAP);
+ return(StackInstruction) addInstruction(Constants.SWAP);
}
/**
- * Perform some math operation on the stack items. This instruction will
- * result in a <code>nop</code> until its operation and type are set.
+ * Perform some math operation on the stack items. This instruction will
+ * result in a <code>nop</code> until its operation and type are set.
*/
public MathInstruction math() {
- return (MathInstruction) addInstruction(new MathInstruction(this));
+ return(MathInstruction) addInstruction(new MathInstruction(this));
}
/**
- * Add the top two stack values. This instruction will result in
- * a <code>nop</code> until its type is set.
+ * Add the top two stack values. This instruction will result in
+ * a <code>nop</code> until its type is set.
*/
public MathInstruction xadd() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_ADD);
}
/**
- * Add the top two stack int values; the <code>iadd</code> opcode.
+ * Add the top two stack int values; the <code>iadd</code> opcode.
*/
public MathInstruction iadd() {
- return (MathInstruction) addInstruction(Constants.IADD);
+ return(MathInstruction) addInstruction(Constants.IADD);
}
/**
- * Add the top two stack long values; the <code>ladd</code> opcode.
+ * Add the top two stack long values; the <code>ladd</code> opcode.
*/
public MathInstruction ladd() {
- return (MathInstruction) addInstruction(Constants.LADD);
+ return(MathInstruction) addInstruction(Constants.LADD);
}
/**
- * Add the top two stack float values; the <code>fadd</code> opcode.
+ * Add the top two stack float values; the <code>fadd</code> opcode.
*/
public MathInstruction fadd() {
- return (MathInstruction) addInstruction(Constants.FADD);
+ return(MathInstruction) addInstruction(Constants.FADD);
}
/**
- * Add the top two stack double values; the <code>dadd</code> opcode.
+ * Add the top two stack double values; the <code>dadd</code> opcode.
*/
public MathInstruction dadd() {
- return (MathInstruction) addInstruction(Constants.DADD);
+ return(MathInstruction) addInstruction(Constants.DADD);
}
/**
- * Subtract the top two stack values. This instruction will result in
- * a <code>nop</code> until its type is set.
+ * Subtract the top two stack values. This instruction will result in
+ * a <code>nop</code> until its type is set.
*/
public MathInstruction xsub() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_SUB);
}
/**
- * Subtract the top two stack int values; the <code>isub</code> opcode.
+ * Subtract the top two stack int values; the <code>isub</code> opcode.
*/
public MathInstruction isub() {
- return (MathInstruction) addInstruction(Constants.ISUB);
+ return(MathInstruction) addInstruction(Constants.ISUB);
}
/**
- * Subtract the top two stack long values; the <code>lsub</code> opcode.
+ * Subtract the top two stack long values; the <code>lsub</code> opcode.
*/
public MathInstruction lsub() {
- return (MathInstruction) addInstruction(Constants.LSUB);
+ return(MathInstruction) addInstruction(Constants.LSUB);
}
/**
- * Subtract the top two stack float values; the <code>fsub</code> opcode.
+ * Subtract the top two stack float values; the <code>fsub</code> opcode.
*/
public MathInstruction fsub() {
- return (MathInstruction) addInstruction(Constants.FSUB);
+ return(MathInstruction) addInstruction(Constants.FSUB);
}
/**
- * Subtract the top two stack double values; the <code>dsub</code> opcode.
+ * Subtract the top two stack double values; the <code>dsub</code> opcode.
*/
public MathInstruction dsub() {
- return (MathInstruction) addInstruction(Constants.DSUB);
+ return(MathInstruction) addInstruction(Constants.DSUB);
}
/**
- * Multiply the top two stack values. This instruction will result in
- * a <code>nop</code> until its type is set.
+ * Multiply the top two stack values. This instruction will result in
+ * a <code>nop</code> until its type is set.
*/
public MathInstruction xmul() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_MUL);
}
/**
- * Multiply the top two stack int values; the <code>imul</code> opcode.
+ * Multiply the top two stack int values; the <code>imul</code> opcode.
*/
public MathInstruction imul() {
- return (MathInstruction) addInstruction(Constants.IMUL);
+ return(MathInstruction) addInstruction(Constants.IMUL);
}
/**
- * Multiply the top two stack long values; the <code>lmul</code> opcode.
+ * Multiply the top two stack long values; the <code>lmul</code> opcode.
*/
public MathInstruction lmul() {
- return (MathInstruction) addInstruction(Constants.LMUL);
+ return(MathInstruction) addInstruction(Constants.LMUL);
}
/**
- * Multiply the top two stack float values; the <code>fmul</code> opcode.
+ * Multiply the top two stack float values; the <code>fmul</code> opcode.
*/
public MathInstruction fmul() {
- return (MathInstruction) addInstruction(Constants.FMUL);
+ return(MathInstruction) addInstruction(Constants.FMUL);
}
/**
- * Multiply the top two stack double values; the <code>dmul</code> opcode.
+ * Multiply the top two stack double values; the <code>dmul</code> opcode.
*/
public MathInstruction dmul() {
- return (MathInstruction) addInstruction(Constants.DMUL);
+ return(MathInstruction) addInstruction(Constants.DMUL);
}
/**
- * Divide the top two stack values. This instruction will result in
- * a <code>nop</code> until its type is set.
+ * Divide the top two stack values. This instruction will result in
+ * a <code>nop</code> until its type is set.
*/
public MathInstruction xdiv() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_DIV);
}
/**
- * Divide the top two stack int values; the <code>idiv</code> opcode.
+ * Divide the top two stack int values; the <code>idiv</code> opcode.
*/
public MathInstruction idiv() {
- return (MathInstruction) addInstruction(Constants.IDIV);
+ return(MathInstruction) addInstruction(Constants.IDIV);
}
/**
- * Divide the top two stack long values; the <code>ldiv</code> opcode.
+ * Divide the top two stack long values; the <code>ldiv</code> opcode.
*/
public MathInstruction ldiv() {
- return (MathInstruction) addInstruction(Constants.LDIV);
+ return(MathInstruction) addInstruction(Constants.LDIV);
}
/**
- * Divide the top two stack float values; the <code>fdiv</code> opcode.
+ * Divide the top two stack float values; the <code>fdiv</code> opcode.
*/
public MathInstruction fdiv() {
- return (MathInstruction) addInstruction(Constants.FDIV);
+ return(MathInstruction) addInstruction(Constants.FDIV);
}
/**
- * Divide the top two stack double values; the <code>ddiv</code> opcode.
+ * Divide the top two stack double values; the <code>ddiv</code> opcode.
*/
public MathInstruction ddiv() {
- return (MathInstruction) addInstruction(Constants.DDIV);
+ return(MathInstruction) addInstruction(Constants.DDIV);
}
/**
- * Take the remainder of the top two stack values. This instruction will
- * result in a <code>nop</code> until its type is set.
+ * Take the remainder of the top two stack values. This instruction will
+ * result in a <code>nop</code> until its type is set.
*/
public MathInstruction xrem() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_REM);
}
/**
- * Take the remainder of the top two int stack values; the
- * <code>irem</code> opcode.
+ * Take the remainder of the top two int stack values; the
+ * <code>irem</code> opcode.
*/
public MathInstruction irem() {
- return (MathInstruction) addInstruction(Constants.IREM);
+ return(MathInstruction) addInstruction(Constants.IREM);
}
/**
- * Take the remainder of the top two long stack values; the
- * <code>lrem</code> opcode.
+ * Take the remainder of the top two long stack values; the
+ * <code>lrem</code> opcode.
*/
public MathInstruction lrem() {
- return (MathInstruction) addInstruction(Constants.LREM);
+ return(MathInstruction) addInstruction(Constants.LREM);
}
/**
- * Take the remainder of the top two float stack values; the
- * <code>frem</code> opcode.
+ * Take the remainder of the top two float stack values; the
+ * <code>frem</code> opcode.
*/
public MathInstruction frem() {
- return (MathInstruction) addInstruction(Constants.FREM);
+ return(MathInstruction) addInstruction(Constants.FREM);
}
/**
- * Take the remainder of the top two double stack values; the
- * <code>drem</code> opcode.
+ * Take the remainder of the top two double stack values; the
+ * <code>drem</code> opcode.
*/
public MathInstruction drem() {
- return (MathInstruction) addInstruction(Constants.DREM);
+ return(MathInstruction) addInstruction(Constants.DREM);
}
/**
- * Negate the top stack value. This instruction will result in a
- * <code>nop</code> until its type is set.
+ * Negate the top stack value. This instruction will result in a
+ * <code>nop</code> until its type is set.
*/
public MathInstruction xneg() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_NEG);
}
/**
- * Negate the top stack int value; the <code>ineg</code> opcode.
+ * Negate the top stack int value; the <code>ineg</code> opcode.
*/
public MathInstruction ineg() {
- return (MathInstruction) addInstruction(Constants.INEG);
+ return(MathInstruction) addInstruction(Constants.INEG);
}
/**
- * Negate the top stack long value; the <code>lneg</code> opcode.
+ * Negate the top stack long value; the <code>lneg</code> opcode.
*/
public MathInstruction lneg() {
- return (MathInstruction) addInstruction(Constants.LNEG);
+ return(MathInstruction) addInstruction(Constants.LNEG);
}
/**
- * Negate the top stack float value; the <code>fneg</code> opcode.
+ * Negate the top stack float value; the <code>fneg</code> opcode.
*/
public MathInstruction fneg() {
- return (MathInstruction) addInstruction(Constants.FNEG);
+ return(MathInstruction) addInstruction(Constants.FNEG);
}
/**
- * Negate the top stack double value; the <code>dneg</code> opcode.
+ * Negate the top stack double value; the <code>dneg</code> opcode.
*/
public MathInstruction dneg() {
- return (MathInstruction) addInstruction(Constants.DNEG);
+ return(MathInstruction) addInstruction(Constants.DNEG);
}
/**
- * Shift the top stack values. This instruction will result in a
- * <code>nop</code> until its type is set.
+ * Shift the top stack values. This instruction will result in a
+ * <code>nop</code> until its type is set.
*/
public MathInstruction xshl() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_SHL);
}
/**
- * Shift the top stack int values; the <code>ishl</code> opcode.
+ * Shift the top stack int values; the <code>ishl</code> opcode.
*/
public MathInstruction ishl() {
- return (MathInstruction) addInstruction(Constants.ISHL);
+ return(MathInstruction) addInstruction(Constants.ISHL);
}
/**
- * Shift the top stack long values; the <code>lshl</code> opcode.
+ * Shift the top stack long values; the <code>lshl</code> opcode.
*/
public MathInstruction lshl() {
- return (MathInstruction) addInstruction(Constants.LSHL);
+ return(MathInstruction) addInstruction(Constants.LSHL);
}
/**
- * Shift the top stack values. This instruction will result in a
- * <code>nop</code> until its type is set.
+ * Shift the top stack values. This instruction will result in a
+ * <code>nop</code> until its type is set.
*/
public MathInstruction xshr() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_SHR);
}
/**
- * Shift the top stack int values; the <code>ishr</code> opcode.
+ * Shift the top stack int values; the <code>ishr</code> opcode.
*/
public MathInstruction ishr() {
- return (MathInstruction) addInstruction(Constants.ISHR);
+ return(MathInstruction) addInstruction(Constants.ISHR);
}
/**
- * Shift the top stack long values; the <code>lshr</code> opcode.
+ * Shift the top stack long values; the <code>lshr</code> opcode.
*/
public MathInstruction lshr() {
- return (MathInstruction) addInstruction(Constants.LSHR);
+ return(MathInstruction) addInstruction(Constants.LSHR);
}
/**
- * Shift the top stack values. This instruction will result in a
- * <code>nop</code> until its type is set.
+ * Shift the top stack values. This instruction will result in a
+ * <code>nop</code> until its type is set.
*/
public MathInstruction xushr() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_USHR);
}
/**
- * Shift the top stack int values; the <code>iushr</code> opcode.
+ * Shift the top stack int values; the <code>iushr</code> opcode.
*/
public MathInstruction iushr() {
- return (MathInstruction) addInstruction(Constants.IUSHR);
+ return(MathInstruction) addInstruction(Constants.IUSHR);
}
/**
- * Shift the top stack long values; the <code>lushr</code> opcode.
+ * Shift the top stack long values; the <code>lushr</code> opcode.
*/
public MathInstruction lushr() {
- return (MathInstruction) addInstruction(Constants.LUSHR);
+ return(MathInstruction) addInstruction(Constants.LUSHR);
}
/**
- * Take the mathematical and of the top two stack values. This instruction
- * results in a <code>nop</code> until its type is set.
+ * Take the mathematical and of the top two stack values. This instruction
+ * results in a <code>nop</code> until its type is set.
*/
public MathInstruction xand() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_AND);
}
/**
- * Take the mathematical and of the top two stack int values; the
- * <code>iand</code> opcode.
+ * Take the mathematical and of the top two stack int values; the
+ * <code>iand</code> opcode.
*/
public MathInstruction iand() {
- return (MathInstruction) addInstruction(Constants.IAND);
+ return(MathInstruction) addInstruction(Constants.IAND);
}
/**
- * Take the mathematical and of the top two stack long values; the
- * <code>land</code> opcode.
+ * Take the mathematical and of the top two stack long values; the
+ * <code>land</code> opcode.
*/
public MathInstruction land() {
- return (MathInstruction) addInstruction(Constants.LAND);
+ return(MathInstruction) addInstruction(Constants.LAND);
}
/**
- * Take the mathematical or of the top two stack values. This instruction
- * results in a <code>nop</code> until its type is set.
+ * Take the mathematical or of the top two stack values. This instruction
+ * results in a <code>nop</code> until its type is set.
*/
public MathInstruction xor() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_OR);
}
/**
- * Take the mathematical or of the top two stack int values; the
- * <code>ior</code> opcode.
+ * Take the mathematical or of the top two stack int values; the
+ * <code>ior</code> opcode.
*/
public MathInstruction ior() {
- return (MathInstruction) addInstruction(Constants.IOR);
+ return(MathInstruction) addInstruction(Constants.IOR);
}
/**
- * Take the mathematical or of the top two stack long values; the
- * <code>lor</code> opcode.
+ * Take the mathematical or of the top two stack long values; the
+ * <code>lor</code> opcode.
*/
public MathInstruction lor() {
- return (MathInstruction) addInstruction(Constants.LOR);
+ return(MathInstruction) addInstruction(Constants.LOR);
}
/**
- * Take the mathematical xor of the top two stack values. This instruction
- * results in a <code>nop</code> until its type is set.
+ * Take the mathematical xor of the top two stack values. This instruction
+ * results in a <code>nop</code> until its type is set.
*/
public MathInstruction xxor() {
MathInstruction mi = math();
-
return mi.setOperation(Constants.MATH_XOR);
}
/**
- * Take the mathematical xor of the top two stack int values; the
- * <code>ixor</code> opcode.
+ * Take the mathematical xor of the top two stack int values; the
+ * <code>ixor</code> opcode.
*/
public MathInstruction ixor() {
- return (MathInstruction) addInstruction(Constants.IXOR);
+ return(MathInstruction) addInstruction(Constants.IXOR);
}
/**
- * Take the mathematical xor of the top two stack long values; the
- * <code>lxor</code> opcode.
+ * Take the mathematical xor of the top two stack long values; the
+ * <code>lxor</code> opcode.
*/
public MathInstruction lxor() {
- return (MathInstruction) addInstruction(Constants.LXOR);
+ return(MathInstruction) addInstruction(Constants.LXOR);
}
/**
- * Convert the top stack value to another type. This instruction
- * will result in a <code>nop</code> until the types to convert
- * between are set.
+ * Convert the top stack value to another type. This instruction
+ * will result in a <code>nop</code> until the types to convert
+ * between are set.
*/
public ConvertInstruction convert() {
- return (ConvertInstruction) addInstruction(new ConvertInstruction(this));
+ return(ConvertInstruction) addInstruction
+ (new ConvertInstruction(this));
}
/**
- * Compare the top two stack values. This instruction will result in a
- * <code>nop</code> until its type is set.
+ * Compare the top two stack values. This instruction will result in a
+ * <code>nop</code> until its type is set.
*/
public CmpInstruction xcmp() {
- return (CmpInstruction) addInstruction(new CmpInstruction(this));
+ return(CmpInstruction) addInstruction(new CmpInstruction(this));
}
/**
- * Compare the top two stack values; the <code>lcmp</code> opcode.
+ * Compare the top two stack values; the <code>lcmp</code> opcode.
*/
public CmpInstruction lcmp() {
- return (CmpInstruction) addInstruction(Constants.LCMP);
+ return(CmpInstruction) addInstruction(Constants.LCMP);
}
/**
- * Compare the top two stack values; the <code>fcmpl</code> opcode.
+ * Compare the top two stack values; the <code>fcmpl</code> opcode.
*/
public CmpInstruction fcmpl() {
- return (CmpInstruction) addInstruction(Constants.FCMPL);
+ return(CmpInstruction) addInstruction(Constants.FCMPL);
}
/**
- * Compare the top two stack values; the <code>fcmpg</code> opcode.
+ * Compare the top two stack values; the <code>fcmpg</code> opcode.
*/
public CmpInstruction fcmpg() {
- return (CmpInstruction) addInstruction(Constants.FCMPG);
+ return(CmpInstruction) addInstruction(Constants.FCMPG);
}
/**
- * Compare the top two stack values; the <code>dcmpl</code> opcode.
+ * Compare the top two stack values; the <code>dcmpl</code> opcode.
*/
public CmpInstruction dcmpl() {
- return (CmpInstruction) addInstruction(Constants.DCMPL);
+ return(CmpInstruction) addInstruction(Constants.DCMPL);
}
/**
- * Compare the top two stack values; the <code>dcmpg</code> opcode.
+ * Compare the top two stack values; the <code>dcmpg</code> opcode.
*/
public CmpInstruction dcmpg() {
- return (CmpInstruction) addInstruction(Constants.DCMPG);
+ return(CmpInstruction) addInstruction(Constants.DCMPG);
}
/**
- * The <code>ifeq</code> opcode.
+ * The <code>ifeq</code> opcode.
*/
public IfInstruction ifeq() {
- return (IfInstruction) addInstruction(Constants.IFEQ);
+ return(IfInstruction) addInstruction(Constants.IFEQ);
}
/**
- * The <code>ifne</code> opcode.
+ * The <code>ifne</code> opcode.
*/
public IfInstruction ifne() {
- return (IfInstruction) addInstruction(Constants.IFNE);
+ return(IfInstruction) addInstruction(Constants.IFNE);
}
/**
- * The <code>iflt</code> opcode.
+ * The <code>iflt</code> opcode.
*/
public IfInstruction iflt() {
- return (IfInstruction) addInstruction(Constants.IFLT);
+ return(IfInstruction) addInstruction(Constants.IFLT);
}
/**
- * The <code>ifge</code> opcode.
+ * The <code>ifge</code> opcode.
*/
public IfInstruction ifge() {
- return (IfInstruction) addInstruction(Constants.IFGE);
+ return(IfInstruction) addInstruction(Constants.IFGE);
}
/**
- * The <code>ifgt</code> opcode.
+ * The <code>ifgt</code> opcode.
*/
public IfInstruction ifgt() {
- return (IfInstruction) addInstruction(Constants.IFGT);
+ return(IfInstruction) addInstruction(Constants.IFGT);
}
/**
- * The <code>ifle</code> opcode.
+ * The <code>ifle</code> opcode.
*/
public IfInstruction ifle() {
- return (IfInstruction) addInstruction(Constants.IFLE);
+ return(IfInstruction) addInstruction(Constants.IFLE);
}
/**
- * The <code>ificmpeq</code> opcode.
+ * The <code>ificmpeq</code> opcode.
*/
public IfInstruction ificmpeq() {
- return (IfInstruction) addInstruction(Constants.IFICMPEQ);
+ return(IfInstruction) addInstruction(Constants.IFICMPEQ);
}
/**
- * The <code>ificmpne</code> opcode.
+ * The <code>ificmpne</code> opcode.
*/
public IfInstruction ificmpne() {
- return (IfInstruction) addInstruction(Constants.IFICMPNE);
+ return(IfInstruction) addInstruction(Constants.IFICMPNE);
}
/**
- * The <code>ificmplt</code> opcode.
+ * The <code>ificmplt</code> opcode.
*/
public IfInstruction ificmplt() {
- return (IfInstruction) addInstruction(Constants.IFICMPLT);
+ return(IfInstruction) addInstruction(Constants.IFICMPLT);
}
/**
- * The <code>ificmpge</code> opcode.
+ * The <code>ificmpge</code> opcode.
*/
public IfInstruction ificmpge() {
- return (IfInstruction) addInstruction(Constants.IFICMPGE);
+ return(IfInstruction) addInstruction(Constants.IFICMPGE);
}
/**
- * The <code>ificmpgt</code> opcode.
+ * The <code>ificmpgt</code> opcode.
*/
public IfInstruction ificmpgt() {
- return (IfInstruction) addInstruction(Constants.IFICMPGT);
+ return(IfInstruction) addInstruction(Constants.IFICMPGT);
}
/**
- * The <code>ificmple</code> opcode.
+ * The <code>ificmple</code> opcode.
*/
public IfInstruction ificmple() {
- return (IfInstruction) addInstruction(Constants.IFICMPLE);
+ return(IfInstruction) addInstruction(Constants.IFICMPLE);
}
/**
- * The <code>ifacmpeq</code> opcode.
+ * The <code>ifacmpeq</code> opcode.
*/
public IfInstruction ifacmpeq() {
- return (IfInstruction) addInstruction(Constants.IFACMPEQ);
+ return(IfInstruction) addInstruction(Constants.IFACMPEQ);
}
/**
- * The <code>ifacmpne</code> opcode.
+ * The <code>ifacmpne</code> opcode.
*/
public IfInstruction ifacmpne() {
- return (IfInstruction) addInstruction(Constants.IFACMPNE);
+ return(IfInstruction) addInstruction(Constants.IFACMPNE);
}
/**
- * The <code>ifnull</code> opcode.
+ * The <code>ifnull</code> opcode.
*/
public IfInstruction ifnull() {
- return (IfInstruction) addInstruction(Constants.IFNULL);
+ return(IfInstruction) addInstruction(Constants.IFNULL);
}
/**
- * The <code>ifnonnull</code> opcode.
+ * The <code>ifnonnull</code> opcode.
*/
public IfInstruction ifnonnull() {
- return (IfInstruction) addInstruction(Constants.IFNONNULL);
+ return(IfInstruction) addInstruction(Constants.IFNONNULL);
}
/**
- * The <code>go2</code> opcode.
+ * The <code>go2</code> opcode.
*/
public JumpInstruction go2() {
- return (JumpInstruction) addInstruction(Constants.GOTO);
+ return(JumpInstruction) addInstruction(Constants.GOTO);
}
/**
- * The <code>jsr</code> opcode used in implementing <code>finally</code>
- * clauses.
+ * The <code>jsr</code> opcode used in implementing <code>finally</code>
+ * clauses.
*/
public JumpInstruction jsr() {
- return (JumpInstruction) addInstruction(Constants.JSR);
+ return(JumpInstruction) addInstruction(Constants.JSR);
}
/**
- * The <code>tableswitch</code> opcode.
+ * The <code>tableswitch</code> opcode.
*/
public TableSwitchInstruction tableswitch() {
- return (TableSwitchInstruction) addInstruction(Constants.TABLESWITCH);
+ return(TableSwitchInstruction) addInstruction(Constants.TABLESWITCH);
}
/**
- * The <code>lookupswitch</code> opcode.
+ * The <code>lookupswitch</code> opcode.
*/
public LookupSwitchInstruction lookupswitch() {
- return (LookupSwitchInstruction) addInstruction(Constants.LOOKUPSWITCH);
+ return(LookupSwitchInstruction) addInstruction(Constants.LOOKUPSWITCH);
}
/**
- * Return from a method. This method will result in a
- * <code>nop</code> until its type is set.
+ * Return from a method. This method will result in a
+ * <code>nop</code> until its type is set.
*/
public ReturnInstruction xreturn() {
- return (ReturnInstruction) addInstruction(new ReturnInstruction(this));
+ return(ReturnInstruction) addInstruction (new ReturnInstruction(this));
}
/**
- * Return void from a method; the <code>return</code> opcode.
+ * Return void from a method; the <code>return</code> opcode.
*/
public ReturnInstruction vreturn() {
- return (ReturnInstruction) addInstruction(Constants.RETURN);
+ return(ReturnInstruction) addInstruction(Constants.RETURN);
}
/**
- * Return an int from a method; the <code>ireturn</code> opcode.
+ * Return an int from a method; the <code>ireturn</code> opcode.
*/
public ReturnInstruction ireturn() {
- return (ReturnInstruction) addInstruction(Constants.IRETURN);
+ return(ReturnInstruction) addInstruction(Constants.IRETURN);
}
/**
- * Return a long from a method; the <code>lreturn</code> opcode.
+ * Return a long from a method; the <code>lreturn</code> opcode.
*/
public ReturnInstruction lreturn() {
- return (ReturnInstruction) addInstruction(Constants.LRETURN);
+ return(ReturnInstruction) addInstruction(Constants.LRETURN);
}
/**
- * Return a float from a method; the <code>freturn</code> opcode.
+ * Return a float from a method; the <code>freturn</code> opcode.
*/
public ReturnInstruction freturn() {
- return (ReturnInstruction) addInstruction(Constants.FRETURN);
+ return(ReturnInstruction) addInstruction(Constants.FRETURN);
}
/**
- * Return a double from a method; the <code>dreturn</code> opcode.
+ * Return a double from a method; the <code>dreturn</code> opcode.
*/
public ReturnInstruction dreturn() {
- return (ReturnInstruction) addInstruction(Constants.DRETURN);
+ return(ReturnInstruction) addInstruction(Constants.DRETURN);
}
/**
- * Return an object from a method; the <code>areturn</code> opcode.
+ * Return an object from a method; the <code>areturn</code> opcode.
*/
public ReturnInstruction areturn() {
- return (ReturnInstruction) addInstruction(Constants.ARETURN);
+ return(ReturnInstruction) addInstruction(Constants.ARETURN);
}
/**
- * Load the value from a field onto the stack; the <code>getfield</code>
- * opcode.
+ * Load the value from a field onto the stack; the <code>getfield</code>
+ * opcode.
*/
public GetFieldInstruction getfield() {
- return (GetFieldInstruction) addInstruction(Constants.GETFIELD);
+ return(GetFieldInstruction) addInstruction(Constants.GETFIELD);
}
/**
- * Load the value from a static field onto the stack; the
- * <code>getstatic</code> opcode.
+ * Load the value from a static field onto the stack; the
+ * <code>getstatic</code> opcode.
*/
public GetFieldInstruction getstatic() {
- return (GetFieldInstruction) addInstruction(Constants.GETSTATIC);
+ return(GetFieldInstruction) addInstruction(Constants.GETSTATIC);
}
/**
- * Place the value of a field onto the stack; the <code>putfield</code>
- * opcode.
+ * Place the value of a field onto the stack; the <code>putfield</code>
+ * opcode.
*/
public PutFieldInstruction putfield() {
- return (PutFieldInstruction) addInstruction(Constants.PUTFIELD);
+ return(PutFieldInstruction) addInstruction(Constants.PUTFIELD);
}
/**
- * Place the value of a static field onto the stack; the
- * <code>putstatic</code> opcode.
+ * Place the value of a static field onto the stack; the
+ * <code>putstatic</code> opcode.
*/
public PutFieldInstruction putstatic() {
- return (PutFieldInstruction) addInstruction(Constants.PUTSTATIC);
+ return(PutFieldInstruction) addInstruction(Constants.PUTSTATIC);
}
/**
- * Invoke a virtual method; the <code>invokevirtual</code> opcode.
+ * Invoke a virtual method; the <code>invokevirtual</code> opcode.
*/
public MethodInstruction invokevirtual() {
- return (MethodInstruction) addInstruction(Constants.INVOKEVIRTUAL);
+ return(MethodInstruction) addInstruction(Constants.INVOKEVIRTUAL);
}
/**
- * Invoke a method non-virtually, as for constructors and superclass
- * methods; the <code>invokespecial</code> opcode.
+ * Invoke a method non-virtually, as for constructors and superclass
+ * methods; the <code>invokespecial</code> opcode.
*/
public MethodInstruction invokespecial() {
- return (MethodInstruction) addInstruction(Constants.INVOKESPECIAL);
+ return(MethodInstruction) addInstruction(Constants.INVOKESPECIAL);
}
/**
- * Invoke a method on an interface; the <code>invokeinterface</code>
- * opcode.
+ * Invoke a method on an interface; the <code>invokeinterface</code> opcode.
*/
public MethodInstruction invokeinterface() {
- return (MethodInstruction) addInstruction(Constants.INVOKEINTERFACE);
+ return(MethodInstruction) addInstruction(Constants.INVOKEINTERFACE);
}
/**
- * Invoke a static method; the <code>invokestatic</code> opcode.
+ * Invoke a static method; the <code>invokestatic</code> opcode.
*/
public MethodInstruction invokestatic() {
- return (MethodInstruction) addInstruction(Constants.INVOKESTATIC);
+ return(MethodInstruction) addInstruction(Constants.INVOKESTATIC);
}
/**
- * Create a new instance of an object; the <code>new</code> opcode.
+ * Create a new instance of an object; the <code>new</code> opcode.
*/
public ClassInstruction anew() {
- return (ClassInstruction) addInstruction(Constants.NEW);
+ return(ClassInstruction) addInstruction(Constants.NEW);
}
/**
- * Create a new instance of an object array; the <code>anew</code> opcode.
+ * Create a new instance of an object array; the <code>anew</code> opcode.
*/
public ClassInstruction anewarray() {
- return (ClassInstruction) addInstruction(Constants.ANEWARRAY);
+ return(ClassInstruction) addInstruction(Constants.ANEWARRAY);
}
/**
- * Cast an object on the stack to another type; the <code>checkcast</code>
- * opcode.
+ * Cast an object on the stack to another type; the <code>checkcast</code>
+ * opcode.
*/
public ClassInstruction checkcast() {
- return (ClassInstruction) addInstruction(Constants.CHECKCAST);
[... 912 lines stripped ...]