use of com.oracle.truffle.espresso.classfile.constantpool.FloatConstant in project graal by oracle.
the class BytecodeNode method putPoolConstant.
private void putPoolConstant(VirtualFrame frame, int top, char cpi, int opcode) {
assert opcode == LDC || opcode == LDC_W || opcode == LDC2_W;
RuntimeConstantPool pool = getConstantPool();
PoolConstant constant = pool.at(cpi);
if (constant instanceof IntegerConstant) {
assert opcode == LDC || opcode == LDC_W;
putInt(frame, top, ((IntegerConstant) constant).value());
} else if (constant instanceof LongConstant) {
assert opcode == LDC2_W;
putLong(frame, top, ((LongConstant) constant).value());
} else if (constant instanceof DoubleConstant) {
assert opcode == LDC2_W;
putDouble(frame, top, ((DoubleConstant) constant).value());
} else if (constant instanceof FloatConstant) {
assert opcode == LDC || opcode == LDC_W;
putFloat(frame, top, ((FloatConstant) constant).value());
} else if (constant instanceof StringConstant) {
assert opcode == LDC || opcode == LDC_W;
StaticObject internedString = pool.resolvedStringAt(cpi);
putObject(frame, top, internedString);
} else if (constant instanceof ClassConstant) {
assert opcode == LDC || opcode == LDC_W;
Klass klass = pool.resolvedKlassAt(getDeclaringKlass(), cpi);
putObject(frame, top, klass.mirror());
} else if (constant instanceof MethodHandleConstant) {
assert opcode == LDC || opcode == LDC_W;
StaticObject methodHandle = pool.resolvedMethodHandleAt(getDeclaringKlass(), cpi);
putObject(frame, top, methodHandle);
} else if (constant instanceof MethodTypeConstant) {
assert opcode == LDC || opcode == LDC_W;
StaticObject methodType = pool.resolvedMethodTypeAt(getDeclaringKlass(), cpi);
putObject(frame, top, methodType);
} else if (constant instanceof DynamicConstant) {
DynamicConstant.Resolved dynamicConstant = pool.resolvedDynamicConstantAt(getDeclaringKlass(), cpi);
dynamicConstant.putResolved(frame, top, this);
} else {
CompilerDirectives.transferToInterpreter();
throw EspressoError.unimplemented(constant.toString());
}
}
Aggregations