Skip to content

Commit

Permalink
Merge branch 'trunk' into simplified-error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Jan 6, 2021
2 parents 49929f4 + 810622f commit 61c9560
Show file tree
Hide file tree
Showing 85 changed files with 826 additions and 1,731 deletions.
78 changes: 14 additions & 64 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ stdlib/sharpbang text eol=lf
tools/autogen text eol=lf
tools/ci/inria/remove-sinh-primitive.patch text eol=lf
tools/check-typo text eol=lf
tools/check-symbol-names text eol=lf
tools/ci-build text eol=lf
tools/msvs-promote-path text eol=lf
tools/gdb-macros text eol=lf
tools/magic text eol=lf
tools/make-opcodes text eol=lf
tools/make-package-macosx text eol=lf
tools/ocaml-objcopy-macosx text eol=lf
tools/ocamlmktop.tpl text eol=lf
tools/ocamlsize text eol=lf
tools/pre-commit-githook text eol=lf
tools/markdown-add-pr-links.sh text eol=lf
Expand All @@ -191,73 +191,23 @@ manual/tools/texexpand text eol=lf

# Tests which include references spanning multiple lines fail with \r\n
# endings, so use \n endings only, even on Windows.
testsuite/tests/backtrace/names.ml text eol=lf
testsuite/tests/basic-modules/anonymous.ml text eol=lf
testsuite/tests/basic-more/morematch.ml text eol=lf
testsuite/tests/basic-more/robustmatch.ml text eol=lf
testsuite/tests/parsing/*.ml text eol=lf
testsuite/tests/docstrings/empty.ml text eol=lf
testsuite/tests/formatting/test_locations.ml text eol=lf
testsuite/tests/functors/functors.ml text eol=lf
testsuite/tests/lib-dynlink-initializers/test10_main.ml text eol=lf
testsuite/tests/parsing/attributes.ml text eol=lf
testsuite/tests/parsing/extensions.ml text eol=lf
testsuite/tests/parsing/hash_ambiguity.ml text eol=lf
testsuite/tests/parsing/int_and_float_with_modifier.ml text eol=lf
testsuite/tests/parsing/pr6865.ml text eol=lf
testsuite/tests/parsing/quotedextensions.ml text eol=lf
testsuite/tests/parsing/shortcut_ext_attr.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_impl.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_intf.mli text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_typing_impl.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting_use4.ml text eol=lf
testsuite/tests/translprim/module_coercion.ml text eol=lf
testsuite/tests/typing-objects-bugs/pr3968_bad.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pr7402.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pervasives_leitmotiv.ml text eol=lf
testsuite/tests/typing-recmod/t12bad.ml text eol=lf
testsuite/tests/typing-safe-linking/b_bad.ml text eol=lf
testsuite/tests/warnings/w04.ml text eol=lf
testsuite/tests/warnings/w04_failure.ml text eol=lf
testsuite/tests/warnings/w32.ml text eol=lf

# These are forced to \n to allow the Cygwin testsuite to pass on a

# This is forced to \n to allow the Cygwin testsuite to pass on a
# Windows-checkout
testsuite/tests/formatting/margins.ml text eol=lf
testsuite/tests/letrec-check/pr7706.ml text eol=lf
testsuite/tests/letrec-disallowed/disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/extension_constructor.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_allowed.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/generic_arrays.ml text eol=lf
testsuite/tests/letrec-disallowed/lazy_.ml text eol=lf
testsuite/tests/letrec-disallowed/module_constraints.ml text eol=lf
testsuite/tests/letrec-disallowed/unboxed.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7215.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7231.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7706.ml text eol=lf
testsuite/tests/lexing/uchar_esc.ml text eol=lf
testsuite/tests/match-exception-warnings/exhaustiveness_warnings.ml text eol=lf
testsuite/tests/tool-toplevel/pr7060.ml text eol=lf
testsuite/tests/typing-extension-constructor/test.ml text eol=lf
testsuite/tests/typing-extensions/extensions.ml text eol=lf
testsuite/tests/typing-extensions/open_types.ml text eol=lf
testsuite/tests/typing-objects/Exemples.ml text eol=lf
testsuite/tests/typing-objects/pr5619_bad.ml text eol=lf
testsuite/tests/typing-objects/pr6123_bad.ml text eol=lf
testsuite/tests/typing-objects/pr6907_bad.ml text eol=lf
testsuite/tests/typing-objects/Tests.ml text eol=lf
testsuite/tests/typing-pattern_open/pattern_open.ml text eol=lf
testsuite/tests/typing-private/private.ml text eol=lf
testsuite/tests/typing-recordarg/recordarg.ml text eol=lf
testsuite/tests/typing-short-paths/pr5918.ml text eol=lf
testsuite/tests/typing-sigsubst/sigsubst.ml text eol=lf
testsuite/tests/typing-typeparam/newtype.ml text eol=lf
testsuite/tests/typing-unboxed/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_flat.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_no_flat.ml text eol=lf
testsuite/tests/typing-warnings/ambiguous_guarded_disjunction.ml text eol=lf
testsuite/tests/typing-warnings/application.ml text eol=lf
testsuite/tests/typing-warnings/coercions.ml text eol=lf
testsuite/tests/typing-warnings/exhaustiveness.ml text eol=lf
testsuite/tests/typing-warnings/pr6587.ml text eol=lf
testsuite/tests/typing-warnings/pr6872.ml text eol=lf
testsuite/tests/typing-warnings/pr7085.ml text eol=lf
testsuite/tests/typing-warnings/pr7115.ml text eol=lf
testsuite/tests/typing-warnings/pr7261.ml text eol=lf
testsuite/tests/typing-warnings/pr7297.ml text eol=lf
testsuite/tests/typing-warnings/pr7553.ml text eol=lf
testsuite/tests/typing-warnings/records.ml text eol=lf
testsuite/tests/typing-warnings/unused_types.ml text eol=lf
testsuite/tests/parsetree/locations_test.ml text eol=lf
15 changes: 8 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ contribution.
You should not leave trailing whitespace; not have line longer than 80
columns, not use tab characters (spaces only), and not use non-ASCII
characters. These typographical rules can be checked with the script
`tools/check-typo`.

If you are working from a Git clone, you can automate this process by
copying the file `tools/pre-commit-githook` to `.git/hooks/pre-commit`.
`tools/check-typo`, see [HACKING.adoc: check-typo](HACKING.adoc#check-typo).

Otherwise, there are no strongly enforced guidelines specific to the
compiler -- and, as a result, the style may differ in the different
Expand Down Expand Up @@ -224,16 +221,20 @@ better than adding redundant explanations.)
### User documentation

Changes affecting the compiler libraries should be reflected in the
documentation comments of the relevant `.mli` files.
documentation comments of the relevant `.mli` files. After running
`make html_doc`, you can find the HTML Standard Library documentation
at `./api_docgen/html/libref/index.html`.

It is recommended to included changes to the OCaml Reference Manual
It is recommended to include changes to the OCaml Reference Manual
(in particular for any change in the surface language), which is now
part of the main repository (under `manual/`).
part of the main repository (under `manual/`). To build the full manual,
see the instructions in `manual/README.md`.

Finally, changes in command-line options should be integrated in the
manual, but also in the man pages present in the `man/` sub-directory
of the OCaml distribution.


### Changelog

Any user-visible change should have a `Changes` entry:
Expand Down
55 changes: 51 additions & 4 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,33 @@ Working version

### Runtime system:

- #9284: Add -config option to display the configuration of ocamlrun on stdout,
including the search path for shared stub libraries.
(David Allsopp, review by Xavier Leroy)

- #10025: Track custom blocks (e.g. Bigarray) with Statmemprof
(Stephen Dolan, review by Leo White, Gabriel Scherer and Jacques-Henri
Jourdan)

- #10102: Ignore PROFINFO_WIDTH if WITH_PROFINFO is not defined (technically
a breaking change if the configuration system was being abused before).
(David Allsopp, review by Xavier Leroy)

* #10098: Improve command-line parsing in ocamlrun: strictly recognise options,
be more informative for `ocamlrun -I` and support `--` for terminating options
parsing.
(David Allsopp, review by Xavier Leroy)

- #10101: Add -help/--help option to ocamlrun.
(David Allsopp, review by Xavier Leroy)

### Code generation and optimizations:

- #9876: do not cache the young_limit GC variable in a processor register.
This affects the ARM64, PowerPC and RISC-V ports, making signal handling
and minor GC triggers more reliable, at the cost of a small slowdown.
(Xavier Leroy, review by Nicolás Ojeda Bär)

- #9937: improvements in ARM64 code generation (constants, sign extensions)
(Xavier Leroy, review by Stephen Dolan)

Expand All @@ -38,6 +59,10 @@ Working version

### Compiler user-interface and warnings:

- #9960: extend ocamlc/ocamlopt's -o option to work when compiling C files
(Sébastien Hinderer, reported by Daniel Bünzli, review by Florian
Angeletti and Gabriel Scherer)

- #10095: simplify the syntax error messages produced by the compiler.
In many cases, the compiler would produce an error message that looked
potentially helpful but was actually misguided and arguably confusing,
Expand Down Expand Up @@ -71,6 +96,11 @@ Working version
changes in the parser.
(François Pottier, review by Gabriel Scherer and Xavier Leroy.)

- #10113: add a `-timeout` option to ocamltest and use it in the test suite.
(Xavier Leroy and Gabriel Scherer, review by Sébastien Hinderer
and David Allsopp)


### Build system:

- #9191, #10091: take the LDFLAGS variable into account, except on
Expand All @@ -90,7 +120,6 @@ Working version
do not overflow the 16-bit fields where they are stored.
(Xavier Leroy, report by Github user pveber, review by Gabriel Scherer)


OCaml 4.12.0
------------

Expand Down Expand Up @@ -272,6 +301,10 @@ OCaml 4.12.0
- #10062: set ARCH_INT64_PRINTF_FORMAT correctly for both modes of mingw-w64
(David Allsopp, review by Xavier Leroy)

- #10107: Ensure modules compiled with -afl-instrument can still link on
platforms without AFL support.
(David Allsopp, review by Xavier Leroy)

### Code generation and optimizations:

- #9551: ocamlc no longer loads DLLs at link time to check that
Expand Down Expand Up @@ -775,8 +808,22 @@ OCaml 4.12.0
- #10048: Fix bug with generalized local opens.
(Leo White, review by Thomas Refis)

OCaml 4.11.1
------------
- #10106, #10112: some expected-type explanations where forgotten
after some let-bindings
(Gabriel Scherer, review by Thomas Refis and Florian Angeletti,
report by Daniil Baturin)

OCaml 4.11 maintenance branch
-----------------------------

### Bug fixes:

- #9096, #10096: fix a 4.11.0 performance regression in classes/objects
declared within a function
(Gabriel Scherer, review by Leo White, report by Sacha Ayoun)

OCaml 4.11.1 (31 August 2020)
-----------------------------

### Bug fixes:

Expand All @@ -789,7 +836,7 @@ OCaml 4.11.1
(Florian Angeletti, review by Thomas Refis)

OCaml 4.11.0 (19 August 2020)
---------------------------
-----------------------------

(Changes that can break existing programs are marked with a "*")

Expand Down
23 changes: 23 additions & 0 deletions HACKING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,29 @@ most packages are incompatible with the in-progress development version.

=== Continuous integration

[#check-typo]
==== check-typo

The `tools/check-typo` script enforces various typographical rules in the
OCaml compiler codebase.

Running `./tools/check-typo` from the repository root will check all
source files. This can be fairly slow (2 minutes for example). Use
`./tools/check-typo <path>` to run it on some file or directory
(recursively) only.

Running `./toos/check-typo-since trunk` checks all files that changed
in the commits since `trunk` -- this work with any git reference. It
runs much faster than a full `./tools/check-typo`, typically instantly.

You can also setup a git commit-hook to automatically run `check-typo`
on the changes you commit, by copying the file
`tools/pre-commit-githook` to `.git/hooks/pre-commit`.

Some files need special rules to opt out of `check-typo` checks; this
is specified in the `.gitattributes` file at the root of the
repository, using `typo.foo` attributes.

==== Github's CI: Travis and AppVeyor

The script that is run on Travis continuous integration servers is
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ opt: checknative
.PHONY: opt.opt
opt.opt: checknative
$(MAKE) checkstack
$(MAKE) runtime
$(MAKE) core
$(MAKE) coreall
$(MAKE) ocaml
$(MAKE) opt-core
$(MAKE) ocamlc.opt
Expand Down
12 changes: 6 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
|=====
| Branch `trunk` | Branch `4.12` | Branch `4.11` | Branch `4.10`

| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",
link="https://travis-ci.org/ocaml/ocaml"]
| image:https://github.com/ocaml/ocaml/workflows/main/badge.svg?branch=trunk["Github CI Build Status (trunk branch)",
link="https://github.com/ocaml/ocaml/actions?query=workflow%3Amain"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.12["TravisCI Build Status (4.12 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
| image:https://github.com/ocaml/ocaml/workflows/main/badge.svg?branch=4.12["Github CI Build Status (4.12 branch)",
link="https://github.com/ocaml/ocaml/actions?query=workflow%3Amain"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.12&svg=true["AppVeyor Build Status (4.12 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.11["TravisCI Build Status (4.11 branch)",
Expand Down Expand Up @@ -49,7 +49,7 @@ compiler currently runs on the following platforms:
| ARM 64 bits | Linux, macOS | FreeBSD
| ARM 32 bits | Linux | FreeBSD, NetBSD, OpenBSD
| Power 64 bits | Linux |
| Power 32 bits | | Linux
| Power 32 bits | Linux |
| RISC-V 64 bits | Linux |
| IBM Z (s390x) | Linux |
|====
Expand All @@ -61,7 +61,7 @@ the compiler may work under other operating systems with little work.
== Copyright

All files marked "Copyright INRIA" in this distribution are
Copyright (C) 1996-2020 Institut National de Recherche en Informatique et
Copyright (C) 1996-2021 Institut National de Recherche en Informatique et
en Automatique (INRIA) and distributed under the conditions stated in
file LICENSE.

Expand Down
21 changes: 10 additions & 11 deletions asmcomp/arm64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ let fastcode_flag = ref true

(* Names for special regs *)

let reg_domain_state_ptr = phys_reg 22
let reg_trap_ptr = phys_reg 23
let reg_alloc_ptr = phys_reg 24
let reg_alloc_limit = phys_reg 25
let reg_tmp1 = phys_reg 26
let reg_x8 = phys_reg 8
let reg_domain_state_ptr = phys_reg 25 (* x28 *)
let reg_trap_ptr = phys_reg 23 (* x26 *)
let reg_alloc_ptr = phys_reg 24 (* x27 *)
let reg_tmp1 = phys_reg 26 (* x16 *)
let reg_x8 = phys_reg 8 (* x8 *)

(* Output a label *)

Expand Down Expand Up @@ -496,10 +495,8 @@ module BR = Branch_relaxation.Make (struct
| Lop (Iload (size, addr)) | Lop (Istore (size, addr, _)) ->
let based = match addr with Iindexed _ -> 0 | Ibased _ -> 1 in
based + begin match size with Single -> 2 | _ -> 1 end
| Lop (Ialloc {bytes = num_bytes}) when !fastcode_flag ->
if num_bytes <= 0xFFF then 4 else 5
| Lop (Ispecific (Ifar_alloc {bytes = num_bytes})) when !fastcode_flag ->
if num_bytes <= 0xFFF then 5 else 6
| Lop (Ialloc _) when !fastcode_flag -> 5
| Lop (Ispecific (Ifar_alloc _)) when !fastcode_flag -> 6
| Lop (Ialloc { bytes = num_bytes; _ })
| Lop (Ispecific (Ifar_alloc { bytes = num_bytes; _ })) ->
begin match num_bytes with
Expand Down Expand Up @@ -586,8 +583,10 @@ let assembly_code_for_allocation i ~n ~far ~dbginfo =
so it is reasonable to assume n < 0x1_000. This makes
the generated code simpler. *)
assert (16 <= n && n < 0x1_000 && n land 0x7 = 0);
let offset = Domainstate.(idx_of_field Domain_young_limit) * 8 in
` ldr {emit_reg reg_tmp1}, [{emit_reg reg_domain_state_ptr}, #{emit_int offset}]\n`;
` sub {emit_reg reg_alloc_ptr}, {emit_reg reg_alloc_ptr}, #{emit_int n}\n`;
` cmp {emit_reg reg_alloc_ptr}, {emit_reg reg_alloc_limit}\n`;
` cmp {emit_reg reg_alloc_ptr}, {emit_reg reg_tmp1}\n`;
if not far then begin
` b.lo {emit_label lbl_call_gc}\n`
end else begin
Expand Down

0 comments on commit 61c9560

Please sign in to comment.