aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-02 09:45:24 -0700
committerGraydon Hoare <[email protected]>2010-07-02 09:45:24 -0700
commitd9037af22d29163246659f4d59291009e0d00f78 (patch)
tree7123cd3cb7205f53295179da43edb1b55d330bc7 /src
parentActually link GC allocations onto the gc_alloc_chain, der. (diff)
downloadrust-d9037af22d29163246659f4d59291009e0d00f78.tar.xz
rust-d9037af22d29163246659f4d59291009e0d00f78.zip
Improve drop-path logging and simplify box_rc_cell.
Diffstat (limited to 'src')
-rw-r--r--src/boot/me/trans.ml19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index 38b3ad8a..742f237a 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -2249,9 +2249,7 @@ let trans_visitor
(tydesc_rty abi))
and box_rc_cell (cell:Il.cell) : Il.cell =
- let off = Abi.box_rc_slot_field_refcnt in
- let (mem, _) = need_mem_cell (deref_imm cell (word_n off)) in
- word_at mem
+ get_element_ptr (deref cell) Abi.box_rc_slot_field_refcnt
and box_allocation_size
(ty:Ast.ty)
@@ -2499,6 +2497,8 @@ let trans_visitor
| MEM_rc_opaque
| MEM_rc_struct ->
+ note_drop_step ty "in box-drop path of drop_ty";
+
let _ = check_box_rty cell in
let null_jmp = null_check cell in
let rc = box_rc_cell cell in
@@ -2524,6 +2524,7 @@ let trans_visitor
patch null_jmp
| MEM_interior when type_is_structured ty ->
+ note_drop_step ty "in structured-interior path of drop_ty";
(iflog (fun _ ->
annotate ("drop interior memory " ^
(Fmt.fmt_to_str Ast.fmt_ty ty))));
@@ -2535,6 +2536,7 @@ let trans_visitor
ty_params vr
| MEM_interior ->
+ note_drop_step ty "in simple-interior path of drop_ty";
(* Interior allocation of all-interior value not caught above:
* nothing to do.
*)
@@ -2729,8 +2731,15 @@ let trans_visitor
if cx.ctxt_sess.Session.sess_trace_drop ||
cx.ctxt_sess.Session.sess_log_trans
then
- let slotstr = Fmt.fmt_to_str Ast.fmt_ty ty in
- let str = step ^ " " ^ slotstr in
+ let mctrl_str =
+ match ty_mem_ctrl ty with
+ MEM_gc -> "MEM_gc"
+ | MEM_rc_struct -> "MEM_rc_struct"
+ | MEM_rc_opaque -> "MEM_rc_opaque"
+ | MEM_interior -> "MEM_interior"
+ in
+ let tystr = Fmt.fmt_to_str Ast.fmt_ty ty in
+ let str = step ^ " " ^ mctrl_str ^ " " ^ tystr in
begin
annotate str;
trace_str cx.ctxt_sess.Session.sess_trace_drop str