max_arguments_without_passing_on-stack

master
Mark Shinwell 2016-01-29 15:57:36 +00:00
parent af2669f0a0
commit b5618e8642
9 changed files with 24 additions and 3 deletions

View File

@ -76,6 +76,8 @@ let masm =
Linux's dynamic loader also destroys r10.
*)
let max_arguments_without_passing_on_stack = 10
let int_reg_name =
match Config.ccomp_type with
| "msvc" ->

View File

@ -180,6 +180,8 @@ let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
remaining args on stack.
Return values in r0...r7 or d0...d15. *)
let max_arguments_without_passing_on_stack = 8
let single_regs arg = Array.map (fun arg -> [| arg |]) arg
let ensure_single_regs res =
Array.map (function

View File

@ -140,6 +140,8 @@ let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
remaining args on stack.
Return values in r0...r15 or d0...d15. *)
let max_arguments_without_passing_on_stack = 16
let loc_arguments arg =
calling_conventions 0 15 100 115 outgoing arg
let loc_parameters arg =

View File

@ -139,6 +139,10 @@ let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
(* For the moment, be conservative: any float argument ends up on the
stack. *)
let max_arguments_without_passing_on_stack = 0
let loc_arguments arg =
calling_conventions 0 5 100 99 outgoing arg
let loc_parameters arg =

View File

@ -174,6 +174,8 @@ let ensure_single_regs res =
| _ -> failwith "Proc.ensure_single_regs")
res
let max_arguments_without_passing_on_stack = 8
let loc_arguments arg =
let (loc, ofs) =
calling_conventions 0 7 100 112 outgoing 0 false (single_regs arg)

View File

@ -37,6 +37,11 @@ val loc_external_arguments: Reg.t array array -> Reg.t array array * int
val loc_external_results: Reg.t array -> Reg.t array
val loc_exn_bucket: Reg.t
(* The maximum number of arguments of an OCaml to OCaml function call for
which it is guaranteed there will be no arguments passed on the stack.
(Above this limit, tail call optimization may be disabled.) *)
val max_arguments_without_passing_on_stack : int
(* Maximal register pressures for pre-spilling *)
val safe_register_pressure: Mach.operation -> int
val max_register_pressure: Mach.operation -> int array

View File

@ -125,6 +125,8 @@ let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
let max_arguments_without_passing_on_stack = 4
let loc_arguments arg =
calling_conventions 0 4 100 103 outgoing 0 arg
let loc_parameters arg =

View File

@ -133,6 +133,8 @@ let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
let max_arguments_without_passing_on_stack = 8
let loc_arguments arg =
calling_conventions 6 15 100 105 outgoing arg
let loc_parameters arg =

View File

@ -26,9 +26,9 @@ module Backend = struct
let size_int = Arch.size_int
let big_endian = Arch.big_endian
(* CR mshinwell: this needs tying through to [Proc], although it may
necessitate the introduction of a new field in that module. *)
let max_sensible_number_of_arguments = 9
let max_sensible_number_of_arguments =
(* The "-1" is to allow for a potential closure environment parameter. *)
Proc.max_arguments_without_passing_on_stack - 1
end
let backend = (module Backend : Backend_intf.S)