Skip to content

Commit df75165

Browse files
committed
Make the x86 backend push an extra word as closure/obj arg when emitting any code that amounts to a glue or native call.
1 parent 5d10a26 commit df75165

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: src/boot/be/abi.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let iterator_args_elt_outer_frame_ptr = 1;;
7979
let indirect_args_elt_closure = 0;;
8080

8181
(* dst, taskptr, closure-ptr, ty_params, src, src2=target_task *)
82-
let worst_case_glue_call_args = 5;;
82+
let worst_case_glue_call_args = 6;;
8383

8484
type abi =
8585
{

Diff for: src/boot/be/x86.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,12 @@ let frame_base_sz = Int64.mul (Int64.of_int frame_base_words) word_sz;;
536536
let frame_info_words = 2 (* crate ptr, crate-rel frame info disp *) ;;
537537
let frame_info_sz = Int64.mul (Int64.of_int frame_info_words) word_sz;;
538538

539-
let implicit_arg_words = 2 (* task ptr,out ptr *);;
540-
let implicit_args_sz = Int64.mul (Int64.of_int implicit_arg_words) word_sz;;
539+
let implicit_arg_words = 3 (* task ptr, out ptr, closure ptr *);;
540+
let implicit_args_sz = Int64.mul (Int64.of_int implicit_arg_words) word_sz;;
541541

542542
let out_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words);;
543543
let task_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words+1);;
544+
let closure_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words+2);;
544545
let ty_param_n i =
545546
wordptr_n (Il.Hreg ebp) (frame_base_words + implicit_arg_words + i);;
546547

@@ -855,6 +856,7 @@ let sweep_gc_chain
855856
(c (ecx_n Abi.tydesc_field_first_param));
856857
push (ro eax); (* Push typarams ptr. *)
857858

859+
push (immi 0L); (* Push null closure-ptr *)
858860
push (c task_ptr); (* Push task ptr. *)
859861
push (immi 0L); (* Push null outptr. *)
860862

0 commit comments

Comments
 (0)