Readaptation du portage HPPA a NextStep
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@899 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
fc52ff530a
commit
f1d4573081
|
@ -277,7 +277,7 @@ let record_frame live =
|
|||
`{emit_label lbl}:\n`
|
||||
|
||||
let emit_frame fd =
|
||||
` .word {emit_label fd.fd_lbl} + 3\n`;
|
||||
` .long {emit_label fd.fd_lbl} + 3\n`;
|
||||
` .short {emit_int fd.fd_frame_size}\n`;
|
||||
` .short {emit_int (List.length fd.fd_live_offset)}\n`;
|
||||
List.iter
|
||||
|
@ -867,15 +867,15 @@ let emit_item = function
|
|||
| Cint16 n ->
|
||||
` .short {emit_int n}\n`
|
||||
| Cint n ->
|
||||
` .word {emit_int n}\n`
|
||||
` .long {emit_int n}\n`
|
||||
| Cintlit s ->
|
||||
` .word {emit_string s}\n`
|
||||
` .long {emit_string s}\n`
|
||||
| Cfloat f ->
|
||||
` .double {emit_string f}\n`
|
||||
| Csymbol_address s ->
|
||||
` .word {emit_symbol s}\n`
|
||||
` .long {emit_symbol s}\n`
|
||||
| Clabel_address lbl ->
|
||||
` .word {emit_label(lbl + 10000)}\n`
|
||||
` .long {emit_label(lbl + 10000)}\n`
|
||||
| Cstring s ->
|
||||
let l = String.length s in
|
||||
if l = 0 then ()
|
||||
|
@ -929,11 +929,11 @@ let end_assembly() =
|
|||
let lbl_end = Compilenv.current_unit_name() ^ "_end" in
|
||||
emit_global lbl_end;
|
||||
`{emit_symbol lbl_end}:\n`;
|
||||
` .word 0\n`;
|
||||
` .long 0\n`;
|
||||
let lbl = Compilenv.current_unit_name() ^ "_frametable" in
|
||||
emit_global lbl;
|
||||
`{emit_symbol lbl}:\n`;
|
||||
` .word {emit_int (List.length !frame_descriptors)}\n`;
|
||||
` .long {emit_int (List.length !frame_descriptors)}\n`;
|
||||
List.iter emit_frame !frame_descriptors;
|
||||
frame_descriptors := [];
|
||||
if hpux then emit_imports()
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define LOW(x) RR%x-$global$
|
||||
#define LOADHIGHLABEL(x) ldil LR%x, %r1
|
||||
#define LOWLABEL(x) RR%x
|
||||
#define CALL(x) bl x, %r2 ! nop
|
||||
#endif
|
||||
|
||||
#ifdef SYS_nextstep
|
||||
|
@ -41,7 +40,6 @@
|
|||
#define LOW(x) R`x
|
||||
#define LOADHIGHLABEL(x) ldil L`x, %r1
|
||||
#define LOWLABEL(x) R`x
|
||||
#define CALL(x) ldil L`x, %r1; ble R`x(4, %r1); copy %r31, %r2
|
||||
#endif
|
||||
|
||||
#ifdef SYS_hpux
|
||||
|
@ -174,7 +172,14 @@ G(caml_call_gc):
|
|||
|
||||
; Call the garbage collector
|
||||
ldo 64(%r30), %r30
|
||||
CALL(G(garbage_collection))
|
||||
#ifdef SYS_nextstep
|
||||
ldil L`G(garbage_collection), %r1
|
||||
ble R`G(garbage_collection)(4, %r1)
|
||||
copy %r31, %r2
|
||||
#else
|
||||
bl G(garbage_collection), %r2
|
||||
nop
|
||||
#endif
|
||||
ldo -64(%r30), %r30
|
||||
|
||||
; Restore all regs used by the code generator
|
||||
|
@ -354,7 +359,14 @@ L100:
|
|||
LOADHIGH(G(young_limit))
|
||||
ldo LOW(G(young_limit))(%r1), %r4
|
||||
; Go for it
|
||||
CALL(G(caml_program))
|
||||
#ifdef SYS_nextstep
|
||||
ldil L`G(caml_program), %r1
|
||||
ble R`G(caml_program)(4, %r1)
|
||||
copy %r31, %r2
|
||||
#else
|
||||
bl G(caml_program), %r2
|
||||
nop
|
||||
#endif
|
||||
; Pop handler
|
||||
ldo -8(%r30), %r30
|
||||
; Return with zero result
|
||||
|
@ -583,7 +595,14 @@ L103:
|
|||
stw %r5, LOW(G(caml_exception_pointer))(%r1)
|
||||
; Re-raise the exception through mlraise, to clean up local C roots
|
||||
ldo 64(%r30), %r30
|
||||
CALL(G(mlraise)) ; never returns
|
||||
#ifdef SYS_nextstep
|
||||
ldil L`G(mlraise), %r1
|
||||
ble R`G(mlraise)(4, %r1)
|
||||
copy %r31, %r2
|
||||
#else
|
||||
bl G(mlraise), %r2
|
||||
nop
|
||||
#endif
|
||||
ENDPROC
|
||||
|
||||
.align CODE_ALIGN
|
||||
|
@ -616,7 +635,7 @@ G(callback3):
|
|||
.data
|
||||
EXPORT_DATA(G(system_frametable))
|
||||
G(system_frametable):
|
||||
.word 1 /* one descriptor */
|
||||
.word L104 + 3 /* return address into callback */
|
||||
.long 1 /* one descriptor */
|
||||
.long L104 + 3 /* return address into callback */
|
||||
.short -1 /* negative frame size => use callback link */
|
||||
.short 0 /* no roots */
|
||||
|
|
Loading…
Reference in New Issue