Package org.renjin.compiler.ir.tac

Examples of org.renjin.compiler.ir.tac.IRBodyBuilder.build()


 
  @Test
  public void simple() {
    ExpressionVector ast = RParser.parseSource("x + sqrt(x * y)\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    IRBody ir = factory.build(ast);
    factory.dump( ast );
  }

  @Test
  public void sideEffects() {
View Full Code Here


  }
 
  private void dump(String rcode) {
    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    IRBody ir = factory.build(ast);
   
    System.out.println(ir.toString());
  }
 
  private IRBody build(String rcode) {
View Full Code Here

  }
 
  private IRBody build(String rcode) {
    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    return factory.build(ast);
  }
}
View Full Code Here

  }
 
  private void writeBody(MethodVisitor mv) {
    IRFunctionTable functionTable = new IRFunctionTable();
    IRBodyBuilder builder = new IRBodyBuilder(functionTable);
    IRBody body = builder.build(exp);
   
    ByteCodeVisitor visitor = new ByteCodeVisitor(generationContext, mv);
   
    ControlFlowGraph cfg = new ControlFlowGraph(body);
    for(BasicBlock bb : cfg.getBasicBlocks()) {
View Full Code Here

  }
 
  public static Class<Closure> compileAndLoad(Closure closureSexp) {
    IRFunctionTable functionTable = new IRFunctionTable();
    IRBodyBuilder builder = new IRBodyBuilder(functionTable);
    return compileAndLoad(new IRFunction(closureSexp.getFormals(), closureSexp.getBody(), builder.build(closureSexp.getBody())));
  }
 
  public static byte[] compile(String className, IRFunction closure) {
    return new ClosureCompiler(className)
    .doCompile(closure);   
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.