@@ -0,0 +1,97 @@ | |||
package org.aspectj.apache.bcel.classfile; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Unknown (non-standard) attributes may be read via user-defined factory | |||
* objects that can be registered with the Attribute.addAttributeReader | |||
* method. These factory objects should implement this interface. | |||
* @see Attribute | |||
* @version $Id: AttributeReader.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public interface AttributeReader { | |||
/** | |||
When this attribute reader is added via the static method | |||
Attribute.addAttributeReader, an attribute name is associated with it. | |||
As the class file parser parses attributes, it will call various | |||
AttributeReaders based on the name of the attributes it is | |||
constructing. | |||
@param name_index An index into the constant pool, indexing a | |||
ConstantUtf8 that represents the name of the attribute. | |||
@param length The length of the data contained in the attribute. This | |||
is written into the constant pool and should agree with what the | |||
factory expects the length to be. | |||
@param file This is the data input stream that the factory needs to read | |||
its data from. | |||
@param constant_pool This is the constant pool associated with the | |||
Attribute that we are constructing. | |||
@return The user-defined AttributeReader should take this data and use | |||
it to construct an attribute. In the case of errors, a null can be | |||
returned which will cause the parsing of the class file to fail. | |||
@see Attribute#addAttributeReader( String, AttributeReader ) | |||
*/ | |||
public Attribute createAttribute(int name_index, | |||
int length, | |||
java.io.DataInputStream file, | |||
ConstantPool constant_pool); | |||
} |
@@ -0,0 +1,155 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM Corporation | |||
* | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement initial implementation | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataInputStream; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.Iterator; | |||
import java.util.List; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
import org.aspectj.apache.bcel.classfile.Utility; | |||
/** | |||
* An annotation is an immutable object (AnnotationGen is the mutable variant) - it basically contains a list | |||
* of name-value pairs. | |||
*/ | |||
public class Annotation { | |||
private int typeIndex; | |||
// OPTIMIZE don't need a new list instance for every annotation instance! | |||
private List /* ElementNameValuePair */ evs = new ArrayList(); | |||
private ConstantPool cpool; | |||
private boolean isRuntimeVisible; | |||
public String toString() { | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("ANNOTATION ["+getTypeSignature()+"] ["+ | |||
(isRuntimeVisible?"runtimeVisible":"runtimeInvisible")+"] ["); | |||
for (Iterator iter = evs.iterator(); iter.hasNext();) { | |||
ElementNameValuePair element = (ElementNameValuePair) iter.next(); | |||
sb.append(element.toString()); | |||
if (iter.hasNext()) sb.append(","); | |||
} | |||
sb.append("]"); | |||
return sb.toString(); | |||
} | |||
private Annotation(ConstantPool cpool) { | |||
this.cpool = cpool; | |||
} | |||
public Annotation(int index,ConstantPool cpool,boolean visible) { | |||
this.cpool = cpool; | |||
this.typeIndex = index; | |||
this.isRuntimeVisible = visible; | |||
} | |||
protected static Annotation read(DataInputStream dis,ConstantPool cpool,boolean isRuntimeVisible) throws IOException { | |||
Annotation a = new Annotation(cpool); | |||
a.typeIndex = dis.readUnsignedShort(); | |||
int elemValuePairCount = dis.readUnsignedShort(); | |||
for (int i=0;i<elemValuePairCount;i++) { | |||
int nidx = dis.readUnsignedShort(); | |||
a.addElementNameValuePair( | |||
new ElementNameValuePair(nidx,ElementValue.readElementValue(dis,cpool),cpool)); | |||
} | |||
a.isRuntimeVisible(isRuntimeVisible); | |||
return a; | |||
} | |||
protected void dump(DataOutputStream dos) throws IOException { | |||
dos.writeShort(typeIndex); // u2 index of type name in cpool | |||
dos.writeShort(evs.size()); // u2 element_value pair count | |||
for (int i = 0 ; i<evs.size();i++) { | |||
ElementNameValuePair envp = (ElementNameValuePair) evs.get(i); | |||
envp.dump(dos); | |||
} | |||
} | |||
public void addElementNameValuePair(ElementNameValuePair evp) { | |||
evs.add(evp); | |||
} | |||
public int getTypeIndex() { | |||
return typeIndex; | |||
} | |||
public String getTypeSignature() { | |||
ConstantUtf8 c = (ConstantUtf8)cpool.getConstant(typeIndex,Constants.CONSTANT_Utf8); | |||
return c.getBytes(); | |||
} | |||
public String getTypeName() { | |||
ConstantUtf8 c = (ConstantUtf8)cpool.getConstant(typeIndex,Constants.CONSTANT_Utf8); | |||
return Utility.signatureToString(c.getBytes()); | |||
} | |||
/** | |||
* Returns list of ElementNameValuePair objects | |||
*/ | |||
public List getValues() { | |||
return evs; | |||
} | |||
protected void isRuntimeVisible(boolean b) { | |||
isRuntimeVisible = b; | |||
} | |||
public boolean isRuntimeVisible() { | |||
return isRuntimeVisible; | |||
} | |||
public String toShortString() { | |||
StringBuffer result = new StringBuffer(); | |||
result.append("@"); | |||
result.append(getTypeName()); | |||
if (getValues().size()>0) { | |||
result.append("("); | |||
for (Iterator iter = getValues().iterator(); iter.hasNext();) { | |||
ElementNameValuePair element = (ElementNameValuePair) iter.next(); | |||
result.append(element.toShortString()); | |||
} | |||
result.append(")"); | |||
} | |||
return result.toString(); | |||
} | |||
/** | |||
* Return true if the annotation has a value with the specified name (n) and value (v) | |||
*/ | |||
public boolean hasNameValuePair(String n, String v) { | |||
for (int i=0;i<evs.size();i++) { | |||
ElementNameValuePair pair = (ElementNameValuePair)evs.get(i); | |||
if (pair.getNameString().equals(n)) { | |||
if (pair.getValue().stringifyValue().equals(v)) return true; | |||
} | |||
} | |||
return false; | |||
} | |||
/** | |||
* Return true if the annotation has a value with the specified name (n) | |||
*/ | |||
public boolean hasNamedValue(String n) { | |||
for (int i=0;i<evs.size();i++) { | |||
ElementNameValuePair pair = (ElementNameValuePair)evs.get(i); | |||
if (pair.getNameString().equals(n)) return true; | |||
} | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,51 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
/** | |||
* An element value that is an annotation. | |||
*/ | |||
public class AnnotationElementValue extends ElementValue { | |||
// For annotation element values, this is the annotation | |||
private Annotation a; | |||
public AnnotationElementValue(int type, Annotation annotation, ConstantPool cpool) { | |||
super(type,cpool); | |||
if (type != ANNOTATION) | |||
throw new RuntimeException("Only element values of type annotation can be built with this ctor"); | |||
this.a = annotation; | |||
} | |||
public void dump(DataOutputStream dos) throws IOException { | |||
dos.writeByte(type); // u1 type of value (ANNOTATION == '@') | |||
a.dump(dos); | |||
} | |||
public String stringifyValue() { | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append(a.toString()); | |||
return sb.toString(); | |||
} | |||
public String toString() { | |||
return stringifyValue(); | |||
} | |||
public Annotation getAnnotation() { return a;} | |||
} |
@@ -0,0 +1,66 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
public class ArrayElementValue extends ElementValue { | |||
// For array types, this is the array | |||
private ElementValue[] evalues; | |||
public String toString() { | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("{"); | |||
for (int i = 0; i < evalues.length; i++) { | |||
sb.append(evalues[i].toString()); | |||
if ((i+1)<evalues.length) sb.append(","); | |||
} | |||
sb.append("}"); | |||
return sb.toString(); | |||
} | |||
public ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool) { | |||
super(type,cpool); | |||
if (type != ARRAY) | |||
throw new RuntimeException("Only element values of type array can be built with this ctor"); | |||
this.evalues = datums; | |||
} | |||
public void dump(DataOutputStream dos) throws IOException { | |||
dos.writeByte(type); // u1 type of value (ARRAY == '[') | |||
dos.writeShort(evalues.length); | |||
for (int i=0; i<evalues.length; i++) { | |||
evalues[i].dump(dos); | |||
} | |||
} | |||
public String stringifyValue() { | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("["); | |||
for(int i=0; i<evalues.length; i++) { | |||
sb.append(evalues[i].stringifyValue()); | |||
if ((i+1)<evalues.length) sb.append(","); | |||
} | |||
sb.append("]"); | |||
return sb.toString(); | |||
} | |||
public ElementValue[] getElementValuesArray() { return evalues;} | |||
public int getElementValuesArraySize() { return evalues.length;} | |||
} |
@@ -0,0 +1,53 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
public class ClassElementValue extends ElementValue { | |||
// For primitive types and string type, this points to the value entry in the cpool | |||
// For 'class' this points to the class entry in the cpool | |||
private int idx; | |||
public ClassElementValue(int type,int idx,ConstantPool cpool) { | |||
super(type,cpool); | |||
this.idx = idx; | |||
} | |||
public int getIndex() { | |||
return idx; | |||
} | |||
public String getClassString() { | |||
ConstantUtf8 c = (ConstantUtf8)cpool.getConstant(idx,Constants.CONSTANT_Utf8); | |||
return c.getBytes(); | |||
} | |||
public String stringifyValue() { | |||
ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(idx,Constants.CONSTANT_Utf8); | |||
return cu8.getBytes(); | |||
} | |||
public void dump(DataOutputStream dos) throws IOException { | |||
dos.writeByte(type); // u1 kind of value | |||
dos.writeShort(idx); | |||
} | |||
} |
@@ -0,0 +1,62 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
public class ElementNameValuePair { | |||
private int nameIdx; | |||
private ElementValue value; | |||
private ConstantPool cpool; | |||
public String toString() { | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append(getNameString()+"="+value.toString()); | |||
return sb.toString(); | |||
} | |||
public ElementNameValuePair(int idx,ElementValue value,ConstantPool cpool) { | |||
this.nameIdx = idx; | |||
this.value = value; | |||
this.cpool = cpool; | |||
} | |||
protected void dump(DataOutputStream dos) throws IOException { | |||
dos.writeShort(nameIdx); // u2 name of the element | |||
value.dump(dos); | |||
} | |||
public int getNameIndex() { | |||
return nameIdx; | |||
} | |||
public final String getNameString() { | |||
ConstantUtf8 c = (ConstantUtf8)cpool.getConstant(nameIdx,Constants.CONSTANT_Utf8); | |||
return c.getBytes(); | |||
} | |||
public final ElementValue getValue() { | |||
return value; | |||
} | |||
public String toShortString() { | |||
StringBuffer result = new StringBuffer(); | |||
result.append(getNameString()).append("=").append(getValue().toShortString()); | |||
return result.toString(); | |||
} | |||
} |
@@ -0,0 +1,112 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataInputStream; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
public abstract class ElementValue { | |||
protected int type; | |||
protected ConstantPool cpool; | |||
public String toString() { | |||
return stringifyValue(); | |||
} | |||
protected ElementValue(int type,ConstantPool cpool) { | |||
this.type = type; | |||
this.cpool = cpool; | |||
} | |||
public int getElementValueType() { | |||
return type; | |||
} | |||
public abstract String stringifyValue(); | |||
public abstract void dump(DataOutputStream dos) throws IOException; | |||
public static final int STRING = 's'; | |||
public static final int ENUM_CONSTANT = 'e'; | |||
public static final int CLASS = 'c'; | |||
public static final int ANNOTATION = '@'; | |||
public static final int ARRAY = '['; | |||
public static final int PRIMITIVE_INT = 'I'; | |||
public static final int PRIMITIVE_BYTE = 'B'; | |||
public static final int PRIMITIVE_CHAR = 'C'; | |||
public static final int PRIMITIVE_DOUBLE = 'D'; | |||
public static final int PRIMITIVE_FLOAT = 'F'; | |||
public static final int PRIMITIVE_LONG = 'J'; | |||
public static final int PRIMITIVE_SHORT = 'S'; | |||
public static final int PRIMITIVE_BOOLEAN= 'Z'; | |||
public static ElementValue readElementValue(DataInputStream dis,ConstantPool cpool) throws IOException { | |||
int type= dis.readUnsignedByte(); | |||
switch (type) { | |||
case 'B': // byte | |||
return new SimpleElementValue(PRIMITIVE_BYTE,dis.readUnsignedShort(),cpool); | |||
case 'C': // char | |||
return new SimpleElementValue(PRIMITIVE_CHAR,dis.readUnsignedShort(),cpool); | |||
case 'D': // double | |||
return new SimpleElementValue(PRIMITIVE_DOUBLE,dis.readUnsignedShort(),cpool); | |||
case 'F': // float | |||
return new SimpleElementValue(PRIMITIVE_FLOAT,dis.readUnsignedShort(),cpool); | |||
case 'I': // int | |||
return new SimpleElementValue(PRIMITIVE_INT,dis.readUnsignedShort(),cpool); | |||
case 'J': // long | |||
return new SimpleElementValue(PRIMITIVE_LONG,dis.readUnsignedShort(),cpool); | |||
case 'S': // short | |||
return new SimpleElementValue(PRIMITIVE_SHORT,dis.readUnsignedShort(),cpool); | |||
case 'Z': // boolean | |||
return new SimpleElementValue(PRIMITIVE_BOOLEAN,dis.readUnsignedShort(),cpool); | |||
case 's': // String | |||
return new SimpleElementValue(STRING,dis.readUnsignedShort(),cpool); | |||
case 'e': // Enum constant | |||
return new EnumElementValue(ENUM_CONSTANT,dis.readUnsignedShort(),dis.readUnsignedShort(),cpool); | |||
case 'c': // Class | |||
return new ClassElementValue(CLASS,dis.readUnsignedShort(),cpool); | |||
//J5TODO: Should it be 'true' in the next statement? What difference does it make? Should it be | |||
// the same as the 'super annotation' in which we are contained? | |||
case '@': // Annotation | |||
return new AnnotationElementValue(ANNOTATION,Annotation.read(dis,cpool,true),cpool); | |||
case '[': // Array | |||
int numArrayVals = dis.readUnsignedShort(); | |||
List arrayVals = new ArrayList(); | |||
ElementValue[] evalues = new ElementValue[numArrayVals]; | |||
for (int j=0;j<numArrayVals;j++) { | |||
evalues[j] = ElementValue.readElementValue(dis,cpool); | |||
} | |||
return new ArrayElementValue(ARRAY,evalues,cpool); | |||
default: | |||
throw new RuntimeException("Unexpected element value kind in annotation: "+type); | |||
} | |||
} | |||
public String toShortString() { | |||
StringBuffer result = new StringBuffer(); | |||
result.append(stringifyValue()); | |||
return result.toString(); | |||
} | |||
} |
@@ -0,0 +1,69 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
public class EnumElementValue extends ElementValue { | |||
// For enum types, these two indices point to the type and value | |||
private int typeIdx; | |||
private int valueIdx; | |||
public EnumElementValue(int type,int typeIdx,int valueIdx,ConstantPool cpool) { | |||
super(type,cpool); | |||
if (type != ENUM_CONSTANT) | |||
throw new RuntimeException("Only element values of type enum can be built with this ctor"); | |||
this.typeIdx = typeIdx; | |||
this.valueIdx= valueIdx; | |||
} | |||
public void dump(DataOutputStream dos) throws IOException { | |||
dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e') | |||
dos.writeShort(typeIdx); // u2 | |||
dos.writeShort(valueIdx); // u2 | |||
} | |||
/** | |||
* return signature and value, something like Lp/Color;RED | |||
*/ | |||
public String stringifyValue() { | |||
StringBuffer sb = new StringBuffer(); | |||
ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(typeIdx,Constants.CONSTANT_Utf8); | |||
sb.append(cu8.getBytes()); | |||
cu8 = (ConstantUtf8)cpool.getConstant(valueIdx,Constants.CONSTANT_Utf8); | |||
sb.append(cu8.getBytes()); | |||
return sb.toString(); | |||
} | |||
public String getEnumTypeString() { | |||
ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(typeIdx,Constants.CONSTANT_Utf8); | |||
return cu8.getBytes();//Utility.signatureToString(cu8.getBytes()); | |||
} | |||
public String getEnumValueString() { | |||
ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(valueIdx,Constants.CONSTANT_Utf8); | |||
return cu8.getBytes(); | |||
} | |||
public int getValueIndex() { return valueIdx;} | |||
public int getTypeIndex() { return typeIdx; } | |||
} |
@@ -0,0 +1,169 @@ | |||
/* ******************************************************************* | |||
* Copyright (c) 2004 IBM | |||
* All rights reserved. | |||
* This program and the accompanying materials are made available | |||
* under the terms of the Eclipse Public License v1.0 | |||
* which accompanies this distribution and is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* Contributors: | |||
* Andy Clement - initial implementation {date} | |||
* ******************************************************************/ | |||
package org.aspectj.apache.bcel.classfile.annotation; | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.ConstantDouble; | |||
import org.aspectj.apache.bcel.classfile.ConstantFloat; | |||
import org.aspectj.apache.bcel.classfile.ConstantInteger; | |||
import org.aspectj.apache.bcel.classfile.ConstantLong; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
/** | |||
* An element value representing a primitive or string value. | |||
*/ | |||
public class SimpleElementValue extends ElementValue { | |||
// For primitive types and string type, this points to the value entry in the cpool | |||
// For 'class' this points to the class entry in the cpool | |||
private int idx; | |||
public SimpleElementValue(int type,int idx,ConstantPool cpool) { | |||
super(type,cpool); | |||
this.idx = idx; | |||
} | |||
public int getIndex() { | |||
return idx; | |||
} | |||
public String getValueString() { | |||
if (type != STRING) | |||
throw new RuntimeException("Dont call getValueString() on a non STRING ElementValue"); | |||
ConstantUtf8 c = (ConstantUtf8)cpool.getConstant(idx,Constants.CONSTANT_Utf8); | |||
return c.getBytes(); | |||
} | |||
public int getValueInt() { | |||
if (type != PRIMITIVE_INT) | |||
throw new RuntimeException("Dont call getValueString() on a non STRING ElementValue"); | |||
ConstantInteger c = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return c.getBytes(); | |||
} | |||
public byte getValueByte() { | |||
if (type != PRIMITIVE_BYTE) | |||
throw new RuntimeException("Dont call getValueByte() on a non BYTE ElementValue"); | |||
ConstantInteger c = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return (byte)c.getBytes(); | |||
} | |||
public char getValueChar() { | |||
if (type != PRIMITIVE_CHAR) | |||
throw new RuntimeException("Dont call getValueChar() on a non CHAR ElementValue"); | |||
ConstantInteger c = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return (char)c.getBytes(); | |||
} | |||
public long getValueLong() { | |||
if (type != PRIMITIVE_LONG) | |||
throw new RuntimeException("Dont call getValueLong() on a non LONG ElementValue"); | |||
ConstantLong j = (ConstantLong)cpool.getConstant(idx); | |||
return j.getBytes(); | |||
} | |||
public float getValueFloat() { | |||
if (type != PRIMITIVE_FLOAT) | |||
throw new RuntimeException("Dont call getValueFloat() on a non FLOAT ElementValue"); | |||
ConstantFloat f = (ConstantFloat)cpool.getConstant(idx); | |||
return f.getBytes(); | |||
} | |||
public double getValueDouble() { | |||
if (type != PRIMITIVE_DOUBLE) | |||
throw new RuntimeException("Dont call getValueDouble() on a non DOUBLE ElementValue"); | |||
ConstantDouble d = (ConstantDouble)cpool.getConstant(idx); | |||
return d.getBytes(); | |||
} | |||
public boolean getValueBoolean() { | |||
if (type != PRIMITIVE_BOOLEAN) | |||
throw new RuntimeException("Dont call getValueBoolean() on a non BOOLEAN ElementValue"); | |||
ConstantInteger bo = (ConstantInteger)cpool.getConstant(idx); | |||
return (bo.getBytes()!=0); | |||
} | |||
public short getValueShort() { | |||
if (type != PRIMITIVE_SHORT) | |||
throw new RuntimeException("Dont call getValueShort() on a non SHORT ElementValue"); | |||
ConstantInteger s = (ConstantInteger)cpool.getConstant(idx); | |||
return (short)s.getBytes(); | |||
} | |||
public String toString() { | |||
return stringifyValue(); | |||
} | |||
// Whatever kind of value it is, return it as a string | |||
public String stringifyValue() { | |||
switch (type) { | |||
case PRIMITIVE_INT: | |||
ConstantInteger c = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return Integer.toString(c.getBytes()); | |||
case PRIMITIVE_LONG: | |||
ConstantLong j = (ConstantLong)cpool.getConstant(idx,Constants.CONSTANT_Long); | |||
return Long.toString(j.getBytes()); | |||
case PRIMITIVE_DOUBLE: | |||
ConstantDouble d = (ConstantDouble)cpool.getConstant(idx,Constants.CONSTANT_Double); | |||
return Double.toString(d.getBytes()); | |||
case PRIMITIVE_FLOAT: | |||
ConstantFloat f = (ConstantFloat)cpool.getConstant(idx,Constants.CONSTANT_Float); | |||
return Float.toString(f.getBytes()); | |||
case PRIMITIVE_SHORT: | |||
ConstantInteger s = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return Integer.toString(s.getBytes()); | |||
case PRIMITIVE_BYTE: | |||
ConstantInteger b = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return Integer.toString(b.getBytes()); | |||
case PRIMITIVE_CHAR: | |||
ConstantInteger ch = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
return new Character((char)ch.getBytes()).toString(); | |||
case PRIMITIVE_BOOLEAN: | |||
ConstantInteger bo = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); | |||
if (bo.getBytes() == 0) return "false"; | |||
if (bo.getBytes() != 0) return "true"; | |||
case STRING: | |||
ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(idx,Constants.CONSTANT_Utf8); | |||
return cu8.getBytes(); | |||
default: | |||
throw new RuntimeException("SimpleElementValue class does not know how to stringify type "+type); | |||
} | |||
} | |||
public void dump(DataOutputStream dos) throws IOException { | |||
dos.writeByte(type); // u1 kind of value | |||
switch (type) { | |||
case PRIMITIVE_INT: | |||
case PRIMITIVE_BYTE: | |||
case PRIMITIVE_CHAR: | |||
case PRIMITIVE_FLOAT: | |||
case PRIMITIVE_LONG: | |||
case PRIMITIVE_BOOLEAN: | |||
case PRIMITIVE_SHORT: | |||
case PRIMITIVE_DOUBLE: | |||
case STRING: | |||
dos.writeShort(idx); | |||
break; | |||
default: | |||
throw new RuntimeException("SimpleElementValue doesnt know how to write out type "+type); | |||
} | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |||
<html> | |||
<head> | |||
<!-- | |||
$Id: package.html,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
--> | |||
</head> | |||
<body bgcolor="white"> | |||
<p> | |||
This package contains the classes that describe the structure of a | |||
Java class file and a class file parser. | |||
</p> | |||
</body> | |||
</html> |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* AALOAD - Load reference from array | |||
* <PRE>Stack: ..., arrayref, index -> value</PRE> | |||
* | |||
* @version $Id: AALOAD.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class AALOAD extends ArrayInstruction implements StackProducer { | |||
/** Load reference from array | |||
*/ | |||
public AALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.AALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitAALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* AASTORE - Store into reference array | |||
* <PRE>Stack: ..., arrayref, index, value -> ...</PRE> | |||
* | |||
* @version $Id: AASTORE.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class AASTORE extends ArrayInstruction implements StackConsumer { | |||
/** Store into reference array | |||
*/ | |||
public AASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.AASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitAASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,94 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ACONST_NULL - Push null reference | |||
* <PRE>Stack: ... -> ..., null</PRE> | |||
* | |||
* @version $Id: ACONST_NULL.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ACONST_NULL extends Instruction | |||
implements PushInstruction, TypedInstruction { | |||
/** | |||
* Push null reference | |||
*/ | |||
public ACONST_NULL() { | |||
super(org.aspectj.apache.bcel.Constants.ACONST_NULL, (short)1); | |||
} | |||
/** @return Type.NULL | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.NULL; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitPushInstruction(this); | |||
v.visitTypedInstruction(this); | |||
v.visitACONST_NULL(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ALOAD - Load reference from local variable | |||
* <PRE>Stack: ... -> ..., objectref</PRE> | |||
* | |||
* @version $Id: ALOAD.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ALOAD extends LoadInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.ALOAD, org.aspectj.apache.bcel.Constants.ALOAD_0); | |||
} | |||
/** Load reference from local variable | |||
* @param n index of local variable | |||
*/ | |||
public ALOAD(int n) { | |||
super(org.aspectj.apache.bcel.Constants.ALOAD, org.aspectj.apache.bcel.Constants.ALOAD_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,114 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.ExceptionConstants; | |||
/** | |||
* ANEWARRAY - Create new array of references | |||
* <PRE>Stack: ..., count -> ..., arrayref</PRE> | |||
* | |||
* @version $Id: ANEWARRAY.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ANEWARRAY extends CPInstruction | |||
implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ANEWARRAY() {} | |||
public ANEWARRAY(int index) { | |||
super(org.aspectj.apache.bcel.Constants.ANEWARRAY, index); | |||
} | |||
public Class[] getExceptions(){ | |||
Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length]; | |||
System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0, | |||
cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length); | |||
cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = | |||
ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION; | |||
return cs; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitLoadClass(this); | |||
v.visitAllocationInstruction(this); | |||
v.visitExceptionThrower(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitCPInstruction(this); | |||
v.visitANEWARRAY(this); | |||
} | |||
public ObjectType getLoadClassType(ConstantPoolGen cpg) { | |||
Type t = getType(cpg); | |||
if (t instanceof ArrayType){ | |||
t = ((ArrayType) t).getBasicType(); | |||
} | |||
return (t instanceof ObjectType)? (ObjectType) t : null; | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ARETURN - Return reference from method | |||
* <PRE>Stack: ..., objectref -> <empty></PRE> | |||
* | |||
* @version $Id: ARETURN.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ARETURN extends ReturnInstruction { | |||
/** | |||
* Return reference from method | |||
*/ | |||
public ARETURN() { | |||
super(org.aspectj.apache.bcel.Constants.ARETURN); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitStackConsumer(this); | |||
v.visitReturnInstruction(this); | |||
v.visitARETURN(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ARRAYLENGTH - Get length of array | |||
* <PRE>Stack: ..., arrayref -> ..., length</PRE> | |||
* | |||
* @version $Id: ARRAYLENGTH.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ARRAYLENGTH extends Instruction | |||
implements ExceptionThrower, StackProducer { | |||
/** Get length of array | |||
*/ | |||
public ARRAYLENGTH() { | |||
super(org.aspectj.apache.bcel.Constants.ARRAYLENGTH, (short)1); | |||
} | |||
/** @return exceptions this instruction may cause | |||
*/ | |||
public Class[] getExceptions() { | |||
return new Class[] { org.aspectj.apache.bcel.ExceptionConstants.NULL_POINTER_EXCEPTION }; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitStackProducer(this); | |||
v.visitARRAYLENGTH(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ASTORE - Store reference into local variable | |||
* <PRE>Stack ..., objectref -> ... </PRE> | |||
* | |||
* @version $Id: ASTORE.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ASTORE extends StoreInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.ASTORE, org.aspectj.apache.bcel.Constants.ASTORE_0); | |||
} | |||
/** Store reference into local variable | |||
* @param n index of local variable | |||
*/ | |||
public ASTORE(int n) { | |||
super(org.aspectj.apache.bcel.Constants.ASTORE, org.aspectj.apache.bcel.Constants.ASTORE_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ATHROW - Throw exception | |||
* <PRE>Stack: ..., objectref -> objectref</PRE> | |||
* | |||
* @version $Id: ATHROW.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ATHROW extends Instruction implements UnconditionalBranch, ExceptionThrower { | |||
/** | |||
* Throw exception | |||
*/ | |||
public ATHROW() { | |||
super(org.aspectj.apache.bcel.Constants.ATHROW, (short)1); | |||
} | |||
/** @return exceptions this instruction may cause | |||
*/ | |||
public Class[] getExceptions() { | |||
return new Class[] { org.aspectj.apache.bcel.ExceptionConstants.THROWABLE }; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitUnconditionalBranch(this); | |||
v.visitExceptionThrower(this); | |||
v.visitATHROW(this); | |||
} | |||
} |
@@ -0,0 +1,64 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Denote family of instructions that allocates space in the heap. | |||
* | |||
* @version $Id: AllocationInstruction.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public interface AllocationInstruction {} | |||
@@ -0,0 +1,106 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.Constants; | |||
/** | |||
* Super class for the family of arithmetic instructions. | |||
* | |||
* @version $Id: ArithmeticInstruction.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class ArithmeticInstruction extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ArithmeticInstruction() {} | |||
/** | |||
* @param opcode of instruction | |||
*/ | |||
protected ArithmeticInstruction(short opcode) { | |||
super(opcode, (short)1); | |||
} | |||
/** @return type associated with the instruction | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
switch(opcode) { | |||
case Constants.DADD: case Constants.DDIV: case Constants.DMUL: | |||
case Constants.DNEG: case Constants.DREM: case Constants.DSUB: | |||
return Type.DOUBLE; | |||
case Constants.FADD: case Constants.FDIV: case Constants.FMUL: | |||
case Constants.FNEG: case Constants.FREM: case Constants.FSUB: | |||
return Type.FLOAT; | |||
case Constants.IADD: case Constants.IAND: case Constants.IDIV: | |||
case Constants.IMUL: case Constants.INEG: case Constants.IOR: case Constants.IREM: | |||
case Constants.ISHL: case Constants.ISHR: case Constants.ISUB: | |||
case Constants.IUSHR: case Constants.IXOR: | |||
return Type.INT; | |||
case Constants.LADD: case Constants.LAND: case Constants.LDIV: | |||
case Constants.LMUL: case Constants.LNEG: case Constants.LOR: case Constants.LREM: | |||
case Constants.LSHL: case Constants.LSHR: case Constants.LSUB: | |||
case Constants.LUSHR: case Constants.LXOR: | |||
return Type.LONG; | |||
default: // Never reached | |||
throw new ClassGenException("Unknown type " + opcode); | |||
} | |||
} | |||
} |
@@ -0,0 +1,106 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Super class for instructions dealing with array access such as IALOAD. | |||
* | |||
* @version $Id: ArrayInstruction.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class ArrayInstruction extends Instruction | |||
implements ExceptionThrower, TypedInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ArrayInstruction() {} | |||
/** | |||
* @param opcode of instruction | |||
*/ | |||
protected ArrayInstruction(short opcode) { | |||
super(opcode, (short)1); | |||
} | |||
public Class[] getExceptions() { | |||
return org.aspectj.apache.bcel.ExceptionConstants.EXCS_ARRAY_EXCEPTION; | |||
} | |||
/** @return type associated with the instruction | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
switch(opcode) { | |||
case org.aspectj.apache.bcel.Constants.IALOAD: case org.aspectj.apache.bcel.Constants.IASTORE: | |||
return Type.INT; | |||
case org.aspectj.apache.bcel.Constants.CALOAD: case org.aspectj.apache.bcel.Constants.CASTORE: | |||
return Type.CHAR; | |||
case org.aspectj.apache.bcel.Constants.BALOAD: case org.aspectj.apache.bcel.Constants.BASTORE: | |||
return Type.BYTE; | |||
case org.aspectj.apache.bcel.Constants.SALOAD: case org.aspectj.apache.bcel.Constants.SASTORE: | |||
return Type.SHORT; | |||
case org.aspectj.apache.bcel.Constants.LALOAD: case org.aspectj.apache.bcel.Constants.LASTORE: | |||
return Type.LONG; | |||
case org.aspectj.apache.bcel.Constants.DALOAD: case org.aspectj.apache.bcel.Constants.DASTORE: | |||
return Type.DOUBLE; | |||
case org.aspectj.apache.bcel.Constants.FALOAD: case org.aspectj.apache.bcel.Constants.FASTORE: | |||
return Type.FLOAT; | |||
case org.aspectj.apache.bcel.Constants.AALOAD: case org.aspectj.apache.bcel.Constants.AASTORE: | |||
return Type.OBJECT; | |||
default: throw new ClassGenException("Oops: unknown case in switch" + opcode); | |||
} | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* BALOAD - Load byte or boolean from array | |||
* <PRE>Stack: ..., arrayref, index -> ..., value</PRE> | |||
* | |||
* @version $Id: BALOAD.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class BALOAD extends ArrayInstruction implements StackProducer { | |||
/** Load byte or boolean from array | |||
*/ | |||
public BALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.BALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitBALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* BASTORE - Store into byte or boolean array | |||
* <PRE>Stack: ..., arrayref, index, value -> ...</PRE> | |||
* | |||
* @version $Id: BASTORE.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class BASTORE extends ArrayInstruction implements StackConsumer { | |||
/** Store byte or boolean into array | |||
*/ | |||
public BASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.BASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitBASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,131 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.io.*; | |||
import org.aspectj.apache.bcel.util.ByteSequence; | |||
/** | |||
* BIPUSH - Push byte on stack | |||
* | |||
* <PRE>Stack: ... -> ..., value</PRE> | |||
* | |||
* @version $Id: BIPUSH.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class BIPUSH extends Instruction implements ConstantPushInstruction { | |||
private byte b; | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
BIPUSH() {} | |||
/** Push byte on stack | |||
*/ | |||
public BIPUSH(byte b) { | |||
super(org.aspectj.apache.bcel.Constants.BIPUSH, (short)2); | |||
this.b = b; | |||
} | |||
/** | |||
* Dump instruction as byte code to stream out. | |||
*/ | |||
public void dump(DataOutputStream out) throws IOException { | |||
super.dump(out); | |||
out.writeByte(b); | |||
} | |||
/** | |||
* @return mnemonic for instruction | |||
*/ | |||
public String toString(boolean verbose) { | |||
return super.toString(verbose) + " " + b; | |||
} | |||
/** | |||
* Read needed data (e.g. index) from file. | |||
*/ | |||
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException | |||
{ | |||
length = 2; | |||
b = bytes.readByte(); | |||
} | |||
public Number getValue() { return new Integer(b); } | |||
/** @return Type.BYTE | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.BYTE; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitPushInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitConstantPushInstruction(this); | |||
v.visitBIPUSH(this); | |||
} | |||
} |
@@ -0,0 +1,79 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* BREAKPOINT, JVM dependent, ignored by default | |||
* | |||
* @version $Id: BREAKPOINT.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class BREAKPOINT extends Instruction { | |||
public BREAKPOINT() { | |||
super(org.aspectj.apache.bcel.Constants.BREAKPOINT, (short)1); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitBREAKPOINT(this); | |||
} | |||
} |
@@ -0,0 +1,246 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.io.*; | |||
import org.aspectj.apache.bcel.util.ByteSequence; | |||
/** | |||
* Abstract super class for branching instructions like GOTO, IFEQ, etc.. | |||
* Branch instructions may have a variable length, namely GOTO, JSR, | |||
* LOOKUPSWITCH and TABLESWITCH. | |||
* | |||
* @see InstructionList | |||
* @version $Id: BranchInstruction.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class BranchInstruction extends Instruction implements InstructionTargeter { | |||
protected int index; // Branch target relative to this instruction | |||
protected InstructionHandle target; // Target object in instruction list | |||
protected int position; // Byte code offset | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
BranchInstruction() {} | |||
/** Common super constructor | |||
* @param opcodee Instruction opcode | |||
* @param target instruction to branch to | |||
*/ | |||
protected BranchInstruction(short opcode, InstructionHandle target) { | |||
super(opcode, (short)3); | |||
setTarget(target); | |||
} | |||
/** | |||
* Dump instruction as byte code to stream out. | |||
* @param out Output stream | |||
*/ | |||
public void dump(DataOutputStream out) throws IOException { | |||
out.writeByte(opcode); | |||
index = getTargetOffset(); | |||
if(Math.abs(index) >= 32767) // too large for short | |||
throw new ClassGenException("Branch target offset too large for short"); | |||
out.writeShort(index); // May be negative, i.e., point backwards | |||
} | |||
/** | |||
* @param target branch target | |||
* @return the offset to `target' relative to this instruction | |||
*/ | |||
protected int getTargetOffset(InstructionHandle target) { | |||
if(target == null) | |||
throw new ClassGenException("Target of " + super.toString(true) + | |||
" is invalid null handle"); | |||
int t = target.getPosition(); | |||
if(t < 0) | |||
throw new ClassGenException("Invalid branch target position offset for " + | |||
super.toString(true) + ":" + t + ":" + target); | |||
return t - position; | |||
} | |||
/** | |||
* @return the offset to this instruction's target | |||
*/ | |||
protected int getTargetOffset() { return getTargetOffset(target); } | |||
/** | |||
* Called by InstructionList.setPositions when setting the position for every | |||
* instruction. In the presence of variable length instructions `setPositions' | |||
* performs multiple passes over the instruction list to calculate the | |||
* correct (byte) positions and offsets by calling this function. | |||
* | |||
* @param offset additional offset caused by preceding (variable length) instructions | |||
* @param max_offset the maximum offset that may be caused by these instructions | |||
* @return additional offset caused by possible change of this instruction's length | |||
*/ | |||
protected int updatePosition(int offset, int max_offset) { | |||
position += offset; | |||
return 0; | |||
} | |||
/** | |||
* Long output format: | |||
* | |||
* <position in byte code> | |||
* <name of opcode> "["<opcode number>"]" | |||
* "("<length of instruction>")" | |||
* "<"<target instruction>">" "@"<branch target offset> | |||
* | |||
* @param verbose long/short format switch | |||
* @return mnemonic for instruction | |||
*/ | |||
public String toString(boolean verbose) { | |||
String s = super.toString(verbose); | |||
String t = "null"; | |||
if(verbose) { | |||
if(target != null) { | |||
if(target.getInstruction() == this) | |||
t = "<points to itself>"; | |||
else if(target.getInstruction() == null) | |||
t = "<null instruction!!!?>"; | |||
else | |||
t = target.getInstruction().toString(false); // Avoid circles | |||
} | |||
} else { | |||
if(target != null) { | |||
index = getTargetOffset(); | |||
t = "" + (index + position); | |||
} | |||
} | |||
return s + " -> " + t; | |||
} | |||
/** | |||
* Read needed data (e.g. index) from file. Conversion to a InstructionHandle | |||
* is done in InstructionList(byte[]). | |||
* | |||
* @param bytes input stream | |||
* @param wide wide prefix? | |||
* @see InstructionList | |||
*/ | |||
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException | |||
{ | |||
length = 3; | |||
index = bytes.readShort(); | |||
} | |||
/** | |||
* @return target offset in byte code | |||
*/ | |||
public final int getIndex() { return index; } | |||
/** | |||
* @return target of branch instruction | |||
*/ | |||
public InstructionHandle getTarget() { return target; } | |||
/** | |||
* Set branch target | |||
* @param target branch target | |||
*/ | |||
public void setTarget(InstructionHandle target) { | |||
notifyTarget(this.target, target, this); | |||
this.target = target; | |||
} | |||
/** | |||
* Used by BranchInstruction, LocalVariableGen, CodeExceptionGen | |||
*/ | |||
static final void notifyTarget(InstructionHandle old_ih, InstructionHandle new_ih, | |||
InstructionTargeter t) { | |||
if(old_ih != null) | |||
old_ih.removeTargeter(t); | |||
if(new_ih != null) | |||
new_ih.addTargeter(t); | |||
} | |||
/** | |||
* @param old_ih old target | |||
* @param new_ih new target | |||
*/ | |||
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) { | |||
if(target == old_ih) | |||
setTarget(new_ih); | |||
else | |||
throw new ClassGenException("Not targeting " + old_ih + ", but " + target); | |||
} | |||
/** | |||
* @return true, if ih is target of this instruction | |||
*/ | |||
public boolean containsTarget(InstructionHandle ih) { | |||
return (target == ih); | |||
} | |||
/** | |||
* Inform target that it's not targeted anymore. | |||
*/ | |||
void dispose() { | |||
setTarget(null); | |||
index=-1; | |||
position=-1; | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* CALOAD - Load char from array | |||
* <PRE>Stack: ..., arrayref, index -> ..., value</PRE> | |||
* | |||
* @version $Id: CALOAD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class CALOAD extends ArrayInstruction implements StackProducer { | |||
/** Load char from array | |||
*/ | |||
public CALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.CALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitCALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* CASTORE - Store into char array | |||
* <PRE>Stack: ..., arrayref, index, value -> ...</PRE> | |||
* | |||
* @version $Id: CASTORE.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class CASTORE extends ArrayInstruction implements StackConsumer { | |||
/** Store char into array | |||
*/ | |||
public CASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.CASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitCASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,117 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.ExceptionConstants; | |||
/** | |||
* CHECKCAST - Check whether object is of given type | |||
* <PRE>Stack: ..., objectref -> ..., objectref</PRE> | |||
* | |||
* @version $Id: CHECKCAST.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class CHECKCAST extends CPInstruction | |||
implements LoadClass, ExceptionThrower, StackProducer, StackConsumer { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
CHECKCAST() {} | |||
/** Check whether object is of given type | |||
* @param n index to class in constant pool | |||
*/ | |||
public CHECKCAST(int index) { | |||
super(org.aspectj.apache.bcel.Constants.CHECKCAST, index); | |||
} | |||
/** @return exceptions this instruction may cause | |||
*/ | |||
public Class[] getExceptions() { | |||
Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length]; | |||
System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0, | |||
cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length); | |||
cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = | |||
ExceptionConstants.CLASS_CAST_EXCEPTION; | |||
return cs; | |||
} | |||
public ObjectType getLoadClassType(ConstantPoolGen cpg) { | |||
Type t = getType(cpg); | |||
if(t instanceof ArrayType) | |||
t = ((ArrayType) t).getBasicType(); | |||
return (t instanceof ObjectType)? (ObjectType) t : null; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitLoadClass(this); | |||
v.visitExceptionThrower(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitCPInstruction(this); | |||
v.visitCHECKCAST(this); | |||
} | |||
} |
@@ -0,0 +1,169 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.io.DataOutputStream; | |||
import java.io.IOException; | |||
import org.aspectj.apache.bcel.classfile.Constant; | |||
import org.aspectj.apache.bcel.classfile.ConstantClass; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.util.ByteSequence; | |||
/** | |||
* Abstract super class for instructions that use an index into the | |||
* constant pool such as LDC, INVOKEVIRTUAL, etc. | |||
* | |||
* @see ConstantPoolGen | |||
* @see LDC | |||
* @see INVOKEVIRTUAL | |||
* | |||
* @version $Id: CPInstruction.java,v 1.8 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class CPInstruction extends Instruction | |||
implements TypedInstruction, IndexedInstruction | |||
{ | |||
protected int index; // index to constant pool | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
CPInstruction() {} | |||
/** | |||
* @param index to constant pool | |||
*/ | |||
protected CPInstruction(short opcode, int index) { | |||
super(opcode, (short)3); | |||
setIndex(index); | |||
} | |||
/** | |||
* Dump instruction as byte code to stream out. | |||
* @param out Output stream | |||
*/ | |||
public void dump(DataOutputStream out) throws IOException { | |||
out.writeByte(opcode); | |||
out.writeShort(index); | |||
} | |||
/** | |||
* Long output format: | |||
* | |||
* <name of opcode> "["<opcode number>"]" | |||
* "("<length of instruction>")" "<"< constant pool index>">" | |||
* | |||
* @param verbose long/short format switch | |||
* @return mnemonic for instruction | |||
*/ | |||
public String toString(boolean verbose) { | |||
return super.toString(verbose) + " " + index; | |||
} | |||
/** | |||
* @return mnemonic for instruction with symbolic references resolved | |||
*/ | |||
public String toString(ConstantPool cp) { | |||
Constant c = cp.getConstant(index); | |||
String str = cp.constantToString(c); | |||
if(c instanceof ConstantClass) | |||
str = str.replace('.', '/'); | |||
return org.aspectj.apache.bcel.Constants.OPCODE_NAMES[opcode] + " " + str; | |||
} | |||
/** | |||
* Read needed data (i.e., index) from file. | |||
* @param bytes input stream | |||
* @param wide wide prefix? | |||
*/ | |||
protected void initFromFile(ByteSequence bytes, boolean wide) | |||
throws IOException | |||
{ | |||
setIndex(bytes.readUnsignedShort()); | |||
length = 3; | |||
} | |||
/** | |||
* @return index in constant pool referred by this instruction. | |||
*/ | |||
public final int getIndex() { return index; } | |||
/** | |||
* Set the index to constant pool. | |||
* @param index in constant pool. | |||
*/ | |||
public void setIndex(int index) { | |||
if(index < 0) | |||
throw new ClassGenException("Negative index value: " + index); | |||
this.index = index; | |||
} | |||
/** @return type related with this instruction. | |||
*/ | |||
public Type getType(ConstantPoolGen cpg) { | |||
ConstantPool cp = cpg.getConstantPool(); | |||
String name = cp.getConstantString(index, org.aspectj.apache.bcel.Constants.CONSTANT_Class); | |||
if(!name.startsWith("[")) | |||
name = "L" + name + ";"; | |||
return Type.getType(name); | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Implement this interface if you're interested in changes to a ClassGen object | |||
* and register yourself with addObserver(). | |||
* | |||
* @version $Id: ClassObserver.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public interface ClassObserver { | |||
public void notify(ClassGen clazz); | |||
} | |||
@@ -0,0 +1,76 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Wrapper class for `compound' operations, virtual instructions that | |||
* don't exist as byte code, but give a useful meaning. For example, | |||
* the (virtual) PUSH instruction takes an arbitray argument and produces the | |||
* appropiate code at dump time (ICONST, LDC, BIPUSH, ...). Also you can use the | |||
* SWITCH instruction as a useful template for either LOOKUPSWITCH or | |||
* TABLESWITCH. | |||
* | |||
* The interface provides the possibilty for the user to write | |||
* `templates' or `macros' for such reuseable code patterns. | |||
* | |||
* @version $Id: CompoundInstruction.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
* @see PUSH | |||
* @see SWITCH | |||
*/ | |||
public interface CompoundInstruction { | |||
public InstructionList getInstructionList(); | |||
} | |||
@@ -0,0 +1,802 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.util.HashMap; | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.classfile.Constant; | |||
import org.aspectj.apache.bcel.classfile.ConstantCP; | |||
import org.aspectj.apache.bcel.classfile.ConstantClass; | |||
import org.aspectj.apache.bcel.classfile.ConstantDouble; | |||
import org.aspectj.apache.bcel.classfile.ConstantFieldref; | |||
import org.aspectj.apache.bcel.classfile.ConstantFloat; | |||
import org.aspectj.apache.bcel.classfile.ConstantInteger; | |||
import org.aspectj.apache.bcel.classfile.ConstantInterfaceMethodref; | |||
import org.aspectj.apache.bcel.classfile.ConstantLong; | |||
import org.aspectj.apache.bcel.classfile.ConstantMethodref; | |||
import org.aspectj.apache.bcel.classfile.ConstantNameAndType; | |||
import org.aspectj.apache.bcel.classfile.ConstantPool; | |||
import org.aspectj.apache.bcel.classfile.ConstantString; | |||
import org.aspectj.apache.bcel.classfile.ConstantUtf8; | |||
/** | |||
* This class is used to build up a constant pool. The user adds | |||
* constants via `addXXX' methods, `addString', `addClass', | |||
* etc.. These methods return an index into the constant | |||
* pool. Finally, `getFinalConstantPool()' returns the constant pool | |||
* built up. Intermediate versions of the constant pool can be | |||
* obtained with `getConstantPool()'. A constant pool has capacity for | |||
* Constants.MAX_SHORT entries. Note that the first (0) is used by the | |||
* JVM and that Double and Long constants need two slots. | |||
* | |||
* @version $Id: ConstantPoolGen.java,v 1.7 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
* @see Constant | |||
*/ | |||
public class ConstantPoolGen implements java.io.Serializable { | |||
protected int size = 1024; // Inital size, sufficient in most cases | |||
protected Constant[] constants = new Constant[size]; | |||
protected int index = 1; // First entry (0) used by JVM | |||
private static final String METHODREF_DELIM = ":"; | |||
private static final String IMETHODREF_DELIM = "#"; | |||
private static final String FIELDREF_DELIM = "&"; | |||
private static final String NAT_DELIM = "%"; | |||
private static class Index implements java.io.Serializable { | |||
int index; | |||
Index(int i) { index = i; } | |||
} | |||
/** | |||
* Initialize with given array of constants. | |||
* | |||
* @param c array of given constants, new ones will be appended | |||
*/ | |||
public ConstantPoolGen(Constant[] cs) { | |||
if(cs.length > size) { | |||
size = cs.length; | |||
constants = new Constant[size]; | |||
} | |||
System.arraycopy(cs, 0, constants, 0, cs.length); | |||
if(cs.length > 0) | |||
index = cs.length; | |||
for(int i=1; i < index; i++) { | |||
Constant c = constants[i]; | |||
if(c instanceof ConstantString) { | |||
ConstantString s = (ConstantString)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[s.getStringIndex()]; | |||
string_table.put(u8.getBytes(), new Index(i)); | |||
} else if(c instanceof ConstantClass) { | |||
ConstantClass s = (ConstantClass)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[s.getNameIndex()]; | |||
class_table.put(u8.getBytes(), new Index(i)); | |||
} else if(c instanceof ConstantNameAndType) { | |||
ConstantNameAndType n = (ConstantNameAndType)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[n.getNameIndex()]; | |||
ConstantUtf8 u8_2 = (ConstantUtf8)constants[n.getSignatureIndex()]; | |||
n_a_t_table.put(u8.getBytes() + NAT_DELIM + u8_2.getBytes(), new Index(i)); | |||
} else if(c instanceof ConstantUtf8) { | |||
ConstantUtf8 u = (ConstantUtf8)c; | |||
utf8_table.put(u.getBytes(), new Index(i)); | |||
} else if(c instanceof ConstantCP) { | |||
ConstantCP m = (ConstantCP)c; | |||
ConstantClass clazz = (ConstantClass)constants[m.getClassIndex()]; | |||
ConstantNameAndType n = (ConstantNameAndType)constants[m.getNameAndTypeIndex()]; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[clazz.getNameIndex()]; | |||
String class_name = u8.getBytes().replace('/', '.'); | |||
u8 = (ConstantUtf8)constants[n.getNameIndex()]; | |||
String method_name = u8.getBytes(); | |||
u8 = (ConstantUtf8)constants[n.getSignatureIndex()]; | |||
String signature = u8.getBytes(); | |||
String delim = METHODREF_DELIM; | |||
if(c instanceof ConstantInterfaceMethodref) | |||
delim = IMETHODREF_DELIM; | |||
else if(c instanceof ConstantFieldref) | |||
delim = FIELDREF_DELIM; | |||
cp_table.put(class_name + delim + method_name + delim + signature, new Index(i)); | |||
} | |||
} | |||
} | |||
/** | |||
* Initialize with given constant pool. | |||
*/ | |||
public ConstantPoolGen(ConstantPool cp) { | |||
this(cp.getConstantPool()); | |||
} | |||
/** | |||
* Create empty constant pool. | |||
*/ | |||
public ConstantPoolGen() {} | |||
/** Resize internal array of constants. | |||
*/ | |||
protected void adjustSize() { | |||
if(index + 3 >= size) { | |||
Constant[] cs = constants; | |||
size *= 2; | |||
constants = new Constant[size]; | |||
System.arraycopy(cs, 0, constants, 0, index); | |||
} | |||
} | |||
private HashMap string_table = new HashMap(); | |||
/** | |||
* Look for ConstantString in ConstantPool containing String `str'. | |||
* | |||
* @param str String to search for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupString(String str) { | |||
Index index = (Index)string_table.get(str); | |||
return (index != null)? index.index : -1; | |||
} | |||
/** | |||
* Add a new String constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param str String to add | |||
* @return index of entry | |||
*/ | |||
public int addString(String str) { | |||
int ret; | |||
if((ret = lookupString(str)) != -1) | |||
return ret; // Already in CP | |||
int utf8 = addUtf8(str); | |||
adjustSize(); | |||
ConstantString s = new ConstantString(utf8); | |||
ret = index; | |||
constants[index++] = s; | |||
string_table.put(str, new Index(ret)); | |||
return ret; | |||
} | |||
private HashMap class_table = new HashMap(); | |||
/** | |||
* Look for ConstantClass in ConstantPool named `str'. | |||
* | |||
* @param str String to search for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupClass(String str) { | |||
Index index = (Index)class_table.get(str.replace('.', '/')); | |||
return (index != null)? index.index : -1; | |||
} | |||
private int addClass_(String clazz) { | |||
int ret; | |||
if((ret = lookupClass(clazz)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ConstantClass c = new ConstantClass(addUtf8(clazz)); | |||
ret = index; | |||
constants[index++] = c; | |||
class_table.put(clazz, new Index(ret)); | |||
return ret; | |||
} | |||
/** | |||
* Add a new Class reference to the ConstantPool, if it is not already in there. | |||
* | |||
* @param str Class to add | |||
* @return index of entry | |||
*/ | |||
public int addClass(String str) { | |||
return addClass_(str.replace('.', '/')); | |||
} | |||
/** | |||
* Add a new Class reference to the ConstantPool for a given type. | |||
* | |||
* @param str Class to add | |||
* @return index of entry | |||
*/ | |||
public int addClass(ObjectType type) { | |||
//BCELBUG:? Should this we getClassName() - perhaps it should be getSignature() ?!? | |||
return addClass(type.getClassName()); | |||
// return addClass(type.getSignature()); | |||
} | |||
/** | |||
* Add a reference to an array class (e.g. String[][]) as needed by MULTIANEWARRAY | |||
* instruction, e.g. to the ConstantPool. | |||
* | |||
* @param type type of array class | |||
* @return index of entry | |||
*/ | |||
public int addArrayClass(ArrayType type) { | |||
return addClass_(type.getSignature()); | |||
} | |||
/** | |||
* Look for ConstantInteger in ConstantPool. | |||
* | |||
* @param n integer number to look for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupInteger(int n) { | |||
for(int i=1; i < index; i++) { | |||
if(constants[i] instanceof ConstantInteger) { | |||
ConstantInteger c = (ConstantInteger)constants[i]; | |||
if(c.getBytes() == n) | |||
return i; | |||
} | |||
} | |||
return -1; | |||
} | |||
/** | |||
* Add a new Integer constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param n integer number to add | |||
* @return index of entry | |||
*/ | |||
public int addInteger(int n) { | |||
int ret; | |||
if((ret = lookupInteger(n)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ret = index; | |||
constants[index++] = new ConstantInteger(n); | |||
return ret; | |||
} | |||
/** | |||
* Look for ConstantFloat in ConstantPool. | |||
* | |||
* @param n Float number to look for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupFloat(float n) { | |||
int bits = Float.floatToIntBits(n); | |||
for(int i=1; i < index; i++) { | |||
if(constants[i] instanceof ConstantFloat) { | |||
ConstantFloat c = (ConstantFloat)constants[i]; | |||
if(Float.floatToIntBits(c.getBytes()) == bits) | |||
return i; | |||
} | |||
} | |||
return -1; | |||
} | |||
/** | |||
* Add a new Float constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param n Float number to add | |||
* @return index of entry | |||
*/ | |||
public int addFloat(float n) { | |||
int ret; | |||
if((ret = lookupFloat(n)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ret = index; | |||
constants[index++] = new ConstantFloat(n); | |||
return ret; | |||
} | |||
private HashMap utf8_table = new HashMap(); | |||
/** | |||
* Look for ConstantUtf8 in ConstantPool. | |||
* | |||
* @param n Utf8 string to look for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupUtf8(String n) { | |||
Index index = (Index)utf8_table.get(n); | |||
return (index != null)? index.index : -1; | |||
} | |||
/** | |||
* Add a new Utf8 constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param n Utf8 string to add | |||
* @return index of entry | |||
*/ | |||
public int addUtf8(String n) { | |||
int ret; | |||
if((ret = lookupUtf8(n)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ret = index; | |||
constants[index++] = new ConstantUtf8(n); | |||
utf8_table.put(n, new Index(ret)); | |||
return ret; | |||
} | |||
/** | |||
* Look for ConstantLong in ConstantPool. | |||
* | |||
* @param n Long number to look for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupLong(long n) { | |||
for(int i=1; i < index; i++) { | |||
if(constants[i] instanceof ConstantLong) { | |||
ConstantLong c = (ConstantLong)constants[i]; | |||
if(c.getBytes() == n) | |||
return i; | |||
} | |||
} | |||
return -1; | |||
} | |||
/** | |||
* Add a new long constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param n Long number to add | |||
* @return index of entry | |||
*/ | |||
public int addLong(long n) { | |||
int ret; | |||
if((ret = lookupLong(n)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ret = index; | |||
constants[index] = new ConstantLong(n); | |||
index += 2; // Wastes one entry according to spec | |||
return ret; | |||
} | |||
/** | |||
* Look for ConstantDouble in ConstantPool. | |||
* | |||
* @param n Double number to look for | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupDouble(double n) { | |||
long bits = Double.doubleToLongBits(n); | |||
for(int i=1; i < index; i++) { | |||
if(constants[i] instanceof ConstantDouble) { | |||
ConstantDouble c = (ConstantDouble)constants[i]; | |||
if(Double.doubleToLongBits(c.getBytes()) == bits) | |||
return i; | |||
} | |||
} | |||
return -1; | |||
} | |||
/** | |||
* Add a new double constant to the ConstantPool, if it is not already in there. | |||
* | |||
* @param n Double number to add | |||
* @return index of entry | |||
*/ | |||
public int addDouble(double n) { | |||
int ret; | |||
if((ret = lookupDouble(n)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
ret = index; | |||
constants[index] = new ConstantDouble(n); | |||
index += 2; // Wastes one entry according to spec | |||
return ret; | |||
} | |||
private HashMap n_a_t_table = new HashMap(); | |||
/** | |||
* Look for ConstantNameAndType in ConstantPool. | |||
* | |||
* @param name of variable/method | |||
* @param signature of variable/method | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupNameAndType(String name, String signature) { | |||
Index index = (Index)n_a_t_table.get(name + NAT_DELIM + signature); | |||
return (index != null)? index.index : -1; | |||
} | |||
/** | |||
* Add a new NameAndType constant to the ConstantPool if it is not already | |||
* in there. | |||
* | |||
* @param n NameAndType string to add | |||
* @return index of entry | |||
*/ | |||
public int addNameAndType(String name, String signature) { | |||
int ret; | |||
int name_index, signature_index; | |||
if((ret = lookupNameAndType(name, signature)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
name_index = addUtf8(name); | |||
signature_index = addUtf8(signature); | |||
ret = index; | |||
constants[index++] = new ConstantNameAndType(name_index, signature_index); | |||
n_a_t_table.put(name + NAT_DELIM + signature, new Index(ret)); | |||
return ret; | |||
} | |||
private HashMap cp_table = new HashMap(); | |||
/** | |||
* Look for ConstantMethodref in ConstantPool. | |||
* | |||
* @param class_name Where to find method | |||
* @param method_name Guess what | |||
* @param signature return and argument types | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupMethodref(String class_name, String method_name, String signature) { | |||
Index index = (Index)cp_table.get(class_name + METHODREF_DELIM + method_name + | |||
METHODREF_DELIM + signature); | |||
return (index != null)? index.index : -1; | |||
} | |||
public int lookupMethodref(MethodGen method) { | |||
return lookupMethodref(method.getClassName(), method.getName(), | |||
method.getSignature()); | |||
} | |||
/** | |||
* Add a new Methodref constant to the ConstantPool, if it is not already | |||
* in there. | |||
* | |||
* @param n Methodref string to add | |||
* @return index of entry | |||
*/ | |||
public int addMethodref(String class_name, String method_name, String signature) { | |||
int ret, class_index, name_and_type_index; | |||
if((ret = lookupMethodref(class_name, method_name, signature)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
name_and_type_index = addNameAndType(method_name, signature); | |||
class_index = addClass(class_name); | |||
ret = index; | |||
constants[index++] = new ConstantMethodref(class_index, name_and_type_index); | |||
cp_table.put(class_name + METHODREF_DELIM + method_name + | |||
METHODREF_DELIM + signature, new Index(ret)); | |||
return ret; | |||
} | |||
public int addMethodref(MethodGen method) { | |||
return addMethodref(method.getClassName(), method.getName(), | |||
method.getSignature()); | |||
} | |||
/** | |||
* Look for ConstantInterfaceMethodref in ConstantPool. | |||
* | |||
* @param class_name Where to find method | |||
* @param method_name Guess what | |||
* @param signature return and argument types | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupInterfaceMethodref(String class_name, String method_name, String signature) { | |||
Index index = (Index)cp_table.get(class_name + IMETHODREF_DELIM + method_name + | |||
IMETHODREF_DELIM + signature); | |||
return (index != null)? index.index : -1; | |||
} | |||
public int lookupInterfaceMethodref(MethodGen method) { | |||
return lookupInterfaceMethodref(method.getClassName(), method.getName(), | |||
method.getSignature()); | |||
} | |||
/** | |||
* Add a new InterfaceMethodref constant to the ConstantPool, if it is not already | |||
* in there. | |||
* | |||
* @param n InterfaceMethodref string to add | |||
* @return index of entry | |||
*/ | |||
public int addInterfaceMethodref(String class_name, String method_name, String signature) { | |||
int ret, class_index, name_and_type_index; | |||
if((ret = lookupInterfaceMethodref(class_name, method_name, signature)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
class_index = addClass(class_name); | |||
name_and_type_index = addNameAndType(method_name, signature); | |||
ret = index; | |||
constants[index++] = new ConstantInterfaceMethodref(class_index, name_and_type_index); | |||
cp_table.put(class_name + IMETHODREF_DELIM + method_name + | |||
IMETHODREF_DELIM + signature, new Index(ret)); | |||
return ret; | |||
} | |||
public int addInterfaceMethodref(MethodGen method) { | |||
return addInterfaceMethodref(method.getClassName(), method.getName(), | |||
method.getSignature()); | |||
} | |||
/** | |||
* Look for ConstantFieldref in ConstantPool. | |||
* | |||
* @param class_name Where to find method | |||
* @param field_name Guess what | |||
* @param signature return and argument types | |||
* @return index on success, -1 otherwise | |||
*/ | |||
public int lookupFieldref(String class_name, String field_name, String signature) { | |||
Index index = (Index)cp_table.get(class_name + FIELDREF_DELIM + field_name + | |||
FIELDREF_DELIM + signature); | |||
return (index != null)? index.index : -1; | |||
} | |||
/** | |||
* Add a new Fieldref constant to the ConstantPool, if it is not already | |||
* in there. | |||
* | |||
* @param n Fieldref string to add | |||
* @return index of entry | |||
*/ | |||
public int addFieldref(String class_name, String field_name, String signature) { | |||
int ret; | |||
int class_index, name_and_type_index; | |||
if((ret = lookupFieldref(class_name, field_name, signature)) != -1) | |||
return ret; // Already in CP | |||
adjustSize(); | |||
class_index = addClass(class_name); | |||
name_and_type_index = addNameAndType(field_name, signature); | |||
ret = index; | |||
constants[index++] = new ConstantFieldref(class_index, name_and_type_index); | |||
cp_table.put(class_name + FIELDREF_DELIM + field_name + FIELDREF_DELIM + signature, new Index(ret)); | |||
return ret; | |||
} | |||
/** | |||
* @param i index in constant pool | |||
* @return constant pool entry at index i | |||
*/ | |||
public Constant getConstant(int i) { return constants[i]; } | |||
/** | |||
* Use with care! | |||
* | |||
* @param i index in constant pool | |||
* @param c new constant pool entry at index i | |||
*/ | |||
public void setConstant(int i, Constant c) { constants[i] = c; } | |||
/** | |||
* @return intermediate constant pool | |||
*/ | |||
public ConstantPool getConstantPool() { | |||
return new ConstantPool(constants); | |||
} | |||
/** | |||
* @return current size of constant pool | |||
*/ | |||
public int getSize() { | |||
return index; | |||
} | |||
/** | |||
* @return constant pool with proper length | |||
*/ | |||
public ConstantPool getFinalConstantPool() { | |||
Constant[] cs = new Constant[index]; | |||
System.arraycopy(constants, 0, cs, 0, index); | |||
return new ConstantPool(cs); | |||
} | |||
/** | |||
* @return String representation. | |||
*/ | |||
public String toString() { | |||
StringBuffer buf = new StringBuffer(); | |||
for(int i=1; i < index; i++) | |||
buf.append(i + ")" + constants[i] + "\n"); | |||
return buf.toString(); | |||
} | |||
/** Import constant from another ConstantPool and return new index. | |||
*/ | |||
public int addConstant(Constant c, ConstantPoolGen cp) { | |||
Constant[] constants = cp.getConstantPool().getConstantPool(); | |||
switch(c.getTag()) { | |||
case Constants.CONSTANT_String: { | |||
ConstantString s = (ConstantString)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[s.getStringIndex()]; | |||
return addString(u8.getBytes()); | |||
} | |||
case Constants.CONSTANT_Class: { | |||
ConstantClass s = (ConstantClass)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[s.getNameIndex()]; | |||
return addClass(u8.getBytes()); | |||
} | |||
case Constants.CONSTANT_NameAndType: { | |||
ConstantNameAndType n = (ConstantNameAndType)c; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[n.getNameIndex()]; | |||
ConstantUtf8 u8_2 = (ConstantUtf8)constants[n.getSignatureIndex()]; | |||
return addNameAndType(u8.getBytes(), u8_2.getBytes()); | |||
} | |||
case Constants.CONSTANT_Utf8: | |||
return addUtf8(((ConstantUtf8)c).getBytes()); | |||
case Constants.CONSTANT_Double: | |||
return addDouble(((ConstantDouble)c).getBytes()); | |||
case Constants.CONSTANT_Float: | |||
return addFloat(((ConstantFloat)c).getBytes()); | |||
case Constants.CONSTANT_Long: | |||
return addLong(((ConstantLong)c).getBytes()); | |||
case Constants.CONSTANT_Integer: | |||
return addInteger(((ConstantInteger)c).getBytes()); | |||
case Constants.CONSTANT_InterfaceMethodref: case Constants.CONSTANT_Methodref: | |||
case Constants.CONSTANT_Fieldref: { | |||
ConstantCP m = (ConstantCP)c; | |||
ConstantClass clazz = (ConstantClass)constants[m.getClassIndex()]; | |||
ConstantNameAndType n = (ConstantNameAndType)constants[m.getNameAndTypeIndex()]; | |||
ConstantUtf8 u8 = (ConstantUtf8)constants[clazz.getNameIndex()]; | |||
String class_name = u8.getBytes().replace('/', '.'); | |||
u8 = (ConstantUtf8)constants[n.getNameIndex()]; | |||
String name = u8.getBytes(); | |||
u8 = (ConstantUtf8)constants[n.getSignatureIndex()]; | |||
String signature = u8.getBytes(); | |||
switch(c.getTag()) { | |||
case Constants.CONSTANT_InterfaceMethodref: | |||
return addInterfaceMethodref(class_name, name, signature); | |||
case Constants.CONSTANT_Methodref: | |||
return addMethodref(class_name, name, signature); | |||
case Constants.CONSTANT_Fieldref: | |||
return addFieldref(class_name, name, signature); | |||
default: // Never reached | |||
throw new RuntimeException("Unknown constant type " + c); | |||
} | |||
} | |||
default: // Never reached | |||
throw new RuntimeException("Unknown constant type " + c); | |||
} | |||
} | |||
} |
@@ -0,0 +1,70 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Denotes a push instruction that produces a literal on the stack | |||
* such as SIPUSH, BIPUSH, ICONST, etc. | |||
* | |||
* @version $Id: ConstantPushInstruction.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
* @see ICONST | |||
* @see SIPUSH | |||
*/ | |||
public interface ConstantPushInstruction extends PushInstruction, TypedInstruction { | |||
public Number getValue(); | |||
} | |||
@@ -0,0 +1,102 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.Constants; | |||
/** | |||
* Super class for the x2y family of instructions. | |||
* | |||
* @version $Id: ConversionInstruction.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class ConversionInstruction extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ConversionInstruction() {} | |||
/** | |||
* @param opcode opcode of instruction | |||
*/ | |||
protected ConversionInstruction(short opcode) { | |||
super(opcode, (short)1); | |||
} | |||
/** @return type associated with the instruction | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
switch(opcode) { | |||
case Constants.D2I: case Constants.F2I: case Constants.L2I: | |||
return Type.INT; | |||
case Constants.D2F: case Constants.I2F: case Constants.L2F: | |||
return Type.FLOAT; | |||
case Constants.D2L: case Constants.F2L: case Constants.I2L: | |||
return Type.LONG; | |||
case Constants.F2D: case Constants.I2D: case Constants.L2D: | |||
return Type.DOUBLE; | |||
case Constants.I2B: | |||
return Type.BYTE; | |||
case Constants.I2C: | |||
return Type.CHAR; | |||
case Constants.I2S: | |||
return Type.SHORT; | |||
default: // Never reached | |||
throw new ClassGenException("Unknown type " + opcode); | |||
} | |||
} | |||
} | |||
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* D2F - Convert double to float | |||
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result</PRE> | |||
* | |||
* @version $Id: D2F.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class D2F extends ConversionInstruction { | |||
/** Convert double to float | |||
*/ | |||
public D2F() { | |||
super(org.aspectj.apache.bcel.Constants.D2F); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitD2F(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* D2I - Convert double to int | |||
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result</PRE> | |||
* | |||
* @version $Id: D2I.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class D2I extends ConversionInstruction { | |||
/** Convert double to int | |||
*/ | |||
public D2I() { | |||
super(org.aspectj.apache.bcel.Constants.D2I); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitD2I(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* D2L - Convert double to long | |||
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: D2L.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class D2L extends ConversionInstruction { | |||
/** Convert double to long | |||
*/ | |||
public D2L() { | |||
super(org.aspectj.apache.bcel.Constants.D2L); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitD2L(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DADD - Add doubles | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result.word1, result1.word2 | |||
* | |||
* @version $Id: DADD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DADD extends ArithmeticInstruction { | |||
/** Add doubles | |||
*/ | |||
public DADD() { | |||
super(org.aspectj.apache.bcel.Constants.DADD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDADD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DALOAD - Load double from array | |||
* <PRE>Stack: ..., arrayref, index -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: DALOAD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DALOAD extends ArrayInstruction implements StackProducer { | |||
/** Load double from array | |||
*/ | |||
public DALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.DALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitDALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DASTORE - Store into double array | |||
* <PRE>Stack: ..., arrayref, index, value.word1, value.word2 -> ...</PRE> | |||
* | |||
* @version $Id: DASTORE.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DASTORE extends ArrayInstruction implements StackConsumer { | |||
/** Store double into array | |||
*/ | |||
public DASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.DASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitDASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,93 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DCMPG - Compare doubles: value1 > value2 | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result | |||
* | |||
* @version $Id: DCMPG.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DCMPG extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
public DCMPG() { | |||
super(org.aspectj.apache.bcel.Constants.DCMPG, (short)1); | |||
} | |||
/** @return Type.DOUBLE | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.DOUBLE; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitDCMPG(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DCMPL - Compare doubles: value1 < value2 | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result | |||
* | |||
* @version $Id: DCMPL.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DCMPL extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
public DCMPL() { | |||
super(org.aspectj.apache.bcel.Constants.DCMPL, (short)1); | |||
} | |||
/** @return Type.DOUBLE | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.DOUBLE; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitDCMPL(this); | |||
} | |||
} |
@@ -0,0 +1,111 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DCONST - Push 0.0 or 1.0, other values cause an exception | |||
* | |||
* <PRE>Stack: ... -> ..., </PRE> | |||
* | |||
* @version $Id: DCONST.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DCONST extends Instruction | |||
implements ConstantPushInstruction, TypedInstruction { | |||
private double value; | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
DCONST() {} | |||
public DCONST(double f) { | |||
super(org.aspectj.apache.bcel.Constants.DCONST_0, (short)1); | |||
if(f == 0.0) | |||
opcode = org.aspectj.apache.bcel.Constants.DCONST_0; | |||
else if(f == 1.0) | |||
opcode = org.aspectj.apache.bcel.Constants.DCONST_1; | |||
else | |||
throw new ClassGenException("DCONST can be used only for 0.0 and 1.0: " + f); | |||
value = f; | |||
} | |||
public Number getValue() { return new Double(value); } | |||
/** @return Type.DOUBLE | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.DOUBLE; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitPushInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitConstantPushInstruction(this); | |||
v.visitDCONST(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DDIV - Divide doubles | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result.word1, result.word2 | |||
* | |||
* @version $Id: DDIV.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DDIV extends ArithmeticInstruction { | |||
/** Divide doubles | |||
*/ | |||
public DDIV() { | |||
super(org.aspectj.apache.bcel.Constants.DDIV); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDDIV(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DLOAD - Load double from local variable | |||
* <PRE>Stack ... -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: DLOAD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DLOAD extends LoadInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
DLOAD() { | |||
super(org.aspectj.apache.bcel.Constants.DLOAD, org.aspectj.apache.bcel.Constants.DLOAD_0); | |||
} | |||
/** Load double from local variable | |||
* @param n index of local variable | |||
*/ | |||
public DLOAD(int n) { | |||
super(org.aspectj.apache.bcel.Constants.DLOAD, org.aspectj.apache.bcel.Constants.DLOAD_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitDLOAD(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DMUL - Multiply doubles | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result.word1, result.word2 | |||
* | |||
* @version $Id: DMUL.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DMUL extends ArithmeticInstruction { | |||
/** Multiply doubles | |||
*/ | |||
public DMUL() { | |||
super(org.aspectj.apache.bcel.Constants.DMUL); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDMUL(this); | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DNEG - Negate double | |||
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: DNEG.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DNEG extends ArithmeticInstruction { | |||
public DNEG() { | |||
super(org.aspectj.apache.bcel.Constants.DNEG); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDNEG(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DREM - Remainder of doubles | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result.word1, result.word2 | |||
* | |||
* @version $Id: DREM.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DREM extends ArithmeticInstruction { | |||
/** Remainder of doubles | |||
*/ | |||
public DREM() { | |||
super(org.aspectj.apache.bcel.Constants.DREM); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDREM(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DRETURN - Return double from method | |||
* <PRE>Stack: ..., value.word1, value.word2 -> <empty></PRE> | |||
* | |||
* @version $Id: DRETURN.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DRETURN extends ReturnInstruction { | |||
/** Return double from method | |||
*/ | |||
public DRETURN() { | |||
super(org.aspectj.apache.bcel.Constants.DRETURN); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitStackConsumer(this); | |||
v.visitReturnInstruction(this); | |||
v.visitDRETURN(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DSTORE - Store double into local variable | |||
* <pre>Stack: ..., value.word1, value.word2 -> ... </PRE> | |||
* | |||
* @version $Id: DSTORE.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DSTORE extends StoreInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
DSTORE() { | |||
super(org.aspectj.apache.bcel.Constants.DSTORE, org.aspectj.apache.bcel.Constants.DSTORE_0); | |||
} | |||
/** Store double into local variable | |||
* @param n index of local variable | |||
*/ | |||
public DSTORE(int n) { | |||
super(org.aspectj.apache.bcel.Constants.DSTORE, org.aspectj.apache.bcel.Constants.DSTORE_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitDSTORE(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DSUB - Substract doubles | |||
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE> | |||
* ..., result.word1, result.word2 | |||
* | |||
* @version $Id: DSUB.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DSUB extends ArithmeticInstruction { | |||
/** Substract doubles | |||
*/ | |||
public DSUB() { | |||
super(org.aspectj.apache.bcel.Constants.DSUB); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitDSUB(this); | |||
} | |||
} |
@@ -0,0 +1,84 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP - Duplicate top operand stack word | |||
* <PRE>Stack: ..., word -> ..., word, word</PRE> | |||
* | |||
* @version $Id: DUP.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP extends StackInstruction implements PushInstruction { | |||
public DUP() { | |||
super(org.aspectj.apache.bcel.Constants.DUP); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitPushInstruction(this); | |||
v.visitStackInstruction(this); | |||
v.visitDUP(this); | |||
} | |||
} |
@@ -0,0 +1,84 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP2 - Duplicate two top operand stack words | |||
* <PRE>Stack: ..., word2, word1 -> ..., word2, word1, word2, word1</PRE> | |||
* | |||
* @version $Id: DUP2.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP2 extends StackInstruction implements PushInstruction { | |||
public DUP2() { | |||
super(org.aspectj.apache.bcel.Constants.DUP2); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitPushInstruction(this); | |||
v.visitStackInstruction(this); | |||
v.visitDUP2(this); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP2_X1 - Duplicate two top operand stack words and put three down | |||
* <PRE>Stack: ..., word3, word2, word1 -> ..., word2, word1, word3, word2, word1</PRE> | |||
* | |||
* @version $Id: DUP2_X1.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP2_X1 extends StackInstruction { | |||
public DUP2_X1() { | |||
super(org.aspectj.apache.bcel.Constants.DUP2_X1); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackInstruction(this); | |||
v.visitDUP2_X1(this); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP2_X2 - Duplicate two top operand stack words and put four down | |||
* <PRE>Stack: ..., word4, word3, word2, word1 -> ..., word2, word1, word4, word3, word2, word1</PRE> | |||
* | |||
* @version $Id: DUP2_X2.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP2_X2 extends StackInstruction { | |||
public DUP2_X2() { | |||
super(org.aspectj.apache.bcel.Constants.DUP2_X2); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackInstruction(this); | |||
v.visitDUP2_X2(this); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP_X1 - Duplicate top operand stack word and put two down | |||
* <PRE>Stack: ..., word2, word1 -> ..., word1, word2, word1</PRE> | |||
* | |||
* @version $Id: DUP_X1.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP_X1 extends StackInstruction { | |||
public DUP_X1() { | |||
super(org.aspectj.apache.bcel.Constants.DUP_X1); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackInstruction(this); | |||
v.visitDUP_X1(this); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* DUP_X2 - Duplicate top operand stack word and put three down | |||
* <PRE>Stack: ..., word3, word2, word1 -> ..., word1, word3, word2, word1</PRE> | |||
* | |||
* @version $Id: DUP_X2.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class DUP_X2 extends StackInstruction { | |||
public DUP_X2() { | |||
super(org.aspectj.apache.bcel.Constants.DUP_X2); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackInstruction(this); | |||
v.visitDUP_X2(this); | |||
} | |||
} |
@@ -0,0 +1,79 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Denote an instruction that may throw a run-time or a linking | |||
* exception (or both) during execution. This is not quite the truth | |||
* as such; because all instructions may throw an | |||
* java.lang.VirtualMachineError. These exceptions are omitted. | |||
* | |||
* The Lava Language Specification specifies exactly which | |||
* <i>RUN-TIME</i> and which <i>LINKING</i> exceptions each | |||
* instruction may throw which is reflected by the implementers. Due | |||
* to the structure of the JVM specification, it may be possible that | |||
* an Instruction implementing this interface returns a Class[] of | |||
* size 0. | |||
* | |||
* Please note that we speak of an "exception" here when we mean any | |||
* "Throwable" object; so this term is equally used for "Exception" | |||
* and "Error" objects. | |||
* | |||
* @version $Id: ExceptionThrower.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="http://www.inf.fu-berlin.de/~ehaase">Enver Haase</A> | |||
*/ | |||
public interface ExceptionThrower { | |||
public java.lang.Class[] getExceptions(); | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* F2D - Convert float to double | |||
* <PRE>Stack: ..., value -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: F2D.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class F2D extends ConversionInstruction { | |||
/** Convert float to double | |||
*/ | |||
public F2D() { | |||
super(org.aspectj.apache.bcel.Constants.F2D); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitF2D(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* F2I - Convert float to int | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: F2I.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class F2I extends ConversionInstruction { | |||
/** Convert float to int | |||
*/ | |||
public F2I() { | |||
super(org.aspectj.apache.bcel.Constants.F2I); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitF2I(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* F2L - Convert float to long | |||
* <PRE>Stack: ..., value -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: F2L.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class F2L extends ConversionInstruction { | |||
/** Convert float to long | |||
*/ | |||
public F2L() { | |||
super(org.aspectj.apache.bcel.Constants.F2L); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitF2L(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FADD - Add floats | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: FADD.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FADD extends ArithmeticInstruction { | |||
/** Add floats | |||
*/ | |||
public FADD() { | |||
super(org.aspectj.apache.bcel.Constants.FADD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFADD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FALOAD - Load float from array | |||
* <PRE>Stack: ..., arrayref, index -> ..., value</PRE> | |||
* | |||
* @version $Id: FALOAD.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FALOAD extends ArrayInstruction implements StackProducer { | |||
/** Load float from array | |||
*/ | |||
public FALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.FALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitFALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FASTORE - Store into float array | |||
* <PRE>Stack: ..., arrayref, index, value -> ...</PRE> | |||
* | |||
* @version $Id: FASTORE.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FASTORE extends ArrayInstruction implements StackConsumer { | |||
/** Store float into array | |||
*/ | |||
public FASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.FASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitFASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FCMPG - Compare floats: value1 > value2 | |||
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE> | |||
* | |||
* @version $Id: FCMPG.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FCMPG extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
public FCMPG() { | |||
super(org.aspectj.apache.bcel.Constants.FCMPG, (short)1); | |||
} | |||
/** @return Type.FLOAT | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.FLOAT; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitFCMPG(this); | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FCMPL - Compare floats: value1 < value2 | |||
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE> | |||
* | |||
* @version $Id: FCMPL.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FCMPL extends Instruction | |||
implements TypedInstruction, StackProducer, StackConsumer { | |||
public FCMPL() { | |||
super(org.aspectj.apache.bcel.Constants.FCMPL, (short)1); | |||
} | |||
/** @return Type.FLOAT | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.FLOAT; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitFCMPL(this); | |||
} | |||
} |
@@ -0,0 +1,113 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception | |||
* | |||
* <PRE>Stack: ... -> ..., </PRE> | |||
* | |||
* @version $Id: FCONST.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FCONST extends Instruction | |||
implements ConstantPushInstruction, TypedInstruction { | |||
private float value; | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
FCONST() {} | |||
public FCONST(float f) { | |||
super(org.aspectj.apache.bcel.Constants.FCONST_0, (short)1); | |||
if(f == 0.0) | |||
opcode = org.aspectj.apache.bcel.Constants.FCONST_0; | |||
else if(f == 1.0) | |||
opcode = org.aspectj.apache.bcel.Constants.FCONST_1; | |||
else if(f == 2.0) | |||
opcode = org.aspectj.apache.bcel.Constants.FCONST_2; | |||
else | |||
throw new ClassGenException("FCONST can be used only for 0.0, 1.0 and 2.0: " + f); | |||
value = f; | |||
} | |||
public Number getValue() { return new Float(value); } | |||
/** @return Type.FLOAT | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.FLOAT; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitPushInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitConstantPushInstruction(this); | |||
v.visitFCONST(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FDIV - Divide floats | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: FDIV.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FDIV extends ArithmeticInstruction { | |||
/** Divide floats | |||
*/ | |||
public FDIV() { | |||
super(org.aspectj.apache.bcel.Constants.FDIV); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFDIV(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FLOAD - Load float from local variable | |||
* <PRE>Stack ... -> ..., result</PRE> | |||
* | |||
* @version $Id: FLOAD.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FLOAD extends LoadInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
FLOAD() { | |||
super(org.aspectj.apache.bcel.Constants.FLOAD, org.aspectj.apache.bcel.Constants.FLOAD_0); | |||
} | |||
/** Load float from local variable | |||
* @param n index of local variable | |||
*/ | |||
public FLOAD(int n) { | |||
super(org.aspectj.apache.bcel.Constants.FLOAD, org.aspectj.apache.bcel.Constants.FLOAD_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitFLOAD(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FMUL - Multiply floats | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: FMUL.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FMUL extends ArithmeticInstruction { | |||
/** Multiply floats | |||
*/ | |||
public FMUL() { | |||
super(org.aspectj.apache.bcel.Constants.FMUL); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFMUL(this); | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FNEG - Negate float | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: FNEG.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FNEG extends ArithmeticInstruction { | |||
public FNEG() { | |||
super(org.aspectj.apache.bcel.Constants.FNEG); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFNEG(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FREM - Remainder of floats | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: FREM.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FREM extends ArithmeticInstruction { | |||
/** Remainder of floats | |||
*/ | |||
public FREM() { | |||
super(org.aspectj.apache.bcel.Constants.FREM); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFREM(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FRETURN - Return float from method | |||
* <PRE>Stack: ..., value -> <empty></PRE> | |||
* | |||
* @version $Id: FRETURN.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FRETURN extends ReturnInstruction { | |||
/** Return float from method | |||
*/ | |||
public FRETURN() { | |||
super(org.aspectj.apache.bcel.Constants.FRETURN); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitStackConsumer(this); | |||
v.visitReturnInstruction(this); | |||
v.visitFRETURN(this); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FSTORE - Store float into local variable | |||
* <PRE>Stack: ..., value -> ... </PRE> | |||
* | |||
* @version $Id: FSTORE.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FSTORE extends StoreInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
FSTORE() { | |||
super(org.aspectj.apache.bcel.Constants.FSTORE, org.aspectj.apache.bcel.Constants.FSTORE_0); | |||
} | |||
/** Store float into local variable | |||
* @param n index of local variable | |||
*/ | |||
public FSTORE(int n) { | |||
super(org.aspectj.apache.bcel.Constants.FSTORE, org.aspectj.apache.bcel.Constants.FSTORE_0, n); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
super.accept(v); | |||
v.visitFSTORE(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* FSUB - Substract floats | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: FSUB.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class FSUB extends ArithmeticInstruction { | |||
/** Substract floats | |||
*/ | |||
public FSUB() { | |||
super(org.aspectj.apache.bcel.Constants.FSUB); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitFSUB(this); | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Imnplement this interface if you're interested in changes to a FieldGen object | |||
* and register yourself with addObserver(). | |||
* | |||
* @version $Id: FieldObserver.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public interface FieldObserver { | |||
public void notify(FieldGen field); | |||
} | |||
@@ -0,0 +1,117 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.ExceptionConstants; | |||
/** | |||
* GETFIELD - Fetch field from object | |||
* <PRE>Stack: ..., objectref -> ..., value</PRE> | |||
* OR | |||
* <PRE>Stack: ..., objectref -> ..., value.word1, value.word2</PRE> | |||
* | |||
* @version $Id: GETFIELD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class GETFIELD extends FieldInstruction | |||
implements ExceptionThrower, StackConsumer, StackProducer { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
GETFIELD() {} | |||
public GETFIELD(int index) { | |||
super(Constants.GETFIELD, index); | |||
} | |||
public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); } | |||
public Class[] getExceptions() { | |||
Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length]; | |||
System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, | |||
cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length); | |||
cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] = | |||
ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR; | |||
cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = | |||
ExceptionConstants.NULL_POINTER_EXCEPTION; | |||
return cs; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitStackConsumer(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitLoadClass(this); | |||
v.visitCPInstruction(this); | |||
v.visitFieldOrMethod(this); | |||
v.visitFieldInstruction(this); | |||
v.visitGETFIELD(this); | |||
} | |||
} |
@@ -0,0 +1,113 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import org.aspectj.apache.bcel.Constants; | |||
import org.aspectj.apache.bcel.ExceptionConstants; | |||
/** | |||
* GETSTATIC - Fetch static field from class | |||
* <PRE>Stack: ..., -> ..., value</PRE> | |||
* OR | |||
* <PRE>Stack: ..., -> ..., value.word1, value.word2</PRE> | |||
* | |||
* @version $Id: GETSTATIC.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class GETSTATIC extends FieldInstruction implements PushInstruction, ExceptionThrower { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
GETSTATIC() {} | |||
public GETSTATIC(int index) { | |||
super(Constants.GETSTATIC, index); | |||
} | |||
public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); } | |||
public Class[] getExceptions() { | |||
Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length]; | |||
System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, | |||
cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length); | |||
cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = | |||
ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR; | |||
return cs; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitPushInstruction(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitLoadClass(this); | |||
v.visitCPInstruction(this); | |||
v.visitFieldOrMethod(this); | |||
v.visitFieldInstruction(this); | |||
v.visitGETSTATIC(this); | |||
} | |||
} |
@@ -0,0 +1,122 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.io.*; | |||
/** | |||
* GOTO - Branch always (to relative offset, not absolute address) | |||
* | |||
* @version $Id: GOTO.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class GOTO extends GotoInstruction implements VariableLengthInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
GOTO() {} | |||
public GOTO(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.GOTO, target); | |||
} | |||
/** | |||
* Dump instruction as byte code to stream out. | |||
* @param out Output stream | |||
*/ | |||
public void dump(DataOutputStream out) throws IOException { | |||
index = getTargetOffset(); | |||
if(opcode == org.aspectj.apache.bcel.Constants.GOTO) | |||
super.dump(out); | |||
else { // GOTO_W | |||
index = getTargetOffset(); | |||
out.writeByte(opcode); | |||
out.writeInt(index); | |||
} | |||
} | |||
/** Called in pass 2 of InstructionList.setPositions() in order to update | |||
* the branch target, that may shift due to variable length instructions. | |||
*/ | |||
protected int updatePosition(int offset, int max_offset) { | |||
int i = getTargetOffset(); // Depending on old position value | |||
position += offset; // Position may be shifted by preceding expansions | |||
if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate) | |||
opcode = org.aspectj.apache.bcel.Constants.GOTO_W; | |||
length = 5; | |||
return 2; // 5 - 3 | |||
} | |||
return 0; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitVariableLengthInstruction(this); | |||
v.visitUnconditionalBranch(this); | |||
v.visitBranchInstruction(this); | |||
v.visitGotoInstruction(this); | |||
v.visitGOTO(this); | |||
} | |||
} |
@@ -0,0 +1,110 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
import java.io.*; | |||
import org.aspectj.apache.bcel.util.ByteSequence; | |||
/** | |||
* GOTO_W - Branch always (to relative offset, not absolute address) | |||
* | |||
* @version $Id: GOTO_W.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class GOTO_W extends GotoInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
GOTO_W() {} | |||
public GOTO_W(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.GOTO_W, target); | |||
length = 5; | |||
} | |||
/** | |||
* Dump instruction as byte code to stream out. | |||
* @param out Output stream | |||
*/ | |||
public void dump(DataOutputStream out) throws IOException { | |||
index = getTargetOffset(); | |||
out.writeByte(opcode); | |||
out.writeInt(index); | |||
} | |||
/** | |||
* Read needed data (e.g. index) from file. | |||
*/ | |||
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException | |||
{ | |||
index = bytes.readInt(); | |||
length = 5; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitUnconditionalBranch(this); | |||
v.visitBranchInstruction(this); | |||
v.visitGotoInstruction(this); | |||
v.visitGOTO_W(this); | |||
} | |||
} |
@@ -0,0 +1,75 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* Super class for GOTO | |||
* | |||
* @version $Id: GotoInstruction.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public abstract class GotoInstruction extends BranchInstruction | |||
implements UnconditionalBranch | |||
{ | |||
GotoInstruction(short opcode, InstructionHandle target) { | |||
super(opcode, target); | |||
} | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
GotoInstruction(){} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2B - Convert int to byte | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: I2B.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2B extends ConversionInstruction { | |||
/** Convert int to byte | |||
*/ | |||
public I2B() { | |||
super(org.aspectj.apache.bcel.Constants.I2B); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2B(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2C - Convert int to char | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: I2C.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2C extends ConversionInstruction { | |||
/** Convert int to char | |||
*/ | |||
public I2C() { | |||
super(org.aspectj.apache.bcel.Constants.I2C); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2C(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2D - Convert int to double | |||
* <PRE>Stack: ..., value -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: I2D.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2D extends ConversionInstruction { | |||
/** Convert int to double | |||
*/ | |||
public I2D() { | |||
super(org.aspectj.apache.bcel.Constants.I2D); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2D(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2F - Convert int to float | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: I2F.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2F extends ConversionInstruction { | |||
/** Convert int to float | |||
*/ | |||
public I2F() { | |||
super(org.aspectj.apache.bcel.Constants.I2F); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2F(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2L - Convert int to long | |||
* <PRE>Stack: ..., value -> ..., result.word1, result.word2</PRE> | |||
* | |||
* @version $Id: I2L.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2L extends ConversionInstruction { | |||
/** Convert int to long | |||
*/ | |||
public I2L() { | |||
super(org.aspectj.apache.bcel.Constants.I2L); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2L(this); | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* I2S - Convert int to short | |||
* <PRE>Stack: ..., value -> ..., result</PRE> | |||
* | |||
* @version $Id: I2S.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class I2S extends ConversionInstruction { | |||
public I2S() { | |||
super(org.aspectj.apache.bcel.Constants.I2S); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitConversionInstruction(this); | |||
v.visitI2S(this); | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IADD - Add ints | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: IADD.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IADD extends ArithmeticInstruction { | |||
/** Add ints | |||
*/ | |||
public IADD() { | |||
super(org.aspectj.apache.bcel.Constants.IADD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitIADD(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IALOAD - Load int from array | |||
* <PRE>Stack: ..., arrayref, index -> ..., value</PRE> | |||
* | |||
* @version $Id: IALOAD.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IALOAD extends ArrayInstruction implements StackProducer { | |||
/** | |||
* Load int from array | |||
*/ | |||
public IALOAD() { | |||
super(org.aspectj.apache.bcel.Constants.IALOAD); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackProducer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitIALOAD(this); | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IAND - Bitwise AND int | |||
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE> | |||
* | |||
* @version $Id: IAND.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IAND extends ArithmeticInstruction { | |||
public IAND() { | |||
super(org.aspectj.apache.bcel.Constants.IAND); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitIAND(this); | |||
} | |||
} |
@@ -0,0 +1,88 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IASTORE - Store into int array | |||
* <PRE>Stack: ..., arrayref, index, value -> ...</PRE> | |||
* | |||
* @version $Id: IASTORE.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IASTORE extends ArrayInstruction implements StackConsumer { | |||
/** | |||
* Store into int array | |||
*/ | |||
public IASTORE() { | |||
super(org.aspectj.apache.bcel.Constants.IASTORE); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitArrayInstruction(this); | |||
v.visitIASTORE(this); | |||
} | |||
} |
@@ -0,0 +1,109 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* ICONST - Push value between -1, ..., 5, other values cause an exception | |||
* | |||
* <PRE>Stack: ... -> ..., </PRE> | |||
* | |||
* @version $Id: ICONST.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class ICONST extends Instruction | |||
implements ConstantPushInstruction, TypedInstruction { | |||
private int value; | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
ICONST() {} | |||
public ICONST(int i) { | |||
super(org.aspectj.apache.bcel.Constants.ICONST_0, (short)1); | |||
if((i >= -1) && (i <= 5)) | |||
opcode = (short)(org.aspectj.apache.bcel.Constants.ICONST_0 + i); // Even works for i == -1 | |||
else | |||
throw new ClassGenException("ICONST can be used only for value between -1 and 5: " + | |||
i); | |||
value = i; | |||
} | |||
public Number getValue() { return new Integer(value); } | |||
/** @return Type.INT | |||
*/ | |||
public Type getType(ConstantPoolGen cp) { | |||
return Type.INT; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitPushInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitTypedInstruction(this); | |||
v.visitConstantPushInstruction(this); | |||
v.visitICONST(this); | |||
} | |||
} |
@@ -0,0 +1,94 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IDIV - Divide ints | |||
* <PRE>Stack: ..., value1, value2 -> result</PRE> | |||
* | |||
* @version $Id: IDIV.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IDIV extends ArithmeticInstruction implements ExceptionThrower { | |||
/** Divide ints | |||
*/ | |||
public IDIV() { | |||
super(org.aspectj.apache.bcel.Constants.IDIV); | |||
} | |||
/** @return exceptions this instruction may cause | |||
*/ | |||
public Class[] getExceptions() { | |||
return new Class[] { org.aspectj.apache.bcel.ExceptionConstants.ARITHMETIC_EXCEPTION }; | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitExceptionThrower(this); | |||
v.visitTypedInstruction(this); | |||
v.visitStackProducer(this); | |||
v.visitStackConsumer(this); | |||
v.visitArithmeticInstruction(this); | |||
v.visitIDIV(this); | |||
} | |||
} |
@@ -0,0 +1,98 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IFEQ - Branch if int comparison with zero succeeds | |||
* | |||
* <PRE>Stack: ..., value -> ...</PRE> | |||
* | |||
* @version $Id: IFEQ.java,v 1.6 2008/04/25 17:58:20 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IFEQ extends IfInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
IFEQ() {} | |||
public IFEQ(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.IFEQ, target); | |||
} | |||
/** | |||
* @return negation of instruction, e.g. IFEQ.negate() == IFNE | |||
*/ | |||
public IfInstruction negate() { | |||
return new IFNE(target); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitBranchInstruction(this); | |||
v.visitIfInstruction(this); | |||
v.visitIFEQ(this); | |||
} | |||
} |
@@ -0,0 +1,98 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IFGE - Branch if int comparison with zero succeeds | |||
* | |||
* <PRE>Stack: ..., value -> ...</PRE> | |||
* | |||
* @version $Id: IFGE.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IFGE extends IfInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
IFGE() {} | |||
public IFGE(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.IFGE, target); | |||
} | |||
/** | |||
* @return negation of instruction | |||
*/ | |||
public IfInstruction negate() { | |||
return new IFLT(target); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitBranchInstruction(this); | |||
v.visitIfInstruction(this); | |||
v.visitIFGE(this); | |||
} | |||
} |
@@ -0,0 +1,98 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IFGT - Branch if int comparison with zero succeeds | |||
* | |||
* <PRE>Stack: ..., value -> ...</PRE> | |||
* | |||
* @version $Id: IFGT.java,v 1.6 2008/04/25 17:58:22 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IFGT extends IfInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
IFGT() {} | |||
public IFGT(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.IFGT, target); | |||
} | |||
/** | |||
* @return negation of instruction | |||
*/ | |||
public IfInstruction negate() { | |||
return new IFLE(target); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitBranchInstruction(this); | |||
v.visitIfInstruction(this); | |||
v.visitIFGT(this); | |||
} | |||
} |
@@ -0,0 +1,98 @@ | |||
package org.aspectj.apache.bcel.generic; | |||
/* ==================================================================== | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, | |||
* if any, must include the following acknowledgment: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowledgment may appear in the software itself, | |||
* if and wherever such third-party acknowledgments normally appear. | |||
* | |||
* 4. The names "Apache" and "Apache Software Foundation" and | |||
* "Apache BCEL" must not be used to endorse or promote products | |||
* derived from this software without prior written permission. For | |||
* written permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache", | |||
* "Apache BCEL", nor may "Apache" appear in their name, without | |||
* prior written permission of the Apache Software Foundation. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
* SUCH DAMAGE. | |||
* ==================================================================== | |||
* | |||
* This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
/** | |||
* IFLE - Branch if int comparison with zero succeeds | |||
* | |||
* <PRE>Stack: ..., value -> ...</PRE> | |||
* | |||
* @version $Id: IFLE.java,v 1.6 2008/04/25 17:58:21 aclement Exp $ | |||
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> | |||
*/ | |||
public class IFLE extends IfInstruction { | |||
/** | |||
* Empty constructor needed for the Class.newInstance() statement in | |||
* Instruction.readInstruction(). Not to be used otherwise. | |||
*/ | |||
IFLE() {} | |||
public IFLE(InstructionHandle target) { | |||
super(org.aspectj.apache.bcel.Constants.IFLE, target); | |||
} | |||
/** | |||
* @return negation of instruction | |||
*/ | |||
public IfInstruction negate() { | |||
return new IFGT(target); | |||
} | |||
/** | |||
* Call corresponding visitor method(s). The order is: | |||
* Call visitor methods of implemented interfaces first, then | |||
* call methods according to the class hierarchy in descending order, | |||
* i.e., the most specific visitXXX() call comes last. | |||
* | |||
* @param v Visitor object | |||
*/ | |||
public void accept(Visitor v) { | |||
v.visitStackConsumer(this); | |||
v.visitBranchInstruction(this); | |||
v.visitIfInstruction(this); | |||
v.visitIFLE(this); | |||
} | |||
} |