Commit Graph

20993 Commits (master)

Author SHA1 Message Date
Leandro Ostera f4143fd372
Document Typedtree.implementation 2020-11-06 18:25:20 +01:00
Leandro Ostera a0b7aff645
Fix .depend file
No change entry needed
2020-11-06 09:24:34 +01:00
Leandro Ostera b91a90a4a7
Fix linting errors 2020-11-06 09:20:45 +01:00
Leandro Ostera 1b085d3840
Rename Typedtree.t to Typedtree.implementation 2020-11-05 21:19:44 +01:00
Leandro Ostera ee2f3b428c
Move typed_impl to Typedtree.t 2020-11-05 19:06:12 +01:00
Leandro Ostera 3be9e19c17
Fix dependency between Printtyped and Typemod 2020-11-05 18:49:28 +01:00
Leandro Ostera f6e428acf2
Introduce typed_impl record 2020-11-05 18:29:45 +01:00
Leandro Ostera 3a125b8c3c
Expose module signature when typing implementation
While working on a new backend for OCaml to generate Erlang sources, I
found the need to read the .cmi file back into a `Types.signature`
value.

@Drup spotted that I was reading the file and pointed out this value was
already being read during the type checking process.

A quick check at the `Typedtree.module_coercion` showed us that it would
be difficul to extract the same information that is readily available in
the signature value.

