Utiliser %r29 au lieu de %r1 pour passer la taille a caml_alloc et caml_call_gc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1309 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
a1d1dedc40
commit
e8639e7208
|
@ -544,13 +544,15 @@ let rec emit_instr i dslot =
|
|||
` comb,>>= %r3, %r1, {emit_label lbl_cont}\n`;
|
||||
` addi 4, %r3, {emit_reg i.res.(0)}\n`; (* in delay slot *)
|
||||
emit_call "caml_call_gc" "%r2";
|
||||
` ldi {emit_int n}, %r1\n`; (* in delay slot *)
|
||||
(* Cannot use %r1 to pass size, since clobbered by glue call code *)
|
||||
` ldi {emit_int n}, %r29\n`; (* in delay slot *)
|
||||
record_frame i.live;
|
||||
` addi 4, %r3, {emit_reg i.res.(0)}\n`;
|
||||
`{emit_label lbl_cont}:\n`
|
||||
end else begin
|
||||
emit_call "caml_alloc" "%r2";
|
||||
` ldi {emit_int n}, %r1\n`; (* in delay slot *)
|
||||
(* Cannot use %r1 either *)
|
||||
` ldi {emit_int n}, %r29\n`; (* in delay slot *)
|
||||
record_frame i.live;
|
||||
` addi 4, %r3, {emit_reg i.res.(0)}\n` (* in delay slot *)
|
||||
end
|
||||
|
|
|
@ -269,10 +269,13 @@ let destroyed_at_c_call = (* %r3 - %r18, %fr12 - %fr21 preserved *)
|
|||
let destroyed_by_millicode = (* %r25, %r26, %r28, %r29 -- more? *)
|
||||
[| phys_reg 19; phys_reg 20; phys_reg 21; phys_reg 22 |]
|
||||
|
||||
let destroyed_by_alloc = [| phys_reg 22 |] (* %r29 *)
|
||||
|
||||
let destroyed_at_oper = function
|
||||
Iop(Icall_ind | Icall_imm _ | Iextcall(_, true)) -> all_phys_regs
|
||||
| Iop(Iextcall(_, false)) -> destroyed_at_c_call
|
||||
| Iop(Iintop(Idiv | Imod)) -> destroyed_by_millicode
|
||||
| Iop(Ialloc _) -> destroyed_by_alloc
|
||||
| _ -> [||]
|
||||
|
||||
let destroyed_at_raise = all_phys_regs
|
||||
|
|
|
@ -87,10 +87,10 @@ caml_required_size .comm 8
|
|||
EXPORT_CODE(G(caml_alloc))
|
||||
G(caml_alloc):
|
||||
STARTPROC
|
||||
; Required size in %r1
|
||||
ldw 0(%r4), %r31
|
||||
sub %r3, %r1, %r3
|
||||
comb,<<,n %r3, %r31, G(caml_call_gc) ; nullify if taken (forward br.)
|
||||
; Required size in %r29
|
||||
ldw 0(%r4), %r1
|
||||
sub %r3, %r29, %r3
|
||||
comb,<<,n %r3, %r1, G(caml_call_gc) ; nullify if taken (forward br.)
|
||||
bv 0(%r2)
|
||||
nop
|
||||
ENDPROC
|
||||
|
@ -98,10 +98,9 @@ G(caml_alloc):
|
|||
EXPORT_CODE(G(caml_call_gc))
|
||||
G(caml_call_gc):
|
||||
STARTPROC
|
||||
; Save required size (%r1)
|
||||
copy %r1, %r31
|
||||
; Save required size (%r29)
|
||||
LOADHIGH(G(caml_required_size))
|
||||
stw %r31, LOW(G(caml_required_size))(%r1)
|
||||
stw %r29, LOW(G(caml_required_size))(%r1)
|
||||
; Save current allocation pointer for debugging purposes
|
||||
LOADHIGH(G(young_ptr))
|
||||
stw %r3, LOW(G(young_ptr))(%r1)
|
||||
|
@ -139,7 +138,7 @@ G(caml_call_gc):
|
|||
stws,ma %r25, 4(%r1)
|
||||
stws,ma %r26, 4(%r1)
|
||||
stws,ma %r28, 4(%r1)
|
||||
stws,ma %r29, 4(%r1)
|
||||
;; stws,ma %r29, 4(%r1) %r29 is clobbered
|
||||
LOADHIGH(G(gc_entry_float_regs))
|
||||
ldo LOW(G(gc_entry_float_regs))(%r1), %r1
|
||||
fstds,ma %fr4, 8(%r1)
|
||||
|
@ -207,7 +206,7 @@ G(caml_call_gc):
|
|||
ldws,ma 4(%r1), %r25
|
||||
ldws,ma 4(%r1), %r26
|
||||
ldws,ma 4(%r1), %r28
|
||||
ldws,ma 4(%r1), %r29
|
||||
;; ldws,ma 4(%r1), %r29 %r29 is clobbered
|
||||
LOADHIGH(G(gc_entry_float_regs))
|
||||
ldo LOW(G(gc_entry_float_regs))(%r1), %r1
|
||||
fldds,ma 8(%r1), %fr4
|
||||
|
|
Loading…
Reference in New Issue