Skip to content

Commit

Permalink
Simplify null-writing from commit 8559a85 so as to avoid a branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
froystig committed Aug 27, 2010
1 parent 07095a3 commit aa30304
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/boot/me/trans.ml
Expand Up @@ -3264,6 +3264,7 @@ let trans_visitor
get_element_ptr dst Abi.binding_field_bound_data
in
mov dst_item (Il.Cell src_item);
mov dst_binding zero;
let null_jmp = null_check src_binding in
(* Copy if we have a src binding. *)
(* FIXME (issue #58): this is completely wrong, call
Expand All @@ -3274,14 +3275,7 @@ let trans_visitor
dst_binding (Ast.TY_box Ast.TY_int)
src_binding (Ast.TY_box Ast.TY_int)
curr_iso;
let end_jmp = mark() in
emit (Il.jmp Il.JMP Il.CodeNone);
patch null_jmp;
(* The src had a null binding, so make sure the dst
* does now too.
*)
mov dst_binding zero;
patch end_jmp
patch null_jmp
end

| _ ->
Expand Down

0 comments on commit aa30304

Please sign in to comment.