This change will expose the signature value directly, so other backends
relying on this signature information do not need to do the extra work
of reading it again.
2020-11-05 17:33:19 +01:00
Jacques Garrigue 9e181ca8f4 must use set_state rather than backtrack in Typecore.type_cases 2020-11-05 11:12:01 +09:00
Gabriel Scherer 479ec01e28
Merge pull request #10000 from gasche/9999
fix -dsource printing of the pattern (A as x | (B as x))
2020-11-04 09:07:50 +01:00
Gabriel Scherer 89d6a2094b change or-pattern printing to use spaces instead of cuts
(A p1 | B p2 | C p3) instead of (A p1|B p2|C p3)
2020-11-03 22:17:16 +01:00
Gabriel Scherer bdcd9baa03 fix -dsource printing of the pattern (A as x | (B as x))
fixes #9999
2020-11-03 22:17:16 +01:00
Damien Doligez dff48afa72 If the major GC is in Phase_idle, caml_gc_major_slice must start a new
major GC cycle instead of just calling caml_major_collection_slice.
fixes #7813
2020-11-03 11:09:35 +01:00
Daniil Baturin 0280127761
Fix Unix.utimes not working for directories on Win32. (#8796) 2020-11-03 11:03:35 +01:00
Damien Doligez 2339a8c907 Change workflow of caml_gc_dispatch to make sure the major GC does not
stall when no minor allocations take place.
2020-11-03 10:49:33 +01:00
Xavier Leroy 8575a4b577
Merge pull request #2195 from dra27/better-ulimit
Improve error message when bytecode program runs out of fds
2020-11-02 14:08:48 +01:00
David Allsopp 46c7122888 Merge pull request #9840 from dra27/fix-9839
Partial revert of 9165: don't build the compiler with -O3 in flambda

(cherry picked from commit 6ce1c60ca97ee962ebf5d5218628bc388536325e)
2020-10-30 11:29:17 +01:00
Gabriel Scherer 3a094ebc36
Merge pull request #9989 from jhjourdan/fixPR9742
Fix a bug in PR9742: in naked pointers mode, the code could dereference a pointer before checking it is not a naked pointer.
2020-10-29 17:12:44 +01:00
Florian Angeletti 86528b09b9
manual: docitem macros for linking modules (#9988) 2020-10-28 17:32:42 +01:00
Jacques-Henri Jourdan 0f64cc87b0 Fix a bug in PR9742: in naked pointers mode, the code could
dereference a pointer before checking it is not a naked pointer.

Algo fix a debug macro changed in PR9742 which could potentially
modify its parameter. It turns out this is not a bug, but the macro
was still particularly dangerous.
2020-10-26 10:21:59 +01:00
Gabriel Scherer f449d9b298
Merge pull request #9987 from Octachron/manual_underscore_package
manual: use the underscore package
2020-10-24 17:43:42 +02:00
Florian Angeletti fc2d2ccfc9 manual: use underscore package 2020-10-23 16:34:21 +02:00
Leo White 055f04d189
Merge pull request #9631 from gretay-js/named_sections_for_caml_system_code
Named text sections for caml_system__code_begin/end symbols
2020-10-22 10:12:02 +01:00
Gabriel Scherer cdf6953953
Merge pull request #9984 from ezal/clarify-docstring-in-str-library
Str: clarify matched_group documentation
2020-10-22 09:16:18 +02:00
Eugen Zalinescu d0c0c96d19 Clarify docstring in Str module 2020-10-21 21:36:21 +02:00
Gabriel Scherer 5faeae8153
Merge pull request #9650 from gasche/matching-can-flatten
pattern-matching: Cannot_flatten, maybe we can?
2020-10-21 21:34:01 +02:00
Gabriel Scherer 7d5f494ff5 testsuite: include both -dlambda and -drawlambda outputs 2020-10-21 15:05:11 +02:00
Gabriel Scherer b5f6cd4949 testsuite: clarify the allocation behavior
(A nice catch of Florian Angeletti's review)
2020-10-21 15:00:05 +02:00
Gabriel Scherer dacaddc265 matching: clarify the ~vars argument of Simple.explode_or_pat
(suggested by Thomas Refis' review)
2020-10-21 11:49:29 +02:00
Gabriel Scherer 0ab43f822a matching: simplify the interface of Simple.explode_or_pat 2020-10-21 11:49:29 +02:00
Gabriel Scherer cbf69c7f53 Matching.Simple.explode_or_pat: on-demand generation of fresh identifiers
This change was suggested by Thomas Refis during code review.
2020-10-21 11:49:29 +02:00
Gabriel Scherer 8fc38d247f add a comment to explain what Simple.explode_or_pat does 2020-10-21 11:49:29 +02:00
Gabriel Scherer 940149a45a matching: avoid useless bindings in do_for_multiple_match 2020-10-21 11:49:29 +02:00
Gabriel Scherer 7aa43acacd matching: towards a correctness argument for flatten_* ignoring variables
Before we ignored as-patterns in the flatten_* functions because
as-patterns would either be half-simplified or raise Cannot_flatten
(in any case, never reach the flattening functions).

Now the reasoning is a bit more subtle: the only non-simple matrices
we flatten are used as "ghost" information (default environments,
provenance) where variables do not matter, only the shape of matched values.
2020-10-21 11:49:29 +02:00
Gabriel Scherer c0d1e8157d Match.do_for_multiple_match: we can always flatten 2020-10-21 11:49:29 +02:00
Gabriel Scherer bd83d67d26 Matching.explode_or_pat: handle the case where the argument has no id 2020-10-21 10:08:48 +02:00
Gabriel Scherer 31c2551c7c matching: more complete testsuite for do_for_multiple_match
Note: we now use -dlambda rather than -drawlambda, because otherwise
the output is much more verbose and difficult to read.

(-drawlambda is closed to the inner workings of the pattern-matching
compiler, but the simplification in -dlambda make the output much more
readable. They are also fairly predictable/non-surprising, so I think
that we can still easily understand what the compiler did from that
output.)
2020-10-21 10:08:48 +02:00
Gabriel Scherer cc462e0f76 matching: document the behavior of precompile_or through an example 2020-10-21 10:08:48 +02:00
Thomas Refis 10364b67d5
build_as_type: document why generic_instance can't be used (#9983) 2020-10-20 15:04:58 +02:00
Thomas Refis 1e07bc7ed9 fix dune build 2020-10-20 11:20:40 +02:00
Jacques-Henri Jourdan 0cb298f5e7
Merge pull request #9674 from jhjourdan/memprof_thread_alloc_callback_2
Memprof: provide the guarantee that an allocation callback is always run in the same thread the allocation takes place. Attempt II.
2020-10-20 10:29:56 +02:00
Florian Angeletti 9eb1a08c14 add new 4.12 badge, remove old badges in README 2020-10-19 18:23:04 +02:00
Greta Yorsh 1e91d2b7ca add Changes entry 2020-10-19 16:47:50 +01:00
Greta Yorsh 30e1e534d7 Add named text sections for caml_system__code_begin/end symbols 2020-10-19 16:47:13 +01:00
Stephen Dolan a6980b256d Add a test for Memprof.stop within a Memprof callback 2020-10-19 17:11:11 +02:00
Jacques-Henri Jourdan 7e4748cf9c Changes. 2020-10-19 17:11:11 +02:00
Jacques-Henri Jourdan b9abf833ca Memprof/systhreads : call [caml_memprof_delete_th_ctx] when threads gets killed by fork. 2020-10-19 17:11:11 +02:00
Jacques-Henri Jourdan 6d3065be78 Memprof: get rid of the idx_ptr pointers.
Instead, we use a thread-local variable [callback_status] which
contains the index of the corresponding entry when a callback is
running. We can do this since there can only be one running callback
at the same time in a given thread.

This lifts the restriction forbidding the call of Thread.exit from a
memprof callback.
2020-10-19 17:11:11 +02:00
Jacques-Henri Jourdan f83d71830d Memprof: provide the guarantee that an allocation callback is always run in the same thread the allocation takes place.
This is done by using a local entry array for each thread, containing
tracked blocks whose allocation callback has not yet been called.

This allows some simplification in the code running callbacks for
young allocations. Indeed, since the entry array is local to one
thread, we know for sure that it cannot be modified during a callback,
and therefore we no longer need to remember the indices of the
corresponding new entries.
2020-10-19 17:08:17 +02:00
Jacques-Henri Jourdan 18c0f95560 Memprof : Refactor [run_callback_exn] so that it also stores the value returned by the callback. 2020-10-19 17:00:04 +02:00