use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LUSHR.
/**
* Stack=value1(int)|value2(long)
*
* Pops an integer and a long integer and from the stack. Shifts value2 (the
* long integer) right by the amount indicated in the low six bits of value1
* (an int). The long integer result is then pushed back onto the stack. The
* value is shifted logically (ignoring the sign extension - useful for
* unsigned values).
*/
@Override
public void LUSHR() {
IntegerValue right_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
IntegerValue left_expr = (IntegerValue) env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left_expr.getConcreteValue()).longValue();
int right_concrete_value = ((Long) right_expr.getConcreteValue()).intValue();
long concrete_value = left_concrete_value >>> (right_concrete_value & 0x001F);
IntegerBinaryExpression intExpr = new IntegerBinaryExpression(left_expr, Operator.USHR, right_expr, (long) concrete_value);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method INEG.
/**
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#ineg
*/
@Override
public void INEG() {
IntegerValue param = env.topFrame().operandStack.popBv32();
int param_concrete_value = ((Long) param.getConcreteValue()).intValue();
if (!param.containsSymbolicVariable()) {
param = ExpressionFactory.buildNewIntegerConstant(param_concrete_value);
}
int con = -param_concrete_value;
IntegerValue intExpr = new IntegerUnaryExpression(param, Operator.NEG, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method IUSHR.
/**
* Stack=value1(int)|value2(int)
*
* Pops two ints off the operand stack. Shifts value1 right by the amount
* indicated in the five low bits of value2. The int result is then pushed
* back onto the stack. value1 is shifted logically (ignoring the sign
* extension - useful for unsigned values).
*/
@Override
public void IUSHR() {
IntegerValue right_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
IntegerValue left_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
int left_concrete_value = ((Long) left_expr.getConcreteValue()).intValue();
int right_concrete_value = ((Long) right_expr.getConcreteValue()).intValue();
int concrete_value = left_concrete_value >>> (right_concrete_value & 0x001F);
IntegerBinaryExpression intExpr = new IntegerBinaryExpression(left_expr, Operator.USHR, right_expr, (long) concrete_value);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LSHR.
/**
* Stack=value1(int)|value2(long)
*
* Pops an int and a long integer from the stack. Shifts value2 (the long
* integer) right by the amount indicated in the low six bits of value1 (an
* int). The long integer result is then pushed back onto the stack. The
* value is shifted arithmetically (preserving the sign extension).
*/
@Override
public void LSHR() {
IntegerValue right_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
IntegerValue left_expr = (IntegerValue) env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left_expr.getConcreteValue()).longValue();
int right_concrete_value = ((Long) right_expr.getConcreteValue()).intValue();
long concrete_value = left_concrete_value >> (right_concrete_value & 0x001F);
IntegerBinaryExpression intExpr = new IntegerBinaryExpression(left_expr, Operator.SHL, right_expr, (long) concrete_value);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LSHL.
/**
* Stack=value1(int)|value2(long)
*
* Pops a long integer and an int from the stack. Shifts value2 (the long
* integer) left by the amount indicated in the low six bits of value1 (an
* int). The long integer result is then pushed back onto the stack.
*/
@Override
public void LSHL() {
IntegerValue right_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
IntegerValue left_expr = (IntegerValue) env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left_expr.getConcreteValue()).longValue();
int right_concrete_value = ((Long) right_expr.getConcreteValue()).intValue();
long concrete_value = left_concrete_value << (right_concrete_value & 0x001F);
IntegerBinaryExpression intExpr = new IntegerBinaryExpression(left_expr, Operator.SHL, right_expr, (long) concrete_value);
env.topFrame().operandStack.pushBv64(intExpr);
}
Aggregations