use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.
the class GenerationPass method _jump_cmp0.
protected void _jump_cmp0(BasicBlock target, ComparisonType type) {
save_stack(false);
Expr left = pop();
ConstantExpr right = new ConstantExpr((byte) 0, Type.BYTE_TYPE, false);
_jump_cmp(target, type, left, right);
}
use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.
the class GenerationPass method _store.
protected void _store(int index, Type type) {
save_stack(false);
Expr expr = pop();
VarExpr var = _var_expr(index, expr.getType(), false);
addStmt(copy(var, expr));
}
use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.
the class GenerationPass method _dup_x1.
protected void _dup_x1() {
// prestack: var1, var0 (height = 2)
// poststack: var2, var1, var0
// assignments: var0 = var1(initial)
// assignments: var1 = var0(initial)
// assignments: var2 = var1(initial)
currentStack.assertHeights(DUP_X1_HEIGHTS);
int baseHeight = currentStack.height();
save_stack(false);
Expr var1 = pop();
Expr var0 = pop();
// var3 = var0
Type var3Type = assign_stack(baseHeight + 1, var0);
// var0 = var1(initial)
Type var0Type = assign_stack(baseHeight - 2, var1);
// var2 = var1(initial)
Type var2Type = assign_stack(baseHeight + 0, var1.copy());
// var1 = var3 = var0(initial)
Type var1Type = assign_stack(baseHeight - 1, load_stack(baseHeight + 1, var3Type));
// push var0
push(load_stack(baseHeight - 2, var0Type));
// push var1
push(load_stack(baseHeight - 1, var1Type));
// push var2
push(load_stack(baseHeight + 0, var2Type));
}
use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.
the class GenerationPass method _load_array.
protected void _load_array(ArrayType type) {
save_stack(false);
// prestack: var1, var0 (height = 2)
// poststack: var0
// assignments: var0 = var0[var1]
// int height = currentStack.height();
Expr index = pop();
Expr array = pop();
push(new ArrayLoadExpr(array, index, type));
// assign_stack(height - 2, new ArrayLoadExpr(array, index, type));
// push(load_stack(height - 2, type.getType()));
}
use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.
the class GenerationPass method _pop.
protected void _pop(int amt) {
for (int i = 0; i < amt; ) {
Expr top = pop();
addStmt(new PopStmt(top));
i += top.getType().getSize();
}
}
Aggregations