
jas.MethodCP Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jasmin Show documentation
Show all versions of jasmin Show documentation
Java Assembler Interface for the Soot framework
/**
* MethodCP's are used to make references to methods in classes
*
* @author $Author: fqian $
* @version $Revision: 1.1 $
*/
package jas;
import java.io.*;
public class MethodCP extends CP implements RuntimeConstants
{
ClassCP clazz;
NameTypeCP nt;
/**
* @param cname Class in which method exists
* @param varname name of method
* @param sig Signature of method
*/
public MethodCP(String cname, String varname, String sig)
{
uniq = cname + "&%$91&" + varname + "*(012$" + sig;
clazz = new ClassCP(cname);
nt = new NameTypeCP(varname, sig);
}
void resolve(ClassEnv e)
{
e.addCPItem(clazz);
e.addCPItem(nt);
}
void write(ClassEnv e, DataOutputStream out)
throws IOException, jasError
{
out.writeByte(CONSTANT_METHOD);
out.writeShort(e.getCPIndex(clazz));
out.writeShort(e.getCPIndex(nt));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy