| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
New test script language, all tests translated automatically (see `tools/translate-all-tests`).
|
| | |
|
| | |
|
| |
|
|
| |
(#11246)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The Toploop module perform some pre-initialisation as soon as the module is
linked. This pre-initialisation only affects modules linked by ocamlmktop
when building custom toplevels. Indeed user-provided module are linked by
ocamlmktop before the toplevel is initialised and started.
This commit removes the read of topdirs.cmi from this preinitialisation
stage. This may broke ocamlmktop users that install printers, but this
is required to be able to write client of the toplevel compiler library
that don't read +compiler-libs/topdirs.cmi. In particular, the
expect_test tool from the compiler testsuite belongs to this category.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR (#11213) addresses issues pointed out in #11176 and #11178. It
makes the following changes:
* `Domain.at_exit` is now domain-local.
* `Domain.at_exit` also used to ignore exceptions. Now, these exceptions
are surfaced as the result of domain execution (similar to how
`Stdlib.at_exit` works).
* `Domain.at_startup` is renamed to `Domain.at_each_spawn`.
* `Domain.at_first_spawn` is renamed to `Domain.before_first_spawn`.
* `Domain.before_first_spawn` and `Domain.at_each_spawn` run the
callbacks in FIFO order (as requested in #11178).
The PR also adds tests to the test suite.
|
| | |
|
| | |
|
| |
|
|
|
| |
* Remove unused function in asmcomp/reg.ml
* Enable a few disabled tests
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Co-authored-by: Thomas Refis <thomas.refis@gmail.com>
|
| |\ \
| |/ |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
state (#10595)
In 2004, commit af9b98fcb, the calling conventions for the i386 port of ocamlopt were changed: the first 6 integer arguments go into registers, like before, but the next 16 arguments go into a global array `caml_extra_params`, instead of being passed on stack like before. The reason for this hack is that passing arguments in global memory does not preclude tail call optimization, unlike passing arguments on stack. Parameters passed via `caml_extra_params` are immediately copied on stack or in registers on function entry, before another function call, a GC, or a context switch can take place, so everything is safe in OCaml, and in Multicore OCaml as long as there is only one execution domain.
This hack was justified by the paucity of registers provided by the i386 architecture. It was believed that other architectures provide enough registers for parameter passing that most if not all reasonable tail calls can be accommodated.
Now it's 2021 and users want tail calls with more arguments than available registers on all the architectures we support.
So, biting the bullet and swallowing some pride, this commit extends the 2004 i386 hack to all the architectures supported by OCaml. Once the registers available for passing function arguments are exhausted, the next 64 arguments are passed in a memory area that is part of the domain state. This argument passing is compatible with tail calls, so we get guaranteed tail calls up to 70 arguments (in the worst case).
The domain state is used instead of a global array so that (1) this is compatible with Multicore OCaml and concurrent execution of multiple domains, and (2) we benefit from efficient addressing from the domain state register.
For i386, we don't have a domain state register, and Multicore OCaml will support only one domain on this architecture, so we keep using a global `caml_extra_params` array; only, its size was increased to support 64 arguments.
The tests for tail calls were extended to
- Test tail calls to other functions, not just to self
- Test up to 32 arguments.
|
| |\ \
| |/ |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_13
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_13
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_13
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_13
|
| | | |
|
| | |
| |
| |
| | |
(A nice catch of Florian Angeletti's review)
|
| | |
| |
| |
| | |
This change was suggested by Thomas Refis during code review.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.)
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_12
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
```ocaml
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val equal :
left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
('a, 'b) t -> ('a, 'b) t -> bool
val compare :
left:('a -> 'a -> int) -> right:('b -> 'b -> int) ->
('a, 'b) t -> ('a, 'b) t -> int
```
Unlike [result], no [either] type is made available in Stdlib,
one needs to access [Either.t] explicitly:
- This type is less common in typical OCaml codebases,
which prefer domain-specific variant types whose constructors
carry more meaning.
- Adding this to Stdlib would raise warnings in existing codebases
that already use a constructor named Left or Right:
+ when opening a module that exports such a name,
warning 45 is raised
+ adding a second constructor of the same name in scope kicks
in the disambiguation mechanisms, and warning 41 may now
be raised by existing code.
If the use becomes more common in the future we can always
revisit this choice.
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_12
|
| | | |
|
| | | |
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_12
|
| | |
| |
| |
| |
| | |
Note: this is due to mk_alpha_env raising Cannot_flatten during
splitting/precompilation.
|
| |\ \
| |/
| |
| | |
parallel_minor_gc_4_12
|