Commit Graph

20269 Commits (e4bf109d1e7f64aa21a3edc00af4036c029604a6)

Author SHA1 Message Date
Nicolás Ojeda Bär a8cd077083 check-typo 2020-06-08 11:17:22 +02:00
Gabriel Scherer e717512a54
Merge pull request #9514 from gasche/parmatch-exhaust-singlecol-optim-trunk
Parmatch.exhaust: single-row optimization
2020-06-08 10:14:20 +02:00
Gabriel Scherer 28d8217130
Merge pull request #9638 from hannesm/runtime-stack-limit
documentation: clarify that l=x only affects byte-code runtime
2020-06-08 10:08:36 +02:00
octachron 8875357638 review and change entry for #9618 2020-06-08 08:59:01 +02:00
octachron 99f0910081 format: document structural box quirk 2020-06-08 08:58:25 +02:00
octachron b6ba1823c0 format: comment max indent induced line splits 2020-06-08 08:47:39 +02:00
octachron 982d4a378e Format: margin documentation precision 2020-06-08 08:47:39 +02:00
Xavier Leroy de21dafe28 Upgrade the "stale" script to v3 2020-06-08 08:45:39 +02:00
Gabriel Scherer 68a3c8eef9 matching: [minor] refactor the local control flow of the Unused exception 2020-06-07 16:27:16 +02:00
Gabriel Scherer a3b66f1b32 Parmatch.exhaust: single-row optimization
(See testsuite and code comments for an explanation.)
2020-06-07 08:03:57 +02:00
Gabriel Scherer 06cabea1df
Merge pull request #9608 from trefis/rematch-flattening
pattern-matching refactoring: clarify usage of the Cannot_flatten exception
2020-06-06 21:58:33 +02:00
Gabriel Scherer f8bf8c3f6e Changes 2020-06-06 18:46:34 +02:00
Thomas Refis ddf93aa22c matching: try => match with exception
This makes it clearer where the exception comes from.
2020-06-06 18:46:34 +02:00
Thomas Refis e17f81511c matching: flatten_simple_pattern does not raise 2020-06-06 18:46:34 +02:00
Thomas Refis f491929b3b matching: push simple types to flatten_pattern
Unfortunately since the function is exposed and used in translcore we
need to keep the generic one, and introduce a flatten_simple_pattern.
2020-06-06 18:46:34 +02:00
Thomas Refis 30bb39d7d8 matching: add a test for do_for_multiple_match flattening failure
Note: this is due to mk_alpha_env raising Cannot_flatten during
splitting/precompilation.
2020-06-06 18:46:34 +02:00
David Allsopp 467facbfed
Merge pull request #9587 from gasche/Arg.Rest_list
Stdlib.Arg: a new Rest_all spec, similar to Rest, that passes all arguments at once
2020-06-06 16:15:32 +01:00
David Allsopp d192a2c284 Eliminate MKEXE_ANSI from build system 2020-06-06 13:36:15 +01:00
David Allsopp da943eac54 Share generation code between ocamltest and utils
ocamltest/ocamltest_config.ml now generated using same make macros as
utils/config.ml.
2020-06-06 13:36:00 +01:00
Thomas Refis 2f57af2c40 matching: argo => arg_id 2020-06-05 23:07:16 +02:00
Gabriel Scherer 63eb3dad0d Arg: a new Rest_all spec, similar to Rest, that passes all arguments at once
In particular this allow to detect a Rest_all keyword followed by no
arguments at all (an empty list).
2020-06-05 22:06:21 +02:00
Gabriel Scherer 357d624992
Merge pull request #9642 from garrigue/fix9640
Fix #9640: regression introduced by #9623
2020-06-05 21:10:55 +02:00
Xavier Leroy 4aa90e9784
Limit the number of parameters for an uncurried or untupled function (#9620)
This commit introduces a quantity Lambda.max_arity that is the maximal
number of parameters that a Lambda function can have.

Uncurrying is throttled so that, for example, assuming the limit is 10,
a 15-argument curried function fun x1 ... x15 -> e
becomes a 10-argument function (x1...x10) that returns a 5-argument
function (x11...x15).

Concerning untupling, a function that takes a N-tuple of arguments,
where N is above the limit, remains a function that takes a single
argument that is a tuple.

Currently, max_arity is set to 126 in native-code, to match the new
representation of closures implemented by #9619.  A signed 8-bit field
is used to store the arity.  126 instead of 127 to account for the
extra "environment" argument.

In bytecode the limit is infinity (max_int) because there are no needs
yet for a limit on the number of parameters.
2020-06-05 18:45:38 +02:00
Xavier Leroy 9d4679f338
Merge pull request #9619 from xavierleroy/new-closure-repr
A self-describing representation for function closures, supporting "no naked pointers" mode and the future needs of Multicore OCaml.
2020-06-05 18:26:45 +02:00
Jacques Garrigue 83ae23d249 comment for module alias + factorize with_type/with_typesubst 2020-06-05 18:17:20 +02:00
David Allsopp d0051d0092
Fix tools/check-typo for mawk 1.3.4 (#9644)
Closes: #9643
2020-06-05 18:13:40 +02:00
Xavier Leroy 59da2292b1 Changes entry for #9619 2020-06-05 17:52:42 +02:00
Xavier Leroy 85f5006fd0 No need to special-case zero-sized blocks in no-naked-pointers mode
Now that atoms have black headers, all zero-sized blocks (atoms or
ocamlopt-generated static data) have black headers and will not
be traversed or changed by the major GC.
2020-06-05 17:51:54 +02:00
Xavier Leroy 121dbb90f4 Give preallocated atoms the GC color Black
Atoms are zero-sized blocks allocated outside the heap.
It simplifies the GC in no-naked-pointers mode if their headers
have GC color Black, meaning "don't traverse".
In ocamlopt, Black is already used as the color for constant blocks
statically allocated outside the heap.
2020-06-05 17:51:54 +02:00
Xavier Leroy 843ec6227a During major GC, scan the environment part of closures only
Here we start reaping the benefits of the new closure representation.

The fields of a closure block that contain the code pointers need not
be scanned (in general) and must not be scanned (in no-naked-pointers mode).

Here, conservatively, we skip them in no-naked-pointers mode only,
but it would be sound to skip them unconditionally.
2020-06-05 17:51:47 +02:00
Xavier Leroy e57785524b Restrict 'test_locations' to 64-bit archs and update expected outputs
Expected outputs contain integer values for the "closure info"
field of some closures.  These values differ in 32 and 64 bits,
since the arity is stored in top 8 bits.  This test would need
different expected outputs for 32- and 64-bit platforms.

To keep things simple, this commit restricts the test
to only run on 64-bit platforms.  Since this changes the locations
2020-06-05 17:48:19 +02:00
Xavier Leroy 7f5a137972 New representation of closures, native-code compilation
In code that builds closures, instead of the old arity field,
produce a closure information field encoding arity + position of environment.
2020-06-05 17:46:58 +02:00
Xavier Leroy a1f21661a4 New representation of closures, intermediate bootstrap
ocamlc's computations of offsets in closures changed to match changes in the
abstract machine.
2020-06-05 17:44:49 +02:00
Xavier Leroy 9e128577a4 New representation of closures, bytecode part
Add a "closure information" field after each code pointer in
a closure.  This field generalizes the "arity" field used by
the native-code compiler, in that it has room both for an arity
(always 0 in bytecode) and for the distance from the closure
to the first environment variable in the closure block.

This makes closures "self-described" and easy to scan for pointers:
everything up to the first env var is out-of-heap code pointers or
integers; everything after the first env var is a well-formed value.

At this point a bootstrap is needed.
2020-06-05 17:42:08 +02:00
Jacques Garrigue 9dc7df741b factorize in merge_constraint 2020-06-05 17:41:06 +02:00
Jacques Garrigue b2b9fc3d9a add example 2020-06-05 15:05:48 +02:00
Jacques Garrigue 6a47e31dcb update PR number 2020-06-05 15:00:08 +02:00
Jacques Garrigue a96a610a95 Fix #9640: regression introduced by #9623 2020-06-05 14:56:51 +02:00
Florian Angeletti ae5eb6b471
Merge pull request #9610 from xavierleroy/manual-intf-c
FFI documentation: naked pointers are obsolete
2020-06-05 07:57:52 +02:00
octachron 635cc46dc4 Change entry for #9610 2020-06-05 07:55:52 +02:00
Nicolás Ojeda Bär b7656007a8 Changes 2020-06-05 07:48:17 +02:00
Nicolás Ojeda Bär d8d38752f9 Adapt tests 2020-06-05 07:40:17 +02:00
Nicolás Ojeda Bär 6ff2c11b25 ocamltest: do not overwrite user-defined variables 2020-06-05 07:40:17 +02:00
Gabriel Scherer a8a2a7b757
Merge pull request #9634 from nojb/ocamlrunparam_comma_fix
Allow ',' at the start of OCAMLRUNPARAM
2020-06-05 07:12:40 +02:00
Nicolás Ojeda Bär c4eea2ed90 Manual 2020-06-04 22:31:25 +02:00
Hannes Mehnert f57837e002 documentation: clarify that l=x only affects byte-code runtime 2020-06-04 21:23:55 +02:00
Sébastien Hinderer e32c1b2e8e Inria CI: also test LibBFD support on FreeBSD 2020-06-04 19:13:35 +02:00
Gabriel Scherer 42b64a7dc7 minor Changes fix 2020-06-04 18:38:05 +02:00
Xavier Leroy bea823a1ea Reword what will happen with pointers outside the heap
Following review comments.

Also: fix the assertion in the third val_of_typtr function.
2020-06-04 18:24:44 +02:00
Xavier Leroy a22f6f5f03 Document alternate encodings for out-of-heap pointers 2020-06-04 18:24:44 +02:00