aboutsummaryrefslogtreecommitdiff
path: root/kernel/vmbytegen.ml
diff options
context:
space:
mode:
authorGuillaume Melquiond2021-03-25 12:03:40 +0100
committerGuillaume Melquiond2021-03-26 15:18:28 +0100
commitae819deb38c3a962e3badf020705c3d0c6c84e67 (patch)
treef269e1968fd1f6420b4dc459a5d6e30e6a1726d9 /kernel/vmbytegen.ml
parent6d7fdaf8484da81993958d339e411d8e3b1a38c1 (diff)
Make it more obvious when the calling convention of APPLY changes.
Despite their names, APPLY1 to APPLY4 are completely different from APPLY(n) with n = 1 to 4. Indeed, the latter assumes that the return address was already pushed on the stack, before the arguments were. On the other hand, APPLY1 to APPLY4 insert the return address in the middle of the already pushed arguments.
Diffstat (limited to 'kernel/vmbytegen.ml')
-rw-r--r--kernel/vmbytegen.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/vmbytegen.ml b/kernel/vmbytegen.ml
index 3dc268ccdf..9500b88e60 100644
--- a/kernel/vmbytegen.ml
+++ b/kernel/vmbytegen.ml
@@ -461,7 +461,7 @@ let comp_app comp_fun comp_arg cenv f args sz cont =
| None ->
if nargs <= 4 then
comp_args comp_arg cenv args sz
- (Kpush :: (comp_fun cenv f (sz+nargs) (Kapply nargs :: cont)))
+ (Kpush :: (comp_fun cenv f (sz+nargs) (Kshort_apply nargs :: cont)))
else
let lbl,cont1 = label_code cont in
Kpush_retaddr lbl ::
@@ -765,7 +765,7 @@ let rec compile_lam env cenv lam sz cont =
let (jump, cont) = make_branch cont in
let lbl_default = Label.create () in
let default =
- let cont = [Kgetglobal kn; Kapply (arity + Univ.Instance.length u); jump] in
+ let cont = [Kgetglobal kn; Kshort_apply (arity + Univ.Instance.length u); jump] in
let cont =
if Univ.Instance.is_empty u then cont
else comp_args compile_universe cenv (Univ.Instance.to_array u) (sz + arity) (Kpush::cont)