Skip to content

Commit aa30304

Browse files
committed
Simplify null-writing from commit 8559a85 so as to avoid a branch.
1 parent 07095a3 commit aa30304

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/boot/me/trans.ml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,6 +3264,7 @@ let trans_visitor
32643264
get_element_ptr dst Abi.binding_field_bound_data
32653265
in
32663266
mov dst_item (Il.Cell src_item);
3267+
mov dst_binding zero;
32673268
let null_jmp = null_check src_binding in
32683269
(* Copy if we have a src binding. *)
32693270
(* FIXME (issue #58): this is completely wrong, call
@@ -3274,14 +3275,7 @@ let trans_visitor
32743275
dst_binding (Ast.TY_box Ast.TY_int)
32753276
src_binding (Ast.TY_box Ast.TY_int)
32763277
curr_iso;
3277-
let end_jmp = mark() in
3278-
emit (Il.jmp Il.JMP Il.CodeNone);
3279-
patch null_jmp;
3280-
(* The src had a null binding, so make sure the dst
3281-
* does now too.
3282-
*)
3283-
mov dst_binding zero;
3284-
patch end_jmp
3278+
patch null_jmp
32853279
end
32863280

32873281
| _ ->

0 commit comments

Comments
 (0)