stuff
This commit is contained in:
parent
e71edea69c
commit
579e163f8e
1 changed files with 8 additions and 9 deletions
|
@ -524,23 +524,22 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct
|
|||
+ fd.locals_space
|
||||
;;
|
||||
|
||||
(* Ajoute les éléments de liste sur la pile *)
|
||||
let add_stack stack list start op_addr =
|
||||
let stack, _ =
|
||||
List.fold_left
|
||||
(fun (stack, addr) id -> S.IdMap.add id (Mint.of_int addr) stack, op_addr addr)
|
||||
(stack, start)
|
||||
list
|
||||
in
|
||||
stack
|
||||
fst
|
||||
(List.fold_left
|
||||
(fun (stack, addr) id -> S.IdMap.add id (Mint.of_int addr) stack, op_addr addr)
|
||||
(stack, start)
|
||||
list)
|
||||
;;
|
||||
|
||||
let frame_descriptor ~params ~locals =
|
||||
(* Ajout à la pile les variables présentent dans la liste *)
|
||||
let stack = add_stack S.IdMap.empty locals (-8) (fun x -> x - 8) in
|
||||
let stack = add_stack stack params 16 (fun x -> x + 8) in
|
||||
let stack' = add_stack stack params 16 (fun x -> x + 8) in
|
||||
{ param_count = List.length params
|
||||
; locals_space = List.length locals * 8
|
||||
; stack_map = stack
|
||||
; stack_map = stack'
|
||||
}
|
||||
;;
|
||||
|
||||
|
|
Reference in a new issue