summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-07-30 14:27:32 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-07-30 14:27:32 +0000
commit009ab75bab667eda4bca95a64afa45c77e192bf0 (patch)
tree036d91b43f6e8a3863af862d0179d89d91c54bcc
parentd2ac820e41778f3cc6aef272ba2baed0b9f2dfff (diff)
Optimisation en espace de l'appel a caml_call_gc.
Reecriture de caml_c_call (plus rapide avec de la chance). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--asmrun/i386.asm24
1 files changed, 15 insertions, 9 deletions
diff --git a/asmrun/i386.asm b/asmrun/i386.asm
index 536ee45a6..f04b82ad1 100644
--- a/asmrun/i386.asm
+++ b/asmrun/i386.asm
@@ -28,7 +28,7 @@ _caml_alloc1:
jb L100
ret
L100: movl $8, %eax
- jmp _caml_call_gc
+ jmp L105
.align 4
_caml_alloc2:
@@ -39,7 +39,7 @@ _caml_alloc2:
jb L101
ret
L101: movl $12, %eax
- jmp _caml_call_gc
+ jmp L105
.align 4
_caml_alloc3:
@@ -50,7 +50,7 @@ _caml_alloc3:
jb L102
ret
L102: movl $16, %eax
- jmp _caml_call_gc
+ jmp L105
.align 4
_caml_alloc:
@@ -63,8 +63,15 @@ _caml_alloc:
addl $4, %esp
ret
L103: popl %eax
+ jmp L105
_caml_call_gc:
+ # Recover desired size and adjust return address
+ popl %eax
+ addl $2, %eax
+ pushl %eax
+ movzwl -2(%eax), %eax
+L105:
# Record lowest stack address and return address
popl _caml_last_return_address
movl %esp, _caml_bottom_of_stack
@@ -102,13 +109,12 @@ _caml_call_gc:
.align 4
_caml_c_call:
# Record lowest stack address and return address
- popl _caml_last_return_address
- movl %esp, _caml_bottom_of_stack
+ movl (%esp), %edx
+ movl %edx, _caml_last_return_address
+ leal 4(%esp), %edx
+ movl %edx, _caml_bottom_of_stack
# Call the function (address in %eax)
- call *%eax
- # Return to caller
- movl _caml_last_return_address, %edx # %edx dead here
- jmp *%edx
+ jmp *%eax
# Start the Caml program