Make the x86 backend push an extra word as closure/obj arg when emitting any code that amounts to a glue or native call.

This commit is contained in:
Roy Frostig 2010-07-13 18:11:23 -07:00
parent 5d10a264de
commit df75165cf4
2 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,7 @@ let iterator_args_elt_outer_frame_ptr = 1;;
let indirect_args_elt_closure = 0;;
(* dst, taskptr, closure-ptr, ty_params, src, src2=target_task *)
let worst_case_glue_call_args = 5;;
let worst_case_glue_call_args = 6;;
type abi =
{

View File

@ -536,11 +536,12 @@ let frame_base_sz = Int64.mul (Int64.of_int frame_base_words) word_sz;;
let frame_info_words = 2 (* crate ptr, crate-rel frame info disp *) ;;
let frame_info_sz = Int64.mul (Int64.of_int frame_info_words) word_sz;;
let implicit_arg_words = 2 (* task ptr,out ptr *);;
let implicit_args_sz = Int64.mul (Int64.of_int implicit_arg_words) word_sz;;
let implicit_arg_words = 3 (* task ptr, out ptr, closure ptr *);;
let implicit_args_sz = Int64.mul (Int64.of_int implicit_arg_words) word_sz;;
let out_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words);;
let task_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words+1);;
let closure_ptr = wordptr_n (Il.Hreg ebp) (frame_base_words+2);;
let ty_param_n i =
wordptr_n (Il.Hreg ebp) (frame_base_words + implicit_arg_words + i);;
@ -855,6 +856,7 @@ let sweep_gc_chain
(c (ecx_n Abi.tydesc_field_first_param));
push (ro eax); (* Push typarams ptr. *)
push (immi 0L); (* Push null closure-ptr *)
push (c task_ptr); (* Push task ptr. *)
push (immi 0L); (* Push null outptr. *)