Skip to content

Commit

Permalink
Merge commit 'd01f0b7d7130f3f3b0c982d4c69ab5eabf071d37' into parallel…
Browse files Browse the repository at this point in the history
…_minor_gc_4_10
  • Loading branch information
ctk21 committed Apr 29, 2020
2 parents 06ed61a + d01f0b7 commit 9e27c29
Show file tree
Hide file tree
Showing 31 changed files with 259 additions and 99 deletions.
14 changes: 13 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Working version

### Code generation and optimizations:

- #8990: amd64: Emit 32bit registers for Iconst_int when we can
(Xavier Clerc, Tom Kelly and Mark Shinwell, review by Xavier Leroy)

- #8672: Optimise Switch code generation on booleans.
(Stephen Dolan, review by Pierre Chambart)

Expand Down Expand Up @@ -145,7 +148,7 @@ Working version
which must be duplicated for each domain in the multicore runtime.
(KC Sivaramakrishnan and Stephen Dolan, compatibility header hacking by
David Allsopp, review by David Allsopp, Alain Frisch, Nicolas Ojeda Bar,
Gabriel Scherer and Damien Doligez)
Gabriel Scherer, Damien Doligez, and Guillaume Munch-Maccagnoni)

### Tools:

Expand Down Expand Up @@ -195,6 +198,9 @@ Working version
(Guillaume Munch-Maccagnoni, review by David Allsopp, Damien Doligez and
Gabriel Scherer)

- #8971: Add `Filename.null`, the conventional name of the "null" device.
(Nicolás Ojeda Bär, review by Xavier Leroy and Alain Frisch)

### Other libraries:

- #1939, #2023: Implement Unix.truncate and Unix.ftruncate on Windows.
Expand Down Expand Up @@ -249,6 +255,9 @@ Working version
- #8947: fix/improve support for the BFD library
(Sébastien Hinderer, review by Damien Doligez)

- #8951: let make's default target build the compiler
(Sébastien Hinderer, review by David Allsopp)

- #8985, #8986: fix generation of the primitives when the locale collation is
incompatible with C.
(David Allsopp, review by Nicolás Ojeda Bär, report by Sebastian Rasmussen)
Expand Down Expand Up @@ -373,6 +382,9 @@ OCaml 4.09.0 (19 September 2019):
- #2165: better unboxing heuristics for let-bound identifiers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)

- #8735: unbox across static handlers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)

### Compiler user-interface and warnings:

* #2276: Remove support for compiler plugins and hooks (also adds
Expand Down
2 changes: 1 addition & 1 deletion HACKING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ git checkout -b my-modification
+
----
./configure
make world.opt
make
----

3. Try the newly built compiler binaries `ocamlc`, `ocamlopt` or their
Expand Down
15 changes: 4 additions & 11 deletions INSTALL.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,13 @@ for guidance on how to edit the generated files by hand.

From the top directory, do:

make world.opt
+
if your platform is supported by the native-code compiler (as reported during
the auto-configuration), or

make world
+
if not.
make

This builds the OCaml bytecode compiler for the first time. This phase is
This builds the OCaml compiler for the first time. This phase is
fairly verbose; consider redirecting the output to a file:

make world > log.world 2>&1 # in sh
make world >& log.world # in csh
make > make.log 2>&1 # in sh
make >& make.log # in csh

== (Optional) Running the testsuite

Expand Down
25 changes: 15 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,11 @@ ROOTDIR = .
include Makefile.config
include Makefile.common

# For users who don't read the INSTALL file
.PHONY: defaultentry
defaultentry:
ifeq "$(UNIX_OR_WIN32)" "unix"
@echo "Please refer to the installation instructions in file INSTALL."
@echo "If you've just unpacked the distribution, something like"
@echo " ./configure"
@echo " make world"
@echo " make install"
@echo "should work. But see the file INSTALL for more details."
ifeq "$(NATIVE_COMPILER)" "true"
defaultentry: world.opt
else
@echo "Please refer to the instructions in file README.win32.adoc."
defaultentry: world
endif

MKDIR=mkdir -p
Expand Down Expand Up @@ -1361,3 +1354,15 @@ distclean: clean
rm -f testsuite/_log*

include .depend

Makefile.config Makefile.common:
@echo "Please refer to the installation instructions:"
@echo "- In file INSTALL for Unix systems."
@echo "- In file README.win32.adoc for Windows systems."
@echo "On Unix systems, if you've just unpacked the distribution,"
@echo "something like"
@echo " ./configure"
@echo " make"
@echo " make install"
@echo "should work."
@false
3 changes: 3 additions & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ RPATH=@rpath@

############# Configuration for the native-code compiler

### Whether the native compiler has been enabled or not
NATIVE_COMPILER=@native_compiler@

### Name of architecture for the native-code compiler
### Currently supported:
###
Expand Down
2 changes: 0 additions & 2 deletions Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ OCAMLMKLIB=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
DUMPOBJ=$(OCAMLRUN) $(OTOPDIR)/tools/dumpobj
OBJINFO=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlobjinfo
BYTECODE_ONLY=[ "$(ARCH)" = "none" -o "$(ASM)" = "none" ]
NATIVECODE_ONLY=false

#FORTRAN_COMPILER=
#FORTRAN_LIBRARY=
Expand Down
10 changes: 5 additions & 5 deletions README.win32.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ the top-level of the OCaml distribution by running:

