use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LNEG.
/**
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc8.html#lneg
*/
@Override
public void LNEG() {
IntegerValue param = env.topFrame().operandStack.popBv64();
long param_concrete_value = ((Long) param.getConcreteValue()).longValue();
if (!param.containsSymbolicVariable()) {
param = ExpressionFactory.buildNewIntegerConstant(param_concrete_value);
}
long con = -param_concrete_value;
IntegerValue intExpr = new IntegerUnaryExpression(param, Operator.NEG, (long) con);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method ISUB.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc6.html#isub
*/
@Override
public void ISUB() {
IntegerValue right = env.topFrame().operandStack.popBv32();
IntegerValue left = env.topFrame().operandStack.popBv32();
int left_concrete_value = ((Long) left.getConcreteValue()).intValue();
int right_concrete_value = ((Long) right.getConcreteValue()).intValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
int con = left_concrete_value - right_concrete_value;
IntegerValue intExpr = new IntegerBinaryExpression(left, Operator.MINUS, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LOR.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc8.html#lor
*/
@Override
public void LOR() {
IntegerValue right = env.topFrame().operandStack.popBv64();
IntegerValue left = env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left.getConcreteValue()).longValue();
long right_concrete_value = ((Long) right.getConcreteValue()).longValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
long con = left_concrete_value | right_concrete_value;
IntegerValue intExpr = new IntegerBinaryExpression(left, Operator.IOR, right, (long) con);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LMUL.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc8.html#lmul
*/
@Override
public void LMUL() {
IntegerValue right = env.topFrame().operandStack.popBv64();
IntegerValue left = env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left.getConcreteValue()).longValue();
long right_concrete_value = ((Long) right.getConcreteValue()).longValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
long con = left_concrete_value * right_concrete_value;
IntegerValue intExpr = ExpressionFactory.mul(left, right, (long) con);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method F2L.
@Override
public void F2L() {
RealValue realExpr = env.topFrame().operandStack.popFp32();
float floatValue = ((Double) realExpr.getConcreteValue()).floatValue();
IntegerValue intExpr;
long concreteValue = (long) floatValue;
if (!realExpr.containsSymbolicVariable()) {
intExpr = ExpressionFactory.buildNewIntegerConstant(concreteValue);
} else {
intExpr = new RealToIntegerCast(realExpr, concreteValue);
}
env.topFrame().operandStack.pushBv64(intExpr);
}
Aggregations