Commit Graph

2774 Commits (master)

Author SHA1 Message Date
Xavier Leroy fcaab503fc Bow to check-typo 2020-11-26 09:48:29 +01:00
Sébastien Hinderer 10c91b3a8d Skip the "sieve.ml" test in "cleanup at exit" runtime mode
Deadlocks can occur due to finalizing a condition variable that is still
waited on by other threads.
2020-11-25 19:26:02 +01:00
Xavier Leroy c550639317 Terminate all threads explicitly
This is good style and might help with a mysterious deadlock observed
in "extra-configs" CI.
2020-11-25 16:08:29 +01:00
David Allsopp f6279a64b5
Switch the compiler CI builds from Travis to GitHub actions (#10036)
* Switch compiler builds and tests to GitHub actions

* Expose ${cc} in ocamltest

* Allow lib-bigarray-2/bigarrfml.ml to run on 32-bit

* Simplify environment variables passed to scripts

* Reduce matrix to 3 builds

* Move minimum build into Jenkins other-configs
2020-11-24 14:16:31 +01:00
Jacques-Henri Jourdan 328ebc1ea3
Merge pull request #10025 from stedolan/memprof-custom
Track caml_alloc_custom_mem allocations with Statmemprof
2020-11-24 10:06:52 +01:00
Gabriel Scherer f794d799ad typing: fix the scope of extension constructor declarations
fixes #9970
2020-11-23 14:30:59 +01:00
Leo White d0ddf25f3d
Merge pull request #9991 from lpw25/reproducible-no-alias-deps
Fix reproducibility for `-no-alias-deps`
2020-11-22 18:22:48 +00:00
Leo White e7dbaeb8ce Fix reproducibility for `-no-alias-deps` 2020-11-22 13:44:28 +00:00
Vincent Laviron e78db7b6a5 Prevent inlining of CamlinternalLazy.force 2020-11-21 11:42:17 +01:00
Jacques Garrigue b47c34912c
Mark datatypes as injective in recursive module approximations (#10029) 2020-11-20 16:29:23 +09:00
Stephen Dolan 6a3af5c926 Add Gc.Memprof.allocation_source 2020-11-17 11:17:52 +00:00
Stephen Dolan 20b7d8b2a7
Try expanding aliases in Ctype.nondep_type_rec (#10005) 2020-11-17 11:10:59 +00:00
Stephen Dolan 3631d4b543 Track caml_alloc_custom_mem allocations with Statmemprof 2020-11-16 13:42:16 +00: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
David Allsopp 692bd73123 OCAMLRUNPARAM=b=2 => load debuginfo
Load the debug information during runtime startup if OCAMLRUNPARAM=b=2.
This guards against the specific case of running out of fds, since the
debug information can't then be loaded.
2018-12-11 10:17:04 +01:00
David Allsopp 43b28fac00 Improve error messages when loading backtrace info
Before, any errors when loading bytecode backtrace information were
fatal and the error message was potentially misleading.
2018-12-11 08:54:49 +01: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 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 940149a45a matching: avoid useless bindings in do_for_multiple_match 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 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
Stephen Dolan a6980b256d Add a test for Memprof.stop within a Memprof callback 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 d1800821df Gc.Memprof.stop does no longer try to run pending callbacks.
This is only effetive in native mode, since function calls in bytecode
mode will trigger polling and hence run pending callbacks.
2020-10-19 16:41:13 +02:00
Stephen Dolan 9b3931a156
Ensure Mtype.nondep_sig checks use the correct environment (#9946) 2020-10-19 10:40:25 +01:00
Thomas Refis efac790249
Make some locations more accurate (#8987) 2020-10-14 16:03:10 +02:00
Florian Angeletti 5e15dd8eb5
Merge pull request #9861 from trefis/9858
Catch Nondep_cannot_erase
2020-10-13 16:31:34 +02:00
Greta Yorsh 855c13cd6e
ability to restart compilation from .cmir-linear IR files 2020-10-13 15:07:13 +02:00
Xavier Leroy f809e9dec1
Make sure the process can terminate when the last thread calls Thread.exit (#9973)
To this end, the tick thread must be stopped, otherwise it prevents
the whole process from exiting.

Fixes: #9971
2020-10-12 15:24:40 +02:00
Mehdi Bouaziz 6ab6052e15
[hashtbl] Restore ongoing traversal status after filter_map_inplace (#8746) 2020-10-12 15:12:09 +02:00
Gabriel Scherer 0cec3a353b
Merge pull request #9803 from trefis/pr9799
pat_env points to the correct environment
2020-10-12 11:00:52 +02:00
Gabriel Scherer 82b29828d2
Allow `[@tailcall true]` and `[@tailcall false]` (#9754)
* remove the unused is_native_tail_call_heuristic forward reference

This forward-reference from Lambda to Asmcomp was used to generate
machine-specific tailcall information in -annot output; this only use
was removed in 57d329e07b, so we can now
remove it to simplify the codebase.

The logic was non-trivial and might be useful again in the future.

* [minor] testsuite: convert warnings/w51.ml to an expect-test

* [minor] translattribute: refactor attribute payload deconstruction

* [@tailcall false]: warn if the call *is* a tailcall

(+ constructor renaming suggested by Nicolás during review)

* Changes

* testsuite: add an example with the 'invalid payload' exception

(suggested by Nicolás during review)
2020-10-10 13:41:39 +02:00
Xavier Leroy 86c8a98f3c
Merge pull request #9948 from nojb/remove_spacetime
The Spacetime memory profiler is not going to be supported in Multicore OCaml, and  is already broken by some of the related changes in OCaml 4.12.  The core development team decided to remove Spacetime support from OCaml 4.12.
2020-10-09 14:43:23 +02:00
Nicolás Ojeda Bär 899a2013aa Adapt tests 2020-10-08 20:28:15 +02:00
Nicolás Ojeda Bär 43883ae4bc Remove labels after calls, checkbound, and GC points 2020-10-08 20:28:15 +02:00
Thomas Refis c7f9c8e559 pat_env: I must not tell lies 2020-10-07 15:54:23 +02:00
Thomas Refis b938cb32c5 add test from PR#9799 2020-10-07 15:54:23 +02:00
Greta Yorsh 04bceec6cc
Save Linear IR before emit (#8939)
* Save IR before emit

* Update .depend for linear_format

* Test for -save-ir-after command-line option

* Address review comments

* Add Changes entry
2020-10-07 11:32:40 +01:00
Leo White 952281944d
Merge pull request #9429 from lpw25/more-hash-operators
Add ppx-only unary operators
2020-10-06 07:46:35 +01:00
Xavier Leroy 786ee521cf
Use "error checking" mutexes in the threads library (#9846)
- Mutex.lock raises Sys_error if the mutex is already locked by the
  calling thread.
- Mutex.unlock raises Sys_error if the mutex is unlocked or locked
  by another thread.

Add the corresponding tests.

Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-10-05 15:00:58 +02:00
Xavier Leroy af48d9fe8f
Add a naked pointers dynamic checker (#9956)
This is selected at configure-time, option --enable-naked-pointers-checker.

The major GC warns when it detects out-of-heap pointers that could cause the no-naked-pointers runtime system to crash.

This is supported on x86-64 only, but on all ports (Unix and Windows).

Added tests involving naked pointers in tests/runtime-naked-pointers

Co-authored-by: KC Sivaramakrishnan <kc@kcsrk.info>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: Enguerrand Decorne <decorne.en@gmail.com>
2020-10-05 14:44:31 +02:00
Nicolás Ojeda Bär 5381e13626
Fix handling of Exit_compiler exception in toplevel (#9798) 2020-10-05 09:46:20 +02:00
Jacques Garrigue a5f63ba65f
Remove propagation from previous branches (#9811) 2020-10-03 10:48:57 +09:00
David Allsopp 3527051e8d Clearer error in testsuite when ocamltest missing 2020-09-22 20:40:57 +01:00
Xavier Leroy 72dbcb8433
Merge pull request #9864 from xavierleroy/is_immediate-refactored
Revised detection of arithmetic instructions with immediate operands
2020-09-22 09:22:26 +02:00
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
Leo White 44fff5c92a Add ppx-only unary operators 2020-09-18 10:33:16 +01:00