예제 #1
0
  gc<Chunk> ExprCompiler::compile(Module* module, AsyncExpr& expr)
  {
    compile(module, expr.resolved().maxLocals(),
            NULL, NULL, NULL, expr.body());

    chunk_->bind(maxSlots_, expr.resolved().closures().count());
    return chunk_;
  }
예제 #2
0
  void ExprCompiler::visit(AsyncExpr& expr, int dest)
  {
    // TODO(bob): Handle closures.
    ExprCompiler compiler(compiler_);
    gc<Chunk> chunk = compiler.compile(module_, expr);
    int index = chunk_->addChunk(chunk);

    write(expr.pos(), OP_ASYNC, index);
    // TODO(bob): What about dest?

    compileClosures(expr.pos(), expr.resolved());
  }
예제 #3
0
파일: Resolver.cpp 프로젝트: relrod/magpie
 void Resolver::visit(AsyncExpr& expr, int dummy)
 {
   resolve(compiler_, module_, this, &expr.resolved(), false, NULL, NULL,
           NULL, expr.body());
 }