Adjust call args laid out by fake frame created in rust_task::start to reflect new position of closure-or-obj pointer.

This commit is contained in:
Roy Frostig 2010-07-12 23:58:00 -07:00
parent e21865a440
commit 7c8c98a6d7

View File

@ -130,6 +130,7 @@ rust_task::start(uintptr_t exit_task_glue,
uintptr_t *spp = (uintptr_t *)rust_sp;
// The exit_task_glue frame we synthesize above the frame we activate:
*spp-- = (uintptr_t) 0; // closure-or-obj
*spp-- = (uintptr_t) this; // task
*spp-- = (uintptr_t) 0; // output
*spp-- = (uintptr_t) 0; // retpc
@ -153,6 +154,7 @@ rust_task::start(uintptr_t exit_task_glue,
uintptr_t *src = (uintptr_t *)args;
src += 1; // spawn-call output slot
src += 1; // spawn-call task slot
src += 1; // spawn-call closure-or-obj slot
// Memcpy all but the task and output pointers
callsz -= (2 * sizeof(uintptr_t));
spp = (uintptr_t*) (((uintptr_t)spp) - callsz);
@ -168,6 +170,7 @@ rust_task::start(uintptr_t exit_task_glue,
// The *implicit* incoming args to the spawnee frame we're
// activating:
*spp-- = (uintptr_t) 0; // closure-or-obj
*spp-- = (uintptr_t) this; // task
*spp-- = (uintptr_t) 0; // output addr
*spp-- = (uintptr_t) exit_task_glue; // retpc