Examples of JimpleExpr


Examples of org.renjin.gcc.jimple.JimpleExpr

    ImPrimitiveType type = TypeChecker.assertSamePrimitiveType(ops.get(0), ops.get(1));
    if(type != ImPrimitiveType.BOOLEAN) {
      throw new UnsupportedOperationException(type.toString());
    }

    JimpleExpr a = ops.get(0).translateToPrimitive(context, ImPrimitiveType.BOOLEAN);
    JimpleExpr b = ops.get(1).translateToPrimitive(context, ImPrimitiveType.BOOLEAN);
   
    String checkB = context.newLabel();
    String noneIsTrue = context.newLabel();
    String doneLabel = context.newLabel();
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

    ImPrimitiveType type = TypeChecker.assertSamePrimitiveType(ops.get(0), ops.get(1));
    if(type != ImPrimitiveType.BOOLEAN) {
      throw new UnsupportedOperationException(type.toString());
    }

    JimpleExpr a = ops.get(0).translateToPrimitive(context, ImPrimitiveType.BOOLEAN);
    JimpleExpr b = ops.get(1).translateToPrimitive(context, ImPrimitiveType.BOOLEAN);

    String checkB = context.newLabel();
    String noneIsTrue = context.newLabel();
    String doneLabel = context.newLabel();
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

    ImPrimitiveType type = TypeChecker.assertSamePrimitiveType(x, y);
    Preconditions.checkArgument(type == ImPrimitiveType.DOUBLE);

    if(TypeChecker.isDouble(x.type())) {
      //assignPrimitive(lhs, JimpleExpr.integerConstant(0));
      assignPrimitive(lhs, new JimpleExpr(String.format(
              "staticinvoke <org.renjin.gcc.runtime.Builtins: boolean unordered(double, double)>(%s, %s)",
              x.translateToPrimitive(context, ImPrimitiveType.DOUBLE),
              y.translateToPrimitive(context, ImPrimitiveType.DOUBLE))));
    } else {
      throw new UnsupportedOperationException();
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

  private void assignAbs(ImExpr lhs, ImExpr expr) {
   
    ImPrimitiveType type = TypeChecker.assertSamePrimitiveType(lhs, expr);

    assignPrimitive(lhs, new JimpleExpr(String.format("staticinvoke <java.lang.Math: %s>(%s)",
        absMethodForType(prtype(expr)),
        expr.translateToPrimitive(context, type))));
   
  }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

    ImPrimitiveType type = TypeChecker.assertSamePrimitiveType(lhs, operands.get(0), operands.get(1));

    String signature = "{t} max({t}, {t})"
            .replace("{t}", prtype(lhs).asJimple().toString());
   
    JimpleExpr a = operands.get(0).translateToPrimitive(context, type);
    JimpleExpr b = operands.get(1).translateToPrimitive(context, type);

    assignPrimitive(lhs, new JimpleExpr(String.format(
            "staticinvoke <java.lang.Math: %s>(%s, %s)",
            signature, a.toString(), b.toString())));


  }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

public class FunPtrMarshaller implements Marshaller {

  @Override
  public JimpleExpr marshall(FunctionContext context, ImExpr expr) {
    if(expr.isNull()) {
      return new JimpleExpr("null");
    } else if(expr instanceof ImFunctionPtrExpr) {
      return ((ImFunctionPtrExpr) expr).invokerReference(context);
    } else {
      throw new UnsupportedOperationException(expr.toString());
    }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

  }

  @Override
  public JimpleExpr translateToPrimitive(FunctionContext context, ImPrimitiveType type) {
    return type.castIfNeeded(
      new JimpleExpr(jimpleName),
      type());
  }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

      return new ArrayRef(jimpleArrayName, computeIndex());
    }

    private JimpleExpr computeIndex() {
      if(offsetType == OffsetType.BYTES) {
        JimpleExpr bytesToIncrement = offset.translateToPrimitive(context, ImPrimitiveType.INT);
        String positionsToIncrement = context.declareTemp(JimpleType.INT);
        context.getBuilder().addStatement(positionsToIncrement + " = " + bytesToIncrement + " / " + sizeOf());
        return new JimpleExpr(jimpleOffsetName + " + " + positionsToIncrement);   
      } else {
        return new JimpleExpr(jimpleOffsetName + " + " +
            offset.translateToPrimitive(context, ImPrimitiveType.INT));
      }
    }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

    }

    @Override
    public JimpleExpr translateToPrimitive(FunctionContext context, ImPrimitiveType type) {
      return type.castIfNeeded(
          new JimpleExpr(jimpleArrayName + "[" + jimpleOffsetName + "]"),
          type());
    }
View Full Code Here

Examples of org.renjin.gcc.jimple.JimpleExpr

    @Override
    public JimpleExpr translateToPrimitive(FunctionContext context, ImPrimitiveType type) {
      // get the overall index
      return type.castIfNeeded(
          new JimpleExpr(jimpleArrayName + "[" + computeOverallIndex(context) + "]"),
          this.type());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.