diff options
| author | Jeffrey Yasskin <[email protected]> | 2010-08-08 19:24:35 -0700 |
|---|---|---|
| committer | Jeffrey Yasskin <[email protected]> | 2010-08-09 11:43:16 +0200 |
| commit | b71340552fa0caa870877f87a1273e8d4c91efe6 (patch) | |
| tree | a1a1883cded2c8541a817d41d91c2002a926207b /src/boot/me | |
| parent | Fix LLVM translation of modules. (diff) | |
| download | rust-b71340552fa0caa870877f87a1273e8d4c91efe6.tar.xz rust-b71340552fa0caa870877f87a1273e8d4c91efe6.zip | |
Add names to tasks and domains. These can either be an explicit literal string
after the "spawn" keyword, or implicitly the call expression used to start the
spawn.
Diffstat (limited to 'src/boot/me')
| -rw-r--r-- | src/boot/me/alias.ml | 2 | ||||
| -rw-r--r-- | src/boot/me/effect.ml | 2 | ||||
| -rw-r--r-- | src/boot/me/layout.ml | 2 | ||||
| -rw-r--r-- | src/boot/me/trans.ml | 11 | ||||
| -rw-r--r-- | src/boot/me/type.ml | 2 | ||||
| -rw-r--r-- | src/boot/me/typestate.ml | 4 | ||||
| -rw-r--r-- | src/boot/me/walk.ml | 2 |
7 files changed, 14 insertions, 11 deletions
diff --git a/src/boot/me/alias.ml b/src/boot/me/alias.ml index 94d34fb2..27575324 100644 --- a/src/boot/me/alias.ml +++ b/src/boot/me/alias.ml @@ -59,7 +59,7 @@ let alias_analysis_visitor * survive 'into' a sub-block (those formed during iteration) * need to be handled in this module. *) Ast.STMT_call (dst, callee, args) - | Ast.STMT_spawn (dst, _, callee, args) + | Ast.STMT_spawn (dst, _, _, callee, args) -> alias_call_args dst callee args | Ast.STMT_send (_, src) -> alias src diff --git a/src/boot/me/effect.ml b/src/boot/me/effect.ml index 79868def..73797409 100644 --- a/src/boot/me/effect.ml +++ b/src/boot/me/effect.ml @@ -62,7 +62,7 @@ let mutability_checking_visitor match s.node with Ast.STMT_copy (lv_dst, _) | Ast.STMT_call (lv_dst, _, _) - | Ast.STMT_spawn (lv_dst, _, _, _) + | Ast.STMT_spawn (lv_dst, _, _, _, _) | Ast.STMT_recv (lv_dst, _) | Ast.STMT_bind (lv_dst, _, _) | Ast.STMT_new_rec (lv_dst, _, _) diff --git a/src/boot/me/layout.ml b/src/boot/me/layout.ml index a9358795..1df37f0f 100644 --- a/src/boot/me/layout.ml +++ b/src/boot/me/layout.ml @@ -400,7 +400,7 @@ let layout_visitor let callees = match s.node with Ast.STMT_call (_, lv, _) - | Ast.STMT_spawn (_, _, lv, _) -> [| lv |] + | Ast.STMT_spawn (_, _, _, lv, _) -> [| lv |] | Ast.STMT_check (_, calls) -> Array.map (fun (lv, _) -> lv) calls | _ -> [| |] in diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index b708bb26..01a89c56 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -2128,10 +2128,12 @@ let trans_visitor ((*initializing*)_:bool) (dst:Ast.lval) (domain:Ast.domain) + (name:string) (fn_lval:Ast.lval) (args:Ast.atom array) : unit = let (task_cell, _) = trans_lval_init dst in + let runtime_name = trans_static_string name in let (fptr_operand, fn_ty) = trans_callee fn_lval in (*let fn_ty_params = [| |] in*) let _ = @@ -2165,7 +2167,7 @@ let trans_visitor match domain with Ast.DOMAIN_thread -> begin - trans_upcall "upcall_new_thread" new_task [| |]; + trans_upcall "upcall_new_thread" new_task [| runtime_name |]; copy_fn_args false true (CLONE_all new_task) call; trans_upcall "upcall_start_thread" task_cell [| @@ -2177,7 +2179,7 @@ let trans_visitor end | _ -> begin - trans_upcall "upcall_new_task" new_task [| |]; + trans_upcall "upcall_new_task" new_task [| runtime_name |]; copy_fn_args false true (CLONE_chan new_task) call; trans_upcall "upcall_start_task" task_cell [| @@ -4496,8 +4498,9 @@ let trans_visitor | Ast.STMT_send (chan,src) -> trans_send chan src - | Ast.STMT_spawn (dst, domain, plv, args) -> - trans_spawn (maybe_init stmt.id "spawn" dst) dst domain plv args + | Ast.STMT_spawn (dst, domain, name, plv, args) -> + trans_spawn (maybe_init stmt.id "spawn" dst) dst + domain name plv args | Ast.STMT_recv (dst, chan) -> trans_recv (maybe_init stmt.id "recv" dst) dst chan diff --git a/src/boot/me/type.ml b/src/boot/me/type.ml index 23210ea1..b2d5a622 100644 --- a/src/boot/me/type.ml +++ b/src/boot/me/type.ml @@ -692,7 +692,7 @@ let check_stmt (cx:Semant.ctxt) : (fn_ctx -> Ast.stmt -> unit) = and check_stmt (stmt:Ast.stmt) : unit = check_ret stmt; match stmt.Common.node with - Ast.STMT_spawn (dst, _, callee, args) -> + Ast.STMT_spawn (dst, _, _, callee, args) -> infer_lval Ast.TY_task dst; demand Ast.TY_nil (check_fn callee args) diff --git a/src/boot/me/typestate.ml b/src/boot/me/typestate.ml index baf4a543..20702990 100644 --- a/src/boot/me/typestate.ml +++ b/src/boot/me/typestate.ml @@ -664,7 +664,7 @@ let condition_assigning_visitor let precond = Array.append dst_init src_init in raise_pre_post_cond s.id precond; - | Ast.STMT_spawn (dst, _, lv, args) + | Ast.STMT_spawn (dst, _, _, lv, args) | Ast.STMT_call (dst, lv, args) -> raise_dst_init_precond_if_writing_through s.id dst; visit_callable_pre s.id (lval_slots cx dst) lv args @@ -1350,7 +1350,7 @@ let lifecycle_visitor match s.node with Ast.STMT_copy (lv_dst, _) | Ast.STMT_call (lv_dst, _, _) - | Ast.STMT_spawn (lv_dst, _, _, _) + | Ast.STMT_spawn (lv_dst, _, _, _, _) | Ast.STMT_recv (lv_dst, _) | Ast.STMT_bind (lv_dst, _, _) | Ast.STMT_new_rec (lv_dst, _, _) diff --git a/src/boot/me/walk.ml b/src/boot/me/walk.ml index 0e65406a..cadfd66b 100644 --- a/src/boot/me/walk.ml +++ b/src/boot/me/walk.ml @@ -451,7 +451,7 @@ and walk_stmt walk_lval v f; Array.iter (walk_opt_atom v) az - | Ast.STMT_spawn (dst,_,p,az) -> + | Ast.STMT_spawn (dst,_,_,p,az) -> walk_lval v dst; walk_lval v p; Array.iter (walk_atom v) az |