All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.columbia.cs.psl.phosphor.instrumenter.SpecialOpcodeRemovingMV Maven / Gradle / Ivy

The newest version!
package edu.columbia.cs.psl.phosphor.instrumenter;

import edu.columbia.cs.psl.phosphor.Configuration;
import edu.columbia.cs.psl.phosphor.TaintUtils;
import edu.columbia.cs.psl.phosphor.instrumenter.analyzer.TaggedValue;
import edu.columbia.cs.psl.phosphor.struct.ControlTaintTagStack;
import edu.columbia.cs.psl.phosphor.struct.multid.MultiDTaintedArray;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;

public class SpecialOpcodeRemovingMV extends MethodVisitor {

	private boolean ignoreFrames;
	private String clazz;

	private boolean fixLdcClass;

	/**
	 * Visits a field instruction. A field instruction is an instruction that
	 * loads or stores the value of a field of an object.
	 *
	 * @param opcode the opcode of the type instruction to be visited. This opcode
	 *               is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
	 * @param owner  the internal name of the field's owner class (see
	 *               {@link Type#getInternalName() getInternalName}).
	 * @param name   the field's name.
	 * @param desc   the field's descriptor (see {@link Type Type}).
	 */
	@Override
	public void visitFieldInsn(int opcode, String owner, String name, String desc) {
		if(opcode<200)
		super.visitFieldInsn(opcode, owner, name, desc);
	}

	private LocalVariableManager lvs;
	public void setLVS(LocalVariableManager lvs){
		this.lvs = lvs;
	}
	private int localIdxOfControlTag;
	public SpecialOpcodeRemovingMV(MethodVisitor sup, boolean ignoreFrames, int acc, String clazz, String desc, boolean fixLdcClass) {
		super(Configuration.ASM_VERSION, sup);
		this.ignoreFrames = ignoreFrames;
		this.clazz = clazz;
		this.fixLdcClass = fixLdcClass;
		int n = 0;
		if((acc & Opcodes.ACC_STATIC) == 0)
			n++;
		for(Type t : Type.getArgumentTypes(desc)){
			if(t.getDescriptor().equals(Type.getDescriptor(ControlTaintTagStack.class)))
				this.localIdxOfControlTag = n;
			n+= t.getSize();
		}
	}
//
//	HashSet




© 2015 - 2025 Weber Informatics LLC | Privacy Policy