Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
1d27025
add explanation for variance flags
garrigue May 25, 2020
e0524b5
fix number and add examples for #6744
garrigue May 27, 2020
75c9cd3
Add --enable-warn-error
dra27 Jun 1, 2020
9f9d806
Rename $gcc_warnings to $cc_warnings in configure
dra27 Jun 1, 2020
fd1bb25
More partial application warnings
stedolan May 13, 2020
fd8188b
Merge pull request #9560 from stedolan/more-partial
gasche Jun 2, 2020
ee20f5e
Fix the polymorphic recursion problem of #9603 (#9617)
garrigue Jun 2, 2020
836d624
Fix load path ordering (#9611)
nojb Jun 2, 2020
ca64723
s/@raises/@raise
dra27 Jun 3, 2020
45248a7
add a testcase for 'with type <lhs> = <rhs>' scoping
gasche Jun 2, 2020
7068266
Typemod.merge_constraint: be careful about the typing environments
gasche Jun 2, 2020
8b2f64c
Typemod.merge_constraint: fix computation of the signature environment
gasche Jun 2, 2020
b280e17
fix typo in #9569
hhugo Jun 3, 2020
13a081b
Fix #7741: Failure to report escaping type variable (#9545)
garrigue Jun 3, 2020
97c3be2
add PR number for #7741
garrigue Jun 3, 2020
abb8db4
Fix #7520: Odd behaviour of refutation cases with polymorphic variant…
garrigue Jun 3, 2020
c0440d8
Allow ',' at the start of OCAMLRUNPARAM
nojb Jun 4, 2020
9ea385d
Changes
nojb Jun 4, 2020
84c87bb
Merge pull request #9623 from gasche/unboxed-merge-constraint
gasche Jun 4, 2020
9773de8
Merge pull request #9629 from hhugo/patch-3
gasche Jun 4, 2020
608d166
FFI documentation: naked pointers are obsolete
xavierleroy May 27, 2020
a22f6f5
Document alternate encodings for out-of-heap pointers
xavierleroy May 29, 2020
bea823a
Reword what will happen with pointers outside the heap
xavierleroy Jun 4, 2020
42b64a7
minor Changes fix
gasche Jun 4, 2020
e32c1b2
Inria CI: also test LibBFD support on FreeBSD
shindere Jun 4, 2020
f57837e
documentation: clarify that l=x only affects byte-code runtime
hannesm Jun 4, 2020
c4eea2e
Manual
nojb Jun 4, 2020
a8a2a7b
Merge pull request #9634 from nojb/ocamlrunparam_comma_fix
gasche Jun 5, 2020
6ff2c11
ocamltest: do not overwrite user-defined variables
nojb Jun 4, 2020
d8d3875
Adapt tests
nojb Jun 4, 2020
b765600
Changes
nojb Jun 5, 2020
635cc46
Change entry for #9610
Octachron Jun 4, 2020
ae5eb6b
Merge pull request #9610 from xavierleroy/manual-intf-c
Octachron Jun 5, 2020
a96a610
Fix #9640: regression introduced by #9623
garrigue Jun 5, 2020
6a47e31
update PR number
garrigue Jun 5, 2020
b2b9fc3
add example
garrigue Jun 5, 2020
9dc7df7
factorize in merge_constraint
garrigue Jun 5, 2020
9e12857
New representation of closures, bytecode part
xavierleroy May 29, 2020
a1f2166
New representation of closures, intermediate bootstrap
xavierleroy Jun 5, 2020
7f5a137
New representation of closures, native-code compilation
xavierleroy Jun 5, 2020
e577855
Restrict 'test_locations' to 64-bit archs and update expected outputs
xavierleroy Jun 5, 2020
843ec62
During major GC, scan the environment part of closures only
xavierleroy Jun 5, 2020
121dbb9
Give preallocated atoms the GC color Black
xavierleroy May 29, 2020
85f5006
No need to special-case zero-sized blocks in no-naked-pointers mode
xavierleroy May 29, 2020
59da229
Changes entry for #9619
xavierleroy Jun 5, 2020
d0051d0
Fix tools/check-typo for mawk 1.3.4 (#9644)
dra27 Jun 5, 2020
83ae23d
comment for module alias + factorize with_type/with_typesubst
garrigue Jun 5, 2020
9d4679f
Merge pull request #9619 from xavierleroy/new-closure-repr
xavierleroy Jun 5, 2020
4aa90e9
Limit the number of parameters for an uncurried or untupled function …
xavierleroy Jun 5, 2020
357d624
Merge pull request #9642 from garrigue/fix9640
gasche Jun 5, 2020
63eb3da
Arg: a new Rest_all spec, similar to Rest, that passes all arguments …
gasche May 20, 2020
2f57af2
matching: argo => arg_id
trefis Feb 19, 2020
da943ea
Share generation code between ocamltest and utils
dra27 Feb 5, 2020
d192a2c
Eliminate MKEXE_ANSI from build system
dra27 Feb 5, 2020
467facb
Merge pull request #9587 from gasche/Arg.Rest_list
dra27 Jun 6, 2020
30bb39d
matching: add a test for do_for_multiple_match flattening failure
trefis Jun 20, 2019
f491929
matching: push simple types to flatten_pattern
trefis Feb 20, 2020
e17f815
matching: flatten_simple_pattern does not raise
trefis Feb 20, 2020
ddf93aa
matching: try => match with exception
trefis Feb 20, 2020
f8bf8c3
Changes
gasche May 30, 2020
06cabea
Merge pull request #9608 from trefis/rematch-flattening
gasche Jun 6, 2020
a3b66f1
Parmatch.exhaust: single-row optimization
gasche Apr 29, 2020
68a3c8e
matching: [minor] refactor the local control flow of the Unused excep…
gasche Jun 6, 2020
de21daf
Upgrade the "stale" script to v3
xavierleroy Jun 8, 2020
982d4a3
Format: margin documentation precision
Octachron May 29, 2020
b6ba182
format: comment max indent induced line splits
Octachron May 29, 2020
99f0910
format: document structural box quirk
Octachron May 29, 2020
8875357
review and change entry for #9618
Octachron May 29, 2020
28d8217
Merge pull request #9638 from hannesm/runtime-stack-limit
gasche Jun 8, 2020
e717512
Merge pull request #9514 from gasche/parmatch-exhaust-singlecol-optim…
gasche Jun 8, 2020
a8cd077
check-typo
nojb Jun 8, 2020
990bc3c
Merge pull request #9633 from nojb/ocamltest_env_fix
nojb Jun 8, 2020
9a5f3b1
Add skip lists as a reusable data structure
xavierleroy May 30, 2020
40824de
Use the skip list library for global GC root management
xavierleroy May 30, 2020
8fd7894
Use the skip list library to manage overwritten instructions in the d…
xavierleroy May 30, 2020
4ce3b7c
Add Changes for #9635
xavierleroy Jun 7, 2020
c61fc39
Merge pull request #9635 from xavierleroy/skiplists
xavierleroy Jun 8, 2020
792deb1
[minor] printlambda: print the 'tailcall' attribute in the same style…
gasche Apr 11, 2020
d260a79
[refactoring] gives tailcall attributes a more standard structure
gasche Apr 12, 2020
d8f3273
Merge pull request #9285 from dra27/simplify-mkexe
shindere Jun 8, 2020
2e4d1ec
Remove two oldish scripts (#9656)
shindere Jun 9, 2020
433485b
ocamldoc: remove debugging facility
shindere Jun 9, 2020
a1e3b96
Merge pull request #9618 from Octachron/format_documentation_precision
Octachron Jun 9, 2020
56f7500
Merge pull request #9646 from gasche/rematch-simplify-unused
gasche Jun 10, 2020
b7509ca
Merge pull request #9442 from gasche/tailcall-attribute-refactoring
gasche Jun 10, 2020
325a0ff
Merge pull request #9661 from shindere/ocamldoc-remove-debug-support
shindere Jun 10, 2020
2f38a52
Merge pull request #9625 from dra27/warn-error
dra27 Jun 10, 2020
6ea0fbd
Merge pull request #9602 from garrigue/document-variance-flags
gasche Jun 10, 2020
c241985
Merge pull request #9612 from garrigue/pr6744ex
gasche Jun 10, 2020
7aad86f
Memprof: disable sampling when memprof is suspended. (#9628)
jhjourdan Jun 10, 2020
5946b93
Refactor skiplist to avoid UB casts (#9660)
stedolan Jun 10, 2020
b94a377
Remove temporary installation hacks (#9659)
shindere Jun 10, 2020
08e58c8
More efficient management of code fragments (#9654)
xavierleroy Jun 11, 2020
accfbb5
Removed last commit
Anukriti12 Jun 22, 2020
642d854
made try_depth a labeled argument
Anukriti12 Jun 22, 2020
da8a728
changes with tests_to_skip
Anukriti12 Jun 22, 2020
d880e52
Removal of try_depth from linearize.ml
Anukriti12 Jun 22, 2020
c812d15
removed exit_label ref
Anukriti12 Jun 24, 2020
9d7a4c5
removed long lines
Anukriti12 Jun 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -3270,6 +3270,7 @@ lambda/lambda.cmo : \
typing/ident.cmi \
typing/env.cmi \
lambda/debuginfo.cmi \
utils/clflags.cmi \
parsing/asttypes.cmi \
lambda/lambda.cmi
lambda/lambda.cmx : \
Expand All @@ -3281,6 +3282,7 @@ lambda/lambda.cmx : \
typing/ident.cmx \
typing/env.cmx \
lambda/debuginfo.cmx \
utils/clflags.cmx \
parsing/asttypes.cmi \
lambda/lambda.cmi
lambda/lambda.cmi : \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v2
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.'
Expand Down
80 changes: 73 additions & 7 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ Working version

### Language features:

- #9570: Provide an Atomic module with a trivial purely-sequential
implementation, to help write code that is compatible with Multicore
OCaml.
(Gabriel Scherer, review by Xavier Leroy)

### Runtime system:

- #1795, #9543: modernize signal handling on Linux i386, PowerPC, and s390x,
Expand All @@ -17,6 +12,9 @@ Working version
- #9466: Memprof: optimize random samples generation.
(Jacques-Henri Jourdan review by Xavier Leroy and Stephen Dolan)

- #9628: Memprof: disable sampling when memprof is suspended.
(Jacques-Henri Jourdan review by Gabriel Scherer and Stephen Dolan)

- #9508: Remove support for FreeBSD prior to 4.0R, that required explicit
floating-point initialization to behave like IEEE standard
(Hannes Mehnert, review by David Allsopp)
Expand All @@ -35,11 +33,28 @@ Working version
(Nicolás Ojeda Bär, review by Stephen Dolan, Gabriel Scherer, Mark Shinwell,
and Xavier Leroy)

- #9619: Change representation of function closures so that code pointers
can be easily distinguished from environment variables
(Xavier Leroy, review by Mark Shinwell and Damien Doligez)

- #9634: Allow initial and repeated commas in `OCAMLRUNPARAM`.
(Nicolás Ojeda Bär, review by Gabriel Scherer)

- #9654: More efficient management of code fragments.
(Xavier Leroy, review by Jacques-Henri Jourdan, Damien Doligez, and
Stephen Dolan)


### Code generation and optimizations:

- #9441: Add RISC-V RV64G native-code backend.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)

- #9620: Limit the number of parameters for an uncurried or untupled
function. Functions with more parameters than that are left
partially curried or tupled.
(Xavier Leroy, review by Mark Shinwell)

### Standard library:

* #9554: add primitive __FUNCTION__ that returns the name of the current method
Expand All @@ -52,9 +67,19 @@ Working version
- #9561: Unbox Unix.gettimeofday and Unix.time
(Stephen Dolan, review by David Allsopp)

- #9570: Provide an Atomic module with a trivial purely-sequential
implementation, to help write code that is compatible with Multicore
OCaml.
(Gabriel Scherer, review by Xavier Leroy)

- #9571: Make at_exit and Printexc.register_printer thread-safe.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer and Xavier Leroy)

- #9587: Arg: new Rest_all spec to get all rest arguments in a list
(this is similar to Rest, but makes it possible to detect when there
are no arguments (an empty list) after the rest marker)
(Gabriel Scherer, review by Nicolás Ojeda Bär and David Allsopp)

### Other libraries:

* #9206, #9419: update documentation of the threads library;
Expand All @@ -80,12 +105,20 @@ Working version

### Tools:

- #9606, #9635, #9637: fix performance regression in the debugger
(behaviors quadratic in the size of the debugged program)
(Xavier Leroy, report by Jacques Garrigue and Virgile Prevosto,
review by David Allsopp and Jacques-Henri Jourdan)

### Manual and documentation:


### Compiler user-interface and warnings:

- #9560: Report partial application warnings on type errors in applications.
(Stephen Dolan, report and testcase by whitequark, review by Gabriel Scherer
and Thomas Refis)

- #9583: when bytecode linking fails due to an unavailable module, the module
that requires it is now included in the error message.
(Nicolás Ojeda Bär, review by Vincent Laviron)
Expand All @@ -98,7 +131,7 @@ Working version

### Internal/compiler-libs changes:

- #9493, #9520, #9563, #9599: refactor the pattern-matching compiler
- #9493, #9520, #9563, #9599, #9608: refactor the pattern-matching compiler
(Thomas Refis and Gabriel Scherer, review by Florian Angeletti)

- #9604: refactoring of the ocamltest codebase.
Expand All @@ -110,6 +143,13 @@ Working version
(Gabriel Scherer, review by Luc Maranget, Thomas Refis and Florian Angeletti,
report by Alex Fedoseev through Hongbo Zhang)

- #9514: optimize pattern-matching exhaustivity analysis in the single-row case
(Gabriel Scherer, review by Stephen DOlan)

- #9442: refactor the implementation of the [@tailcall] attribute
to allow for a structured attribute payload
(Gabriel Scherer, review by Vladimir Keleshev and Nicolás Ojeda Bär)

### Build system:

- #9332, #9518, #9529: Cease storing C dependencies in the codebase. C
Expand All @@ -128,6 +168,14 @@ Working version
(Gabriel Scherer and Jeremy Yallop and Xavier Leroy,
report by Twitter user @st_toHKR through Jun Furuse)

- #9611: maintain order of load path entries in various situations: when passing
them to system linker, ppx contexts, etc.
(Nicolás Ojeda Bär, review by Jérémie Dimino and Gabriel Scherer)

- #9633: ocamltest: fix a bug when certain variables set in test scripts would
be ignored (eg `ocamlrunparam`).
(Nicolás Ojeda Bär, review by Sébastien Hinderer)

OCaml 4.11
----------

Expand All @@ -140,7 +188,7 @@ OCaml 4.11
(Gabriel Radanne, Leo White, Gabriel Scherer and Pieter Goetschalckx,
request by Bikal Lem)

- #6673, #1132: Relax the handling of explicit polymorphic types
- #6673, #1132, #9617: Relax the handling of explicit polymorphic types
(Leo White, review by Jacques Garrigue and Gabriel Scherer)

- #9232: allow any class type paths in #-types,
Expand Down Expand Up @@ -398,6 +446,14 @@ OCaml 4.11
- #7708, #9580: Ensure Stdlib documentation index refers to Stdlib.
(Stephen Dolan, review by Florian Angeletti, report by Hannes Mehnert)

- #9610: manual, C FFI: naked pointers are deprecated, detail the
forward-compatible options for handling out-of-heap pointers.
(Xavier Leroy, review by Mark Shinwell, David Allsopp and Florian Angeletti)

- #9618: clarify the Format documentation on the margin and maximum indentation
limit
(Florian Angeletti, review by Josh Berdine)

### Compiler user-interface and warnings:

- GPR#1664: make -output-complete-obj link the runtime native c libraries when
Expand Down Expand Up @@ -513,6 +569,9 @@ OCaml 4.11

### Bug fixes:

- #7520, #9547: Odd behaviour of refutation cases with polymorphic variants
(Jacques Garrigue, report by Leo White, reviews by Gabriel Scherer and Leo)

- #7562, #9456: ocamlopt-generated code crashed on Alpine Linux on
ppc64le, arm, and i386. Fixed by turning PIE off for musl-based Linux
systems except amd64 (x86_64) and s390x.
Expand All @@ -525,6 +584,9 @@ OCaml 4.11
- #7696, #6608: Record expression deleted when all fields specified
(Jacques Garrigue, report by Jeremy Yallop)

- #7741, #9645: Failure to report escaping type variable
(Jacques Garrigue, report by Gabriel Radanne, review by Gabriel Scherer)

- #7817, #9546: Unsound inclusion check for polymorphic variant
(Jacques Garrigue, report by Mikhail Mandrykin, review by Gabriel Scherer)

Expand Down Expand Up @@ -597,6 +659,10 @@ OCaml 4.11
on Power and Z System
(Xavier Leroy, review by Nicolás Ojeda Bär)

- #9623, #9642: fix typing environments in Typedecl.transl_with_constraint
(Gabriel Scherer, review by Jacques Garrigue and Leo White,
report by Hugo Heuzard)

OCaml 4.10 maintenance branch
-----------------------------

Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ endif
for i in $(OTHERLIBRARIES); do \
$(MAKE) -C otherlibs/$$i install || exit $$?; \
done
# Transitional: findlib 1.7.3 is confused if leftover num.cm? files remain
# from an previous installation of OCaml before otherlibs/num was removed.
rm -f "$(INSTALL_LIBDIR)"/num.cm?
# End transitional
ifneq "$(WITH_OCAMLDOC)" ""
$(MAKE) -C ocamldoc install
endif
Expand Down
22 changes: 22 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,28 @@ endif
# By default, request ocamllex to be quiet
OCAMLLEX_FLAGS ?= -q

# Escape special characters in the argument string.
# There are four characters that need escaping:
# - backslash and ampersand, which are special in the replacement text
# of sed's "s" command
# - exclamation mark, which is the delimiter we use for sed's "s" command
# - single quote, which interferes with shell quoting. We are inside
# single quotes already, so the proper escape is '\''
# (close single quotation, insert single quote character,
# reopen single quotation).
SED_ESCAPE=$(subst ','\'',$(subst !,\!,$(subst &,\&,$(subst \,\\,$1))))

# Escape special characters in an OCaml string literal "..."
# There are two: backslash and double quote.
OCAML_ESCAPE=$(subst ",\",$(subst \,\\,$1))

# SUBST generates the sed substitution for the variable *named* in $1
SUBST=-e 's!%%$1%%!$(call SED_ESCAPE,$($1))!'

# SUBST_STRING does the same, for a variable that occurs between "..."
# in config.mlp. Thus, backslashes and double quotes must be escaped.
SUBST_STRING=-e 's!%%$1%%!$(call SED_ESCAPE,$(call OCAML_ESCAPE,$($1)))!'

# The rule to compile C files

# This rule is similar to GNU make's implicit rule, except that it is more
Expand Down
1 change: 0 additions & 1 deletion Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ ifeq "$(UNIX_OR_WIN32)" "win32"
SORT=/usr/bin/sort
SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
FLEXLINK_CMD=flexlink
MKEXE_ANSI=$(FLEXLINK) -exe
FLEXDLL_CHAIN=@flexdll_chain@
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
Expand Down
32 changes: 24 additions & 8 deletions asmcomp/cmm_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,22 @@ let caml_nativeint_ops = "caml_nativeint_ops"
let caml_int32_ops = "caml_int32_ops"
let caml_int64_ops = "caml_int64_ops"

let pos_arity_in_closinfo = 8 * size_addr - 8
(* arity = the top 8 bits of the closinfo word *)

let closure_info ~arity ~startenv =
assert (-128 <= arity && arity <= 127);
assert (0 <= startenv && startenv < 1 lsl (pos_arity_in_closinfo - 1));
Nativeint.(add (shift_left (of_int arity) pos_arity_in_closinfo)
(add (shift_left (of_int startenv) 1)
1n))

let alloc_float_header dbg = Cblockheader (float_header, dbg)
let alloc_floatarray_header len dbg = Cblockheader (floatarray_header len, dbg)
let alloc_closure_header sz dbg = Cblockheader (white_closure_header sz, dbg)
let alloc_infix_header ofs dbg = Cblockheader (infix_header ofs, dbg)
let alloc_closure_info ~arity ~startenv dbg =
Cblockheader (closure_info ~arity ~startenv, dbg)
let alloc_boxedint32_header dbg = Cblockheader (boxedint32_header, dbg)
let alloc_boxedint64_header dbg = Cblockheader (boxedint64_header, dbg)
let alloc_boxedintnat_header dbg = Cblockheader (boxedintnat_header, dbg)
Expand Down Expand Up @@ -1799,8 +1810,10 @@ let apply_function_body arity =
(args, clos,
if arity = 1 then app_fun clos 0 else
Cifthenelse(
Cop(Ccmpi Ceq, [get_field_gen Asttypes.Mutable (Cvar clos) 1 (dbg ());
int_const (dbg ()) arity], dbg ()),
Cop(Ccmpi Ceq, [Cop(Casr,
[get_field_gen Asttypes.Mutable (Cvar clos) 1 (dbg());
Cconst_int(pos_arity_in_closinfo, dbg())], dbg());
Cconst_int(arity, dbg())], dbg()),
dbg (),
Cop(Capply typ_val,
get_field_gen Asttypes.Mutable (Cvar clos) 2 (dbg ())
Expand Down Expand Up @@ -1987,7 +2000,8 @@ let rec intermediate_curry_functions arity num =
Cop(Calloc,
[alloc_closure_header 5 (dbg ());
Cconst_symbol(name1 ^ "_" ^ Int.to_string (num+1), dbg ());
int_const (dbg ()) (arity - num - 1);
alloc_closure_info ~arity:(arity - num - 1)
~startenv:3 (dbg ());
Cconst_symbol(name1 ^ "_" ^ Int.to_string (num+1) ^ "_app",
dbg ());
Cvar arg; Cvar clos],
Expand All @@ -1996,7 +2010,8 @@ let rec intermediate_curry_functions arity num =
Cop(Calloc,
[alloc_closure_header 4 (dbg ());
Cconst_symbol(name1 ^ "_" ^ Int.to_string (num+1), dbg ());
int_const (dbg ()) 1; Cvar arg; Cvar clos],
alloc_closure_info ~arity:1 ~startenv:2 (dbg ());
Cvar arg; Cvar clos],
dbg ());
fun_codegen_options = [];
fun_dbg;
Expand Down Expand Up @@ -2713,20 +2728,21 @@ let emit_constant_closure ((_, global_symb) as symb) fundecls clos_vars cont =
assert (clos_vars = []);
cdefine_symbol symb @ clos_vars @ cont
| f1 :: remainder ->
let startenv = fundecls_size fundecls in
let rec emit_others pos = function
[] -> clos_vars @ cont
| (f2 : Clambda.ufunction) :: rem ->
if f2.arity = 1 || f2.arity = 0 then
Cint(infix_header pos) ::
(closure_symbol f2) @
Csymbol_address f2.label ::
cint_const f2.arity ::
Cint(closure_info ~arity:f2.arity ~startenv:(startenv - pos)) ::
emit_others (pos + 3) rem
else
Cint(infix_header pos) ::
(closure_symbol f2) @
Csymbol_address(curry_function_sym f2.arity) ::
cint_const f2.arity ::
Cint(closure_info ~arity:f2.arity ~startenv:(startenv - pos)) ::
Csymbol_address f2.label ::
emit_others (pos + 4) rem in
Cint(black_closure_header (fundecls_size fundecls
Expand All @@ -2735,11 +2751,11 @@ let emit_constant_closure ((_, global_symb) as symb) fundecls clos_vars cont =
(closure_symbol f1) @
if f1.arity = 1 || f1.arity = 0 then
Csymbol_address f1.label ::
cint_const f1.arity ::
Cint(closure_info ~arity:f1.arity ~startenv) ::
emit_others 3 remainder
else
Csymbol_address(curry_function_sym f1.arity) ::
cint_const f1.arity ::
Cint(closure_info ~arity:f1.arity ~startenv) ::
Csymbol_address f1.label ::
emit_others 4 remainder

Expand Down
5 changes: 5 additions & 0 deletions asmcomp/cmm_helpers.mli
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ val boxedint32_header : nativeint
val boxedint64_header : nativeint
val boxedintnat_header : nativeint

(** Closure info for a closure of given arity and distance to environment *)
val closure_info : arity:int -> startenv:int -> nativeint

(** Wrappers *)
val alloc_float_header : Debuginfo.t -> expression
val alloc_floatarray_header : int -> Debuginfo.t -> expression
val alloc_closure_header : int -> Debuginfo.t -> expression
val alloc_infix_header : int -> Debuginfo.t -> expression
val alloc_closure_info :
arity:int -> startenv:int -> Debuginfo.t -> expression
val alloc_boxedint32_header : Debuginfo.t -> expression
val alloc_boxedint64_header : Debuginfo.t -> expression
val alloc_boxedintnat_header : Debuginfo.t -> expression
Expand Down
Loading