Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
Shorten read barrier code on x86-64
Browse files Browse the repository at this point in the history
  • Loading branch information
stedolan committed Aug 30, 2018
1 parent bdd1555 commit 6974f45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions asmcomp/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,9 @@ let emit_instr fallthrough i =
I.sub (nat s) rax;
let bits = Domainstate.minor_heap_align_bits + Domainstate.minor_heap_sel_bits in
let minor_val_bitmask = Nativeint.(logor one (shift_left minus_one bits)) in
I.mov (nat minor_val_bitmask) rdx;
I.test rdx rax;
(* The test instruction sign-extends a 32-bit immediate *)
assert (minor_val_bitmask = Nativeint.(minor_val_bitmask |> to_int32 |> of_int32));
I.test (nat minor_val_bitmask) rax;
let lbl_call_read_barrier = new_label () in
let lbl_return = new_label () in
let lbl_frame = record_frame_label i.live false Debuginfo.none in
Expand Down
2 changes: 1 addition & 1 deletion byterun/caml/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ typedef uint64_t uintnat;

/* There may be at most 1<<Minor_heap_sel_bits minor
heaps allocated */
#define Minor_heap_sel_bits 8
#define Minor_heap_sel_bits 7

/* An entire minor heap must fit inside one region
of size 1 << Minor_heap_align_bits, which determines
Expand Down
1 change: 0 additions & 1 deletion utils/domainstate.ml.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#define CAML_CONFIG_H_NO_TYPEDEFS
#include "config.h"
let minor_heap_sel_bits = Minor_heap_sel_bits
Expand Down

0 comments on commit 6974f45

Please sign in to comment.