Skip to content

Commit d6338a8

Browse files
author
Eric Holk
committed
Added some comments to trans_spawn that sort of explains what needs to happen
1 parent 2b124a8 commit d6338a8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5901,10 +5901,24 @@ fn trans_spawn(&ast::spawn_dom dom, &option::t[str] name,
59015901

59025902
// dump a bunch of information
59035903
log_err "Spawn";
5904-
//log_err dom;
59055904
log_err #fmt("task name: %s", tname);
59065905

59075906
// Generate code
5907+
//
5908+
// This is a several step process. The following things need to happen
5909+
// (not necessarily in order):
5910+
//
5911+
// 1. Evaluate all the arguments to the spawnee.
5912+
//
5913+
// 2. Alloca a tuple that holds these arguments (they must be in reverse
5914+
// order, so that they match the expected stack layout for the spawnee)
5915+
//
5916+
// 3. Fill the tutple with the arguments we evaluated.
5917+
//
5918+
// 4. Pass a pointer to the spawnee function and the argument tuple to
5919+
// upcall_start_task.
5920+
5921+
59085922
alt(dom) {
59095923
case(ast::dom_implicit) {
59105924
// TODO

0 commit comments

Comments
 (0)