diff options
Diffstat (limited to 'asmrun/amd64nt.asm')
-rw-r--r-- | asmrun/amd64nt.asm | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/asmrun/amd64nt.asm b/asmrun/amd64nt.asm index 2a38fd9f38..b262a01986 100644 --- a/asmrun/amd64nt.asm +++ b/asmrun/amd64nt.asm @@ -30,7 +30,7 @@ EXTRN caml_bottom_of_stack: QWORD EXTRN caml_last_return_address: QWORD EXTRN caml_gc_regs: QWORD - EXTRN caml_exception_pointer: QWORD + EXTRN caml_exception_pointer: QWORD EXTRN caml_backtrace_active: DWORD EXTRN caml_stash_backtrace: NEAR @@ -48,8 +48,8 @@ caml_call_gc: mov caml_bottom_of_stack, rax L105: ; Save caml_young_ptr, caml_exception_pointer - mov caml_young_ptr, r15 - mov caml_exception_pointer, r14 + mov caml_young_ptr, r15 + mov caml_exception_pointer, r14 ; Build array of registers, save it into caml_gc_regs push r13 push r12 @@ -119,8 +119,8 @@ L105: pop r12 pop r13 ; Restore caml_young_ptr, caml_exception_pointer - mov r15, caml_young_ptr - mov r14, caml_exception_pointer + mov r15, caml_young_ptr + mov r14, caml_exception_pointer ; Return to caller ret @@ -136,9 +136,9 @@ L100: mov caml_last_return_address, rax lea rax, [rsp + 8] mov caml_bottom_of_stack, rax - sub rsp, 8 + sub rsp, 8 call L105 - add rsp, 8 + add rsp, 8 jmp caml_alloc1 PUBLIC caml_alloc2 @@ -153,9 +153,9 @@ L101: mov caml_last_return_address, rax lea rax, [rsp + 8] mov caml_bottom_of_stack, rax - sub rsp, 8 + sub rsp, 8 call L105 - add rsp, 8 + add rsp, 8 jmp caml_alloc2 PUBLIC caml_alloc3 @@ -170,9 +170,9 @@ L102: mov caml_last_return_address, rax lea rax, [rsp + 8] mov caml_bottom_of_stack, rax - sub rsp, 8 + sub rsp, 8 call L105 - add rsp, 8 + add rsp, 8 jmp caml_alloc3 PUBLIC caml_allocN @@ -192,7 +192,7 @@ L103: pop rax ; recover desired size jmp caml_allocN -; Call a C function from Caml +; Call a C function from OCaml PUBLIC caml_c_call ALIGN 16 @@ -202,17 +202,17 @@ caml_c_call: mov caml_last_return_address, r12 mov caml_bottom_of_stack, rsp ; Make the exception handler and alloc ptr available to the C code - mov caml_young_ptr, r15 - mov caml_exception_pointer, r14 + mov caml_young_ptr, r15 + mov caml_exception_pointer, r14 ; Call the function (address in rax) call rax ; Reload alloc ptr - mov r15, caml_young_ptr + mov r15, caml_young_ptr ; Return to caller - push r12 - ret + push r12 + ret -; Start the Caml program +; Start the OCaml program PUBLIC caml_start_program ALIGN 16 @@ -242,19 +242,19 @@ caml_start_program: ; Common code for caml_start_program and caml_callback* L106: ; Build a callback link - sub rsp, 8 ; stack 16-aligned + sub rsp, 8 ; stack 16-aligned push caml_gc_regs push caml_last_return_address push caml_bottom_of_stack ; Setup alloc ptr and exception ptr - mov r15, caml_young_ptr - mov r14, caml_exception_pointer + mov r15, caml_young_ptr + mov r14, caml_exception_pointer ; Build an exception handler lea r13, L108 push r13 push r14 mov r14, rsp - ; Call the Caml code + ; Call the OCaml code call r12 L107: ; Pop the exception handler @@ -262,13 +262,13 @@ L107: pop r12 ; dummy register L109: ; Update alloc ptr and exception ptr - mov caml_young_ptr, r15 - mov caml_exception_pointer, r14 + mov caml_young_ptr, r15 + mov caml_exception_pointer, r14 ; Pop the callback restoring, link the global variables pop caml_bottom_of_stack pop caml_last_return_address pop caml_gc_regs - add rsp, 8 + add rsp, 8 ; Restore callee-save registers. movapd xmm6, OWORD PTR [rsp + 0*16] movapd xmm7, OWORD PTR [rsp + 1*16] @@ -297,7 +297,7 @@ L108: or rax, 2 jmp L109 -; Raise an exception from Caml +; Raise an exception from OCaml PUBLIC caml_raise_exn ALIGN 16 @@ -346,7 +346,7 @@ L111: mov r15, caml_young_ptr ; Reload alloc ptr ret -; Callback from C to Caml +; Callback from C to OCaml PUBLIC caml_callback_exn ALIGN 16 @@ -441,8 +441,8 @@ caml_callback3_exn: PUBLIC caml_ml_array_bound_error ALIGN 16 caml_ml_array_bound_error: - lea rax, caml_array_bound_error - jmp caml_c_call + lea rax, caml_array_bound_error + jmp caml_c_call .DATA PUBLIC caml_system__frametable @@ -456,11 +456,11 @@ caml_system__frametable LABEL QWORD PUBLIC caml_negf_mask ALIGN 16 caml_negf_mask LABEL QWORD - QWORD 8000000000000000H, 0 + QWORD 8000000000000000H, 0 PUBLIC caml_absf_mask ALIGN 16 caml_absf_mask LABEL QWORD - QWORD 7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH + QWORD 7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH END |