示例#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
 void Resolver::visit(AsyncExpr& expr, int dummy)
 {
   resolve(compiler_, module_, this, &expr.resolved(), false, NULL, NULL,
           NULL, expr.body());
 }