public void convert(TypeDesc fromType, TypeDesc toType) { convert(fromType, toType, CONVERT_FP_NORMAL); }
case TypeDesc.SHORT_CODE: addInstruction(-1, TypeDesc.INT, Opcode.L2I); convert(TypeDesc.INT, toPrimitiveType); case TypeDesc.SHORT_CODE: addInstruction(0, TypeDesc.INT, Opcode.F2I); convert(TypeDesc.INT, toPrimitiveType); case TypeDesc.SHORT_CODE: addInstruction(-1, TypeDesc.INT, Opcode.D2I); convert(TypeDesc.INT, toPrimitiveType);
private void emit_age() { b.loadLocal(ageParam); // push the age parameter b.convert(TypeDesc.INT, TypeDesc.DOUBLE); }
private void emit_docVar() { b.loadLocal(docVarParam); // push the docVar parameter b.swap(); // swap the top two words on the stack, so the var id is on top params = new TypeDesc[] {TypeDesc.INT}; // the type of the id parameter (int) b.invokeInterface(docVarType, "getBoost", TypeDesc.FLOAT, params); b.convert(TypeDesc.FLOAT, TypeDesc.DOUBLE); }
public void convert(TypeDesc fromType, TypeDesc toType) { convert(fromType, toType, CONVERT_FP_NORMAL); }
builder.loadLocal(a); builder.invoke(floatToIntBits); builder.convert(TypeDesc.INT, TypeDesc.LONG); builder.loadLocal(b); builder.invoke(floatToIntBits); builder.convert(TypeDesc.INT, TypeDesc.LONG); builder.math(Opcode.LCMP); } else if (type == int.class) { builder.loadLocal(a); builder.convert(TypeDesc.INT, TypeDesc.LONG); builder.loadLocal(b); builder.convert(TypeDesc.INT, TypeDesc.LONG); builder.math(Opcode.LCMP); } else {
b.loadLocal(beanVar); b.invoke(bp.getReadMethod()); b.convert(TypeDesc.forClass(bp.getType()), TypeDesc.OBJECT); b.invokeVirtual(Object.class.getName(), "equals", TypeDesc.BOOLEAN, params);
b.invoke(bp.getReadMethod()); TypeDesc type = TypeDesc.forClass(bp.getType()); b.convert(type, type.toObjectType()); b.returnValue(TypeDesc.OBJECT); break; TypeDesc type = TypeDesc.forClass(bp.getType()); b.checkCast(type.toObjectType()); b.convert(type.toObjectType(), type); b.invoke(bp.getWriteMethod()); if (methodType == WRITE_METHOD) {
/** * Creates code to call set method. Assumes Storable and property value * are already on the stack. */ private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) { StorableProperty<?> property = op.getChainedProperty().getLastProperty(); TypeDesc propType = TypeDesc.forClass(property.getType()); if (propType != TypeDesc.OBJECT) { TypeDesc objectType = propType.toObjectType(); b.checkCast(objectType); // Potentially unbox primitive. b.convert(objectType, propType); } b.invoke(property.getWriteMethod()); } }
/** * Creates code to call set method. Assumes Storable and property value * are already on the stack. */ private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) { StorableProperty<?> property = op.getChainedProperty().getLastProperty(); TypeDesc propType = TypeDesc.forClass(property.getType()); if (propType != TypeDesc.OBJECT) { TypeDesc objectType = propType.toObjectType(); b.checkCast(objectType); // Potentially unbox primitive. b.convert(objectType, propType); } b.invoke(property.getWriteMethod()); } }
b.convert(fromType, toType); return; } catch (IllegalArgumentException e) {
b.convert(fromType, toType); return; } catch (IllegalArgumentException e) {
b.loadLocal(beanVar); b.invoke(bp.getReadMethod()); b.convert(TypeDesc.forClass(bp.getType()), TypeDesc.OBJECT); b.invokeVirtual(Object.class.getName(), "equals", TypeDesc.BOOLEAN, params);