eval $(tools/msvs-promote-path)

If you forget to do this, `make world.opt` will fail relatively
If you forget to do this, `make` will fail relatively
quickly as it will be unable to link `ocamlrun`.

Now run:
Expand All @@ -208,7 +208,7 @@ which indicates where to install everything.

Finally, use `make` to build the system, e.g.

make world.opt
make
make install

After installing, it is not necessary to keep the Cygwin installation (although
Expand Down Expand Up @@ -275,7 +275,7 @@ which indicates where to install everything.

Finally, use `make` to build the system, e.g.

make world.opt
make
make install

After installing, you will need to ensure that `ocamlopt` (or `ocamlc -custom`)
Expand Down Expand Up @@ -314,10 +314,10 @@ done in one of three ways:
git submodule update --init

OCaml is then compiled as normal for the port you require, except that before
compiling `world`, you must compile `flexdll`, i.e.:
building the compiler itself, you must compile `flexdll`, i.e.:

make flexdll
make world.opt
make
make flexlink.opt
make install

Expand Down
16 changes: 14 additions & 2 deletions asmcomp/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,20 @@ let emit_instr fallthrough i =
| Lop(Iconst_int n) ->
if n = 0n then begin
match i.res.(0).loc with
| Reg _ -> I.xor (res i 0) (res i 0)
| _ -> I.mov (int 0) (res i 0)
| Reg _ ->
(* Clearing the bottom half also clears the top half (except for
64-bit-only registers where the behaviour is as if the operands
were 64 bit). *)
I.xor (res32 i 0) (res32 i 0)
| _ ->
I.mov (int 0) (res i 0)
end else if n > 0n && n <= 0xFFFF_FFFFn then begin
match i.res.(0).loc with
| Reg _ ->
(* Similarly, setting only the bottom half clears the top half. *)
I.mov (nat n) (res32 i 0)
| _ ->
I.mov (nat n) (res i 0)
end else
I.mov (nat n) (res i 0)
| Lop(Iconst_float f) ->
Expand Down
50 changes: 43 additions & 7 deletions asmcomp/cmm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ let iter_shallow_tail f = function
| Clet(_, _, body) | Cphantom_let (_, _, body) ->
f body;
true
| Cifthenelse(_cond, _dbg_cond, e1, _dbg_e1, e2, _dbg_e2) ->
f e1;
f e2;
| Cifthenelse(_cond, _ifso_dbg, ifso, _ifnot_dbg, ifnot, _dbg) ->
f ifso;
f ifnot;
true
| Csequence(_e1, e2) ->
f e2;
Expand Down Expand Up @@ -254,12 +254,13 @@ let rec map_tail f = function
Clet(id, exp, map_tail f body)
| Cphantom_let(id, exp, body) ->
Cphantom_let (id, exp, map_tail f body)
| Cifthenelse(cond, dbg_cond, e1, dbg_e1, e2, dbg_e2) ->
| Cifthenelse(cond, ifso_dbg, ifso, ifnot_dbg, ifnot, dbg) ->
Cifthenelse
(
cond, dbg_cond,
map_tail f e1, dbg_e1,
map_tail f e2, dbg_e2
cond,
ifso_dbg, map_tail f ifso,
ifnot_dbg, map_tail f ifnot,
dbg
)
| Csequence(e1, e2) ->
Csequence(e1, map_tail f e2)
Expand All @@ -284,3 +285,38 @@ let rec map_tail f = function
| Ctuple _
| Cop _ as c ->
f c

let map_shallow f = function
| Clet (id, e1, e2) ->
Clet (id, f e1, f e2)
| Cphantom_let (id, de, e) ->
Cphantom_let (id, de, f e)
| Cassign (id, e) ->
Cassign (id, f e)
| Ctuple el ->
Ctuple (List.map f el)
| Cop (op, el, dbg) ->
Cop (op, List.map f el, dbg)
| Csequence (e1, e2) ->
Csequence (f e1, f e2)
| Cifthenelse(cond, ifso_dbg, ifso, ifnot_dbg, ifnot, dbg) ->
Cifthenelse(f cond, ifso_dbg, f ifso, ifnot_dbg, f ifnot, dbg)
| Cswitch (e, ia, ea, dbg) ->
Cswitch (e, ia, Array.map (fun (e, dbg) -> f e, dbg) ea, dbg)
| Ccatch (rf, hl, body) ->
let map_h (n, ids, handler, dbg) = (n, ids, f handler, dbg) in
Ccatch (rf, List.map map_h hl, f body)
| Cexit (n, el) ->
Cexit (n, List.map f el)
| Ctrywith (e1, id, e2, dbg) ->
Ctrywith (f e1, id, f e2, dbg)
| Cconst_int _
| Cconst_natint _
| Cconst_float _
| Cconst_symbol _
| Cconst_pointer _
| Cconst_natpointer _
| Cblockheader _
| Cvar _
as c ->
c
3 changes: 3 additions & 0 deletions asmcomp/cmm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,6 @@ val map_tail: (expression -> expression) -> expression -> expression
to all inner sub-expressions that can produce the final result.
Same disclaimer as for [iter_shallow_tail] about the notion
of "tail" sub-expression. *)

val map_shallow: (expression -> expression) -> expression -> expression
(** Apply the transformation to each immediate sub-expression. *)
Loading

0 comments on commit 9e27c29

Please sign in to comment.