mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Remove todo for usage of free argument registers
This commit is contained in:
parent
bd7779172b
commit
0fa417ca9b
1 changed files with 9 additions and 6 deletions
|
|
@ -972,7 +972,7 @@ end
|
||||||
module SymbolicStack : sig
|
module SymbolicStack : sig
|
||||||
type t
|
type t
|
||||||
|
|
||||||
val empty : int -> int -> t
|
val empty : int -> t
|
||||||
val is_empty : t -> bool
|
val is_empty : t -> bool
|
||||||
val live_registers : t -> opnd list
|
val live_registers : t -> opnd list
|
||||||
val stack_size : t -> int
|
val stack_size : t -> int
|
||||||
|
|
@ -983,8 +983,11 @@ module SymbolicStack : sig
|
||||||
end = struct
|
end = struct
|
||||||
type t = { state : Register.t AbstractSymbolicStack.t; nlocals : int }
|
type t = { state : Register.t AbstractSymbolicStack.t; nlocals : int }
|
||||||
|
|
||||||
(* TODO: romanv: add free args registers? *)
|
(* To use free argument registers we have to rewrite function call compilation.
|
||||||
let empty _nargs nlocals =
|
Otherwise we will result with the following code in arguments setup:
|
||||||
|
movq %rcx, %rdx
|
||||||
|
movq %rdx, %rsi *)
|
||||||
|
let empty nlocals =
|
||||||
{
|
{
|
||||||
state = AbstractSymbolicStack.empty Registers.extra_caller_saved_registers;
|
state = AbstractSymbolicStack.empty Registers.extra_caller_saved_registers;
|
||||||
nlocals;
|
nlocals;
|
||||||
|
|
@ -1040,7 +1043,7 @@ class env prg =
|
||||||
val scount = 0 (* string count *)
|
val scount = 0 (* string count *)
|
||||||
val stack_slots = 0 (* maximal number of stack positions *)
|
val stack_slots = 0 (* maximal number of stack positions *)
|
||||||
val static_size = 0 (* static data size *)
|
val static_size = 0 (* static data size *)
|
||||||
val stack = SymbolicStack.empty 0 0 (* symbolic stack *)
|
val stack = SymbolicStack.empty 0 (* symbolic stack *)
|
||||||
val nargs = 0 (* number of function arguments *)
|
val nargs = 0 (* number of function arguments *)
|
||||||
val locals = [] (* function local variables *)
|
val locals = [] (* function local variables *)
|
||||||
val fname = "" (* function name *)
|
val fname = "" (* function name *)
|
||||||
|
|
@ -1091,7 +1094,7 @@ class env prg =
|
||||||
method drop_barrier = {<barrier = false>}
|
method drop_barrier = {<barrier = false>}
|
||||||
|
|
||||||
(* drop stack *)
|
(* drop stack *)
|
||||||
method drop_stack = {<stack = SymbolicStack.empty nargs static_size>}
|
method drop_stack = {<stack = SymbolicStack.empty static_size>}
|
||||||
|
|
||||||
(* associates a stack to a label *)
|
(* associates a stack to a label *)
|
||||||
method set_stack l = {<stackmap = M.add l stack stackmap>}
|
method set_stack l = {<stackmap = M.add l stack stackmap>}
|
||||||
|
|
@ -1209,7 +1212,7 @@ class env prg =
|
||||||
{<nargs
|
{<nargs
|
||||||
; static_size = nlocals
|
; static_size = nlocals
|
||||||
; stack_slots = nlocals
|
; stack_slots = nlocals
|
||||||
; stack = SymbolicStack.empty nargs nlocals
|
; stack = SymbolicStack.empty nlocals
|
||||||
; fname = f
|
; fname = f
|
||||||
; has_closure
|
; has_closure
|
||||||
; first_line = true>}
|
; first_line = true>}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue