use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class I_IntValue method executeFunction.
@Override
public Object executeFunction() {
ReferenceConstant symb_integer = this.getSymbReceiver();
Integer conc_integer = (Integer) this.getConcReceiver();
int conc_int_value = this.getConcIntRetVal();
IntegerValue symb_int_value = env.heap.getField(Types.JAVA_LANG_INTEGER, SymbolicHeap.$INT_VALUE, conc_integer, symb_integer, conc_int_value);
return symb_int_value;
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class J_ValueOf method executeFunction.
@Override
public Object executeFunction() {
IntegerValue int_value = this.getSymbIntegerArgument(0);
ReferenceConstant symb_long = (ReferenceConstant) this.getSymbRetVal();
Long conc_long = (Long) this.getConcRetVal();
env.heap.putField(Types.JAVA_LANG_LONG, SymbolicHeap.$LONG_VALUE, conc_long, symb_long, int_value);
return symb_long;
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class S_ShortValue method executeFunction.
@Override
public Object executeFunction() {
ReferenceConstant symb_short = this.getSymbReceiver();
Short conc_short = (Short) this.getConcReceiver();
short conc_short_value = this.getConcShortRetVal();
IntegerValue symb_short_value = env.heap.getField(Types.JAVA_LANG_SHORT, SymbolicHeap.$SHORT_VALUE, conc_short, symb_short, conc_short_value);
return symb_short_value;
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class CallVM method HANDLER_BEGIN.
/**
* Begin of a basic block that is the begin of an exception handler.
*
* We could be in an entirely different invocation frame than the previous
* instruction was in.
*
* TODO: Account for different call sites in the same method. This may lead
* to the need to discard frames although they are of the same function as
* indicated by the parameters.
*/
@Override
public void HANDLER_BEGIN(int access, String className, String methName, String methDesc) {
if (conf.CLINIT.equals(methName)) {
discardFramesClassInitializer(className, methName);
} else {
// the method or constructor containing this handler
Member function = null;
if (conf.INIT.equals(methName))
function = resolveConstructorOverloading(className, methDesc);
else
function = resolveMethodOverloading(className, methName, methDesc);
/**
* function could be equal to null if handler is in class
* initializer
*/
discardFrames(className, methName, function);
}
env.topFrame().operandStack.clearOperands();
/**
* This exception is added to the HANDLER_BEGIN because no other
* instruction adds the corresponding exception. The handler will store
* the exception to the locals table
*/
ReferenceConstant exception_reference = new ReferenceConstant(Type.getType(Exception.class), -1);
env.topFrame().operandStack.pushRef(exception_reference);
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class HeapVM method NEW.
/**
* Allocate space on the heap and push a reference ref to it onto the stack.
*
* For each instance field declared by class className, we add a tuple (ref,
* default value) to the field's map.
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc10.html#new
*/
@Override
public void NEW(String className) {
/**
* Since this callback is invoked before the actual object creation, we
* do nothing.
*
* We do not need to discard any elements from the operand stack since
* it is given empty.
*
* PRE-Stack: empty
*
* POST-Stack: objectref (delayed)
*/
Class<?> clazz = classLoader.getClassForName(className);
Type objectType = Type.getType(clazz);
ReferenceConstant newObject = this.env.heap.buildNewReferenceConstant(objectType);
env.topFrame().operandStack.pushRef(newObject);
}
Aggregations