Skip to content

Instantly share code, notes, and snippets.

@brson
Created March 27, 2011 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brson/888940 to your computer and use it in GitHub Desktop.
Save brson/888940 to your computer and use it in GitHub Desktop.
auto fres = trans_lval(bcx, f);
bcx = fres.res.bcx;
// FIXME: Evaluate arguments
auto nameval = make_task_name(bcx, name);
auto newtask = trans_upcall(bcx, "upcall_new_task",
vec(vp2i(bcx, nameval)));
bcx = newtask.bcx;
auto task_ty = node_ann_type(bcx.fcx.ccx, ann);
auto task_llty = type_of(cx.fcx.ccx, task_ty);
auto task_val = vi2p(bcx, newtask.val, task_llty);
// FIXME: Cleanups for the task
// Get start_task_parameters
auto parm_task = vp2i(bcx, task_val);
auto parm_exit_task_glue = vp2i(bcx, bcx.fcx.ccx.glues.exit_task_glue);
auto parm_spawnee_abi = C_int(abi.abi_x86_rustc_fastcall);
auto parm_spawnee_fn = vp2i(bcx, fres.res.val);
auto parm_callsz = C_int(12);
newtask = trans_upcall(bcx, "upcall_start_task",
vec(parm_task,
parm_exit_task_glue,
parm_spawnee_abi,
parm_spawnee_fn,
parm_callsz));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment