2016-02-19 09:13:32 -08:00
|
|
|
;**************************************************************************
|
|
|
|
;* *
|
|
|
|
;* OCaml *
|
|
|
|
;* *
|
|
|
|
;* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
|
|
|
|
;* *
|
|
|
|
;* Copyright 1996 Institut National de Recherche en Informatique et *
|
|
|
|
;* en Automatique. *
|
|
|
|
;* *
|
|
|
|
;* All rights reserved. This file is distributed under the terms of *
|
|
|
|
;* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
;* special exception on linking described in the file LICENSE. *
|
|
|
|
;* *
|
|
|
|
;**************************************************************************
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
; Asm part of the runtime system, Intel 386 processor, Intel syntax
|
|
|
|
|
2012-07-30 11:04:46 -07:00
|
|
|
.386
|
|
|
|
.MODEL FLAT
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2004-05-04 02:02:47 -07:00
|
|
|
EXTERN _caml_garbage_collection: PROC
|
1996-02-21 02:49:46 -08:00
|
|
|
EXTERN _caml_apply2: PROC
|
|
|
|
EXTERN _caml_apply3: PROC
|
|
|
|
EXTERN _caml_program: PROC
|
2004-05-04 02:02:47 -07:00
|
|
|
EXTERN _caml_array_bound_error: PROC
|
2007-01-29 04:11:18 -08:00
|
|
|
EXTERN _caml_stash_backtrace: PROC
|
2019-06-22 04:56:53 -07:00
|
|
|
EXTERN _Caml_state: DWORD
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2020-06-15 05:17:42 -07:00
|
|
|
.CODE
|
|
|
|
|
|
|
|
PUBLIC _caml_system__code_begin
|
|
|
|
_caml_system__code_begin:
|
|
|
|
ret ; just one instruction, so that debuggers don't display
|
|
|
|
; caml_system__code_begin instead of caml_call_gc
|
2010-01-22 04:48:24 -08:00
|
|
|
; Allocation
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2019-06-22 04:56:53 -07:00
|
|
|
PUBLIC _caml_call_gc
|
1996-02-21 02:49:46 -08:00
|
|
|
PUBLIC _caml_alloc1
|
|
|
|
PUBLIC _caml_alloc2
|
|
|
|
PUBLIC _caml_alloc3
|
2004-05-04 02:02:47 -07:00
|
|
|
PUBLIC _caml_allocN
|
2019-06-22 04:56:53 -07:00
|
|
|
|
|
|
|
INCLUDE domain_state32.inc
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-05-16 12:39:26 -07:00
|
|
|
_caml_call_gc:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Record lowest stack address and return address
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
mov eax, [esp]
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_last_return_address ebx, eax
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
lea eax, [esp+4]
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_bottom_of_stack ebx, eax
|
2010-01-22 04:48:24 -08:00
|
|
|
; Save all regs used by the code generator
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
push ebp
|
1997-11-27 08:28:40 -08:00
|
|
|
push edi
|
|
|
|
push esi
|
|
|
|
push edx
|
|
|
|
push ecx
|
|
|
|
push ebx
|
|
|
|
push eax
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_gc_regs ebx, esp
|
2010-01-22 04:48:24 -08:00
|
|
|
; Call the garbage collector
|
2012-07-30 11:04:46 -07:00
|
|
|
call _caml_garbage_collection
|
2010-01-22 04:48:24 -08:00
|
|
|
; Restore all regs used by the code generator
|
2012-07-30 11:04:46 -07:00
|
|
|
pop eax
|
1997-11-27 08:28:40 -08:00
|
|
|
pop ebx
|
|
|
|
pop ecx
|
|
|
|
pop edx
|
|
|
|
pop esi
|
|
|
|
pop edi
|
|
|
|
pop ebp
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
; Return to caller. Returns young_ptr in eax
|
2019-11-04 04:07:22 -08:00
|
|
|
Load_young_ptr ebx, eax
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
1996-05-16 12:39:26 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
ALIGN 4
|
|
|
|
_caml_alloc1:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Load_young_ptr ebx, eax
|
2012-07-30 11:04:46 -07:00
|
|
|
sub eax, 8
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_young_ptr ebx, eax
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
Cmp_young_limit ebx, eax
|
|
|
|
jb _caml_call_gc
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
ALIGN 4
|
|
|
|
_caml_alloc2:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Load_young_ptr ebx, eax
|
2012-07-30 11:04:46 -07:00
|
|
|
sub eax, 12
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_young_ptr ebx, eax
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
Cmp_young_limit ebx, eax
|
|
|
|
jb _caml_call_gc
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
ALIGN 4
|
|
|
|
_caml_alloc3:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Load_young_ptr ebx, eax
|
2012-07-30 11:04:46 -07:00
|
|
|
sub eax, 16
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_young_ptr ebx, eax
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
Cmp_young_limit ebx, eax
|
|
|
|
jb _caml_call_gc
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
2019-06-22 04:56:53 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
ALIGN 4
|
2004-05-04 02:02:47 -07:00
|
|
|
_caml_allocN:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Sub_young_ptr ebx, eax ; eax = size - young_ptr
|
|
|
|
neg eax ; eax = young_ptr - size
|
|
|
|
Store_young_ptr ebx, eax
|
Per-architecture support for allocation size info in frame tables.
amd64: remove caml_call_gc{1,2,3} and simplify caml_alloc{1,2,3,N}
by tail-calling caml_call_gc.
i386: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
these functions do not need to preserve ebx.
arm: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
arm64: simplify caml_alloc{1,2,3,N} by tail-calling caml_call_gc.
partial revert of #8619.
power: partial revert of #8619.
avoid restarting allocation sequence after failure.
s390: partial revert of #8619.
avoid restarting allocation seqeunce after failure.
2019-10-22 01:39:02 -07:00
|
|
|
Cmp_young_limit ebx, eax
|
|
|
|
jb _caml_call_gc
|
1996-05-16 12:39:26 -07:00
|
|
|
ret
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-02-10 08:15:24 -08:00
|
|
|
; Call a C function from OCaml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
PUBLIC _caml_c_call
|
|
|
|
ALIGN 4
|
|
|
|
_caml_c_call:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Record lowest stack address and return address
|
2019-06-22 04:56:53 -07:00
|
|
|
; ecx and edx are destroyed at C call. Use them as temp.
|
|
|
|
mov ecx, _Caml_state
|
2012-07-30 11:04:46 -07:00
|
|
|
mov edx, [esp]
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_last_return_address ecx, edx
|
2012-07-30 11:04:46 -07:00
|
|
|
lea edx, [esp+4]
|
2019-06-22 04:56:53 -07:00
|
|
|
Store_bottom_of_stack ecx, edx
|
2010-01-22 04:48:24 -08:00
|
|
|
; Call the function (address in %eax)
|
2012-07-30 11:04:46 -07:00
|
|
|
jmp eax
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-02-10 08:15:24 -08:00
|
|
|
; Start the OCaml program
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
PUBLIC _caml_start_program
|
|
|
|
ALIGN 4
|
|
|
|
_caml_start_program:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Save callee-save registers
|
2012-07-30 11:04:46 -07:00
|
|
|
push ebx
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
push ebp
|
1997-03-17 02:17:32 -08:00
|
|
|
; Initial code pointer is caml_program
|
|
|
|
mov esi, offset _caml_program
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-03-17 02:17:32 -08:00
|
|
|
; Code shared between caml_start_program and callback*
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
L106:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov edi, _Caml_state
|
2010-01-22 04:48:24 -08:00
|
|
|
; Build a callback link
|
2019-06-22 04:56:53 -07:00
|
|
|
Push_gc_regs edi
|
|
|
|
Push_last_return_address edi
|
|
|
|
Push_bottom_of_stack edi
|
2010-01-22 04:48:24 -08:00
|
|
|
; Build an exception handler
|
2012-07-30 11:04:46 -07:00
|
|
|
push L108
|
2019-06-22 04:56:53 -07:00
|
|
|
Push_exception_pointer edi
|
|
|
|
Store_exception_pointer edi, esp
|
2012-02-10 08:15:24 -08:00
|
|
|
; Call the OCaml code
|
2012-07-30 11:04:46 -07:00
|
|
|
call esi
|
1996-02-21 02:49:46 -08:00
|
|
|
L107:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov edi, _Caml_state
|
2010-01-22 04:48:24 -08:00
|
|
|
; Pop the exception handler
|
2019-06-22 04:56:53 -07:00
|
|
|
Pop_exception_pointer edi
|
|
|
|
add esp, 4
|
1999-02-14 08:48:25 -08:00
|
|
|
L109:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov edi, _Caml_state
|
1996-02-21 02:49:46 -08:00
|
|
|
; Pop the callback link, restoring the global variables
|
|
|
|
; used by caml_c_call
|
2019-06-22 04:56:53 -07:00
|
|
|
Pop_bottom_of_stack edi
|
|
|
|
Pop_last_return_address edi
|
|
|
|
Pop_gc_regs edi
|
1996-02-21 02:49:46 -08:00
|
|
|
; Restore callee-save registers.
|
2012-07-30 11:04:46 -07:00
|
|
|
pop ebp
|
|
|
|
pop edi
|
|
|
|
pop esi
|
|
|
|
pop ebx
|
2010-01-22 04:48:24 -08:00
|
|
|
; Return to caller.
|
|
|
|
ret
|
1996-02-21 02:49:46 -08:00
|
|
|
L108:
|
|
|
|
; Exception handler
|
1999-02-14 08:48:25 -08:00
|
|
|
; Mark the bucket as an exception result and return it
|
|
|
|
or eax, 2
|
|
|
|
jmp L109
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-02-10 08:15:24 -08:00
|
|
|
; Raise an exception for OCaml
|
2007-01-29 04:11:18 -08:00
|
|
|
|
|
|
|
PUBLIC _caml_raise_exn
|
|
|
|
ALIGN 4
|
|
|
|
_caml_raise_exn:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Load_backtrace_active ebx, ecx
|
|
|
|
test ecx, 1
|
2007-01-29 04:11:18 -08:00
|
|
|
jne L110
|
2019-06-22 04:56:53 -07:00
|
|
|
Load_exception_pointer ebx, esp
|
|
|
|
Pop_exception_pointer ebx
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
2007-01-29 04:11:18 -08:00
|
|
|
L110:
|
|
|
|
mov esi, eax ; Save exception bucket in esi
|
2019-06-22 04:56:53 -07:00
|
|
|
Load_exception_pointer ebx, edi ; SP of handler
|
2007-01-29 04:11:18 -08:00
|
|
|
mov eax, [esp] ; PC of raise
|
2019-06-22 04:56:53 -07:00
|
|
|
lea edx, [esp+4] ; SP of raise
|
2007-01-29 04:11:18 -08:00
|
|
|
push edi ; arg 4: SP of handler
|
|
|
|
push edx ; arg 3: SP of raise
|
|
|
|
push eax ; arg 2: PC of raise
|
|
|
|
push esi ; arg 1: exception bucket
|
|
|
|
call _caml_stash_backtrace
|
|
|
|
mov eax, esi ; recover exception bucket
|
|
|
|
mov esp, edi ; cut the stack
|
2019-06-22 04:56:53 -07:00
|
|
|
Pop_exception_pointer ebx
|
2007-01-29 04:11:18 -08:00
|
|
|
ret
|
|
|
|
|
2016-07-28 04:46:23 -07:00
|
|
|
; Raise an exception from C
|
1997-03-17 02:17:32 -08:00
|
|
|
|
2004-05-04 02:02:47 -07:00
|
|
|
PUBLIC _caml_raise_exception
|
1997-03-17 02:17:32 -08:00
|
|
|
ALIGN 4
|
2004-05-04 02:02:47 -07:00
|
|
|
_caml_raise_exception:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, _Caml_state
|
|
|
|
Load_backtrace_active ebx, ecx
|
|
|
|
test ecx, 1
|
2013-10-15 06:09:01 -07:00
|
|
|
jne L112
|
2019-06-22 04:56:53 -07:00
|
|
|
mov eax, [esp+8]
|
|
|
|
Load_exception_pointer ebx, esp
|
|
|
|
Pop_exception_pointer ebx
|
2010-01-22 04:48:24 -08:00
|
|
|
ret
|
2013-10-15 06:09:01 -07:00
|
|
|
L112:
|
2019-06-22 04:56:53 -07:00
|
|
|
mov esi, [esp+8] ; Save exception bucket in esi
|
|
|
|
Push_exception_pointer ebx ; arg 4: SP of handler
|
|
|
|
Push_bottom_of_stack ebx ; arg 3: SP of raise
|
|
|
|
Push_last_return_address ebx ; arg 2: PC of raise
|
2007-01-29 04:11:18 -08:00
|
|
|
push esi ; arg 1: exception bucket
|
|
|
|
call _caml_stash_backtrace
|
|
|
|
mov eax, esi ; recover exception bucket
|
2019-06-22 04:56:53 -07:00
|
|
|
Load_exception_pointer ebx, esp ; cut the stack
|
|
|
|
Pop_exception_pointer ebx
|
2007-01-29 04:11:18 -08:00
|
|
|
ret
|
1997-03-17 02:17:32 -08:00
|
|
|
|
2012-02-10 08:15:24 -08:00
|
|
|
; Callback from C to OCaml
|
1997-03-17 02:17:32 -08:00
|
|
|
|
2019-06-22 04:56:53 -07:00
|
|
|
PUBLIC _caml_callback_asm
|
1997-03-17 02:17:32 -08:00
|
|
|
ALIGN 4
|
2019-06-22 04:56:53 -07:00
|
|
|
_caml_callback_asm:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Save callee-save registers
|
2012-07-30 11:04:46 -07:00
|
|
|
push ebx
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
push ebp
|
2010-01-22 04:48:24 -08:00
|
|
|
; Initial loading of arguments
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ebx, [esp+24] ; arg2: closure
|
|
|
|
mov edi, [esp+28] ; arguments array
|
|
|
|
mov eax, [edi] ; arg1: argument
|
2012-07-30 11:04:46 -07:00
|
|
|
mov esi, [ebx] ; code pointer
|
1997-03-17 02:17:32 -08:00
|
|
|
jmp L106
|
|
|
|
|
2019-06-22 04:56:53 -07:00
|
|
|
PUBLIC _caml_callback2_asm
|
1996-02-21 02:49:46 -08:00
|
|
|
ALIGN 4
|
2019-06-22 04:56:53 -07:00
|
|
|
_caml_callback2_asm:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Save callee-save registers
|
2012-07-30 11:04:46 -07:00
|
|
|
push ebx
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
push ebp
|
2010-01-22 04:48:24 -08:00
|
|
|
; Initial loading of arguments
|
2019-06-22 04:56:53 -07:00
|
|
|
mov ecx, [esp+24] ; arg3: closure
|
|
|
|
mov edi, [esp+28] ; arguments array
|
|
|
|
mov eax, [edi] ; arg1: first argument
|
|
|
|
mov ebx, [edi+4] ; arg2: second argument
|
2012-07-30 11:04:46 -07:00
|
|
|
mov esi, offset _caml_apply2 ; code pointer
|
|
|
|
jmp L106
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2019-06-22 04:56:53 -07:00
|
|
|
PUBLIC _caml_callback3_asm
|
2012-07-30 11:04:46 -07:00
|
|
|
ALIGN 4
|
2019-06-22 04:56:53 -07:00
|
|
|
_caml_callback3_asm:
|
2010-01-22 04:48:24 -08:00
|
|
|
; Save callee-save registers
|
2012-07-30 11:04:46 -07:00
|
|
|
push ebx
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
push ebp
|
2010-01-22 04:48:24 -08:00
|
|
|
; Initial loading of arguments
|
2019-06-22 04:56:53 -07:00
|
|
|
mov edx, [esp+24] ; arg4: closure
|
|
|
|
mov edi, [esp+28] ; arguments array
|
|
|
|
mov eax, [edi] ; arg1: first argument
|
|
|
|
mov ebx, [edi+4] ; arg2: second argument
|
|
|
|
mov ecx, [edi+8] ; arg3: third argument
|
2012-07-30 11:04:46 -07:00
|
|
|
mov esi, offset _caml_apply3 ; code pointer
|
|
|
|
jmp L106
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2004-05-04 02:02:47 -07:00
|
|
|
PUBLIC _caml_ml_array_bound_error
|
2003-06-30 08:39:39 -07:00
|
|
|
ALIGN 4
|
2004-05-04 02:02:47 -07:00
|
|
|
_caml_ml_array_bound_error:
|
2003-06-30 08:39:39 -07:00
|
|
|
; Empty the floating-point stack
|
|
|
|
ffree st(0)
|
|
|
|
ffree st(1)
|
|
|
|
ffree st(2)
|
|
|
|
ffree st(3)
|
|
|
|
ffree st(4)
|
|
|
|
ffree st(5)
|
|
|
|
ffree st(6)
|
|
|
|
ffree st(7)
|
2007-01-29 04:11:18 -08:00
|
|
|
; Branch to caml_array_bound_error
|
|
|
|
mov eax, offset _caml_array_bound_error
|
|
|
|
jmp _caml_c_call
|
2003-06-30 08:39:39 -07:00
|
|
|
|
2020-06-15 05:17:42 -07:00
|
|
|
PUBLIC _caml_system__code_end
|
|
|
|
_caml_system__code_end:
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
.DATA
|
2004-05-04 02:02:47 -07:00
|
|
|
PUBLIC _caml_system__frametable
|
|
|
|
_caml_system__frametable LABEL DWORD
|
2010-01-22 04:48:24 -08:00
|
|
|
DWORD 1 ; one descriptor
|
|
|
|
DWORD L107 ; return address into callback
|
|
|
|
WORD -1 ; negative frame size => use callback link
|
|
|
|
WORD 0 ; no roots here
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2004-08-12 07:29:25 -07:00
|
|
|
PUBLIC _caml_extra_params
|
|
|
|
_caml_extra_params LABEL DWORD
|
|
|
|
BYTE 64 DUP (?)
|
2005-10-12 05:56:53 -07:00
|
|
|
|
|
|
|
END
|