Java Code Examples for org.objectweb.asm.tree.VarInsnNode#getOpcode()

The following examples show how to use org.objectweb.asm.tree.VarInsnNode#getOpcode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AsmMethodSource.java    From JAADAS with GNU General Public License v3.0 6 votes vote down vote up
private void convertVarLoadInsn(VarInsnNode insn) {
	int op = insn.getOpcode();
	boolean dword = op == LLOAD || op == DLOAD;
	StackFrame frame = getFrame(insn);
	Operand[] out = frame.out();
	Operand opr;
	if (out == null) {
		opr = new Operand(insn, getLocal(insn.var));
		frame.out(opr);
	} else {
		opr = out[0];
	}
	if (dword)
		pushDual(opr);
	else
		push(opr);
}
 
Example 2
Source File: AsmMethodSource.java    From JAADAS with GNU General Public License v3.0 6 votes vote down vote up
private void convertVarStoreInsn(VarInsnNode insn) {
	int op = insn.getOpcode();
	boolean dword = op == LSTORE || op == DSTORE;
	StackFrame frame = getFrame(insn);
	Operand opr = dword ? popDual() : pop();
	Local local = getLocal(insn.var);
	if (!units.containsKey(insn)) {
		DefinitionStmt as = Jimple.v().newAssignStmt(local, opr.stackOrValue());
		opr.addBox(as.getRightOpBox());
		frame.boxes(as.getRightOpBox());
		frame.in(opr);
		setUnit(insn, as);
	} else {
		frame.mergeIn(opr);
	}
	assignReadOps(local);
}
 
Example 3
Source File: AsmMethodSource.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
private void convertVarInsn(VarInsnNode insn) {
	int op = insn.getOpcode();
	if (op >= ILOAD && op <= ALOAD) {
		convertVarLoadInsn(insn);
	} else if (op >= ISTORE && op <= ASTORE) {
		convertVarStoreInsn(insn);
	} else if (op == RET) {
		/* we handle it, even thought it should be removed */
		if (!units.containsKey(insn))
			setUnit(insn, Jimple.v().newRetStmt(getLocal(insn.var)));
	} else {
		throw new AssertionError("Unknown var op: " + op);
	}
}
 
Example 4
Source File: BytecodeTraceUtil.java    From tascalate-async-await with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public static String toString(VarInsnNode vin) {
    // return AbstractVisitor.OPCODES[vin.getOpcode()] + " " + vin.var;
    return vin.getOpcode() + " " + vin.var;
}