From: Matthew F. <no...@gi...> - 2019-06-14 10:37:55
|
Branch: refs/heads/master Home: https://github.com/MLton/mlton Commit: e0cbba9d28cd0c95640bc331d18ab85465e55be9 https://github.com/MLton/mlton/commit/e0cbba9d28cd0c95640bc331d18ab85465e55be9 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-12 (Wed, 12 Jun 2019) Changed paths: M mlton/backend/rep-type.fun M mlton/backend/runtime.fun M mlton/backend/runtime.sig M mlton/main/compile.fun M mlton/main/lookup-constant.fun Log Message: ----------- Eliminate unused `Runtime.MaxFrameSize` Commit: 6a0a2320645df9c751647a0539bc619b37239828 https://github.com/MLton/mlton/commit/6a0a2320645df9c751647a0539bc619b37239828 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-12 (Wed, 12 Jun 2019) Changed paths: M mlton/backend/rep-type.fun M mlton/backend/runtime.fun M mlton/backend/runtime.sig M mlton/main/compile.fun M mlton/main/lookup-constant.fun Log Message: ----------- Eliminate unused `Runtime.CurrentThread` Commit: d49793585c48b711f914c56c115782b4b43a7ff2 https://github.com/MLton/mlton/commit/d49793585c48b711f914c56c115782b4b43a7ff2 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-12 (Wed, 12 Jun 2019) Changed paths: M mlton/atoms/prim.fun M mlton/atoms/prim.sig M mlton/backend/rep-type.fun M mlton/backend/ssa2-to-rssa.fun Log Message: ----------- Introduce `GC_state` primitive, translated to `GCState` RSSA operand This primitive will replace the use of `_symbol "gcStateAddress"` in the Basis Library implementation. One motivation is that it eliminates two "names" for the same thing; the RSSA `GCState` operand and the pointer fetched from `gcStateAddress`. Another motivation is that the CMU MultiMLton compiler cannot use `_symbol "gcStateAddress"`, because this fetches the primary (aka, pthread0) `gcState` address once at the beginning of the evaluation of the Basis Library, but each use of the value should actually be with respect to the `gcState` of the executing pthread. In the Basis Library, the type of `Primitive.MLton.GCState.t` is `Pointer.t` (which is the primitive type `cpointer`, which becomes the RSSA IL type `CPointer`), but in the RSSA IL, the type of the `GCState` operand is `GCState`. One option would be to introduce a new primitive type `gcstate` to become the RSSA `GCState` type; however, this would affect all of the intermediate ILs. Moreover, the RSSA type checking of `GCState` is somewhat weak, so it seems simpler to simply replace the RSSA `GCState` type with the RSSA `CPointer` type. (Similarly, we replace the RSSA `ExnStack` type with the RSSA `Word` type of the appropriate size.) Commit: 4fe198c2525b8224d0d3aaa673a52b67b78bf6d6 https://github.com/MLton/mlton/commit/4fe198c2525b8224d0d3aaa673a52b67b78bf6d6 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-12 (Wed, 12 Jun 2019) Changed paths: M basis-library/mlton/call-stack.sml M basis-library/mlton/cont.sml M basis-library/mlton/gc.sml M basis-library/mlton/profile.sml M basis-library/mlton/thread.sml M basis-library/mlton/world.sml M basis-library/primitive/prim-mlton.sml Log Message: ----------- Use `GC_state` primitive instead of `_symbol "gcStateAddress"` One motivation is that it eliminates two "names" for the same thing; the RSSA `GCState` operand and the pointer fetched from `gcStateAddress`. Another motivation is that the CMU MultiMLton compiler cannot use `_symbol "gcStateAddress"`, because this fetches the primary (aka, pthread0) `gcState` address once at the beginning of the evaluation of the Basis Library, but each use of the value should actually be with respect to the `gcState` of the executing pthread. Commit: 92b532131a8f4b27e9f50b80d889ce0ddb309508 https://github.com/MLton/mlton/commit/92b532131a8f4b27e9f50b80d889ce0ddb309508 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-12 (Wed, 12 Jun 2019) Changed paths: M include/common-main.h Log Message: ----------- Eliminate global `gcStateAddress` Commit: 521bbf49235d7cd9b33ea53ef3eea56a67e6b192 https://github.com/MLton/mlton/commit/521bbf49235d7cd9b33ea53ef3eea56a67e6b192 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M runtime/platform.h Log Message: ----------- Make `GCState_t` visible when including `basis-ffi.h` Commit: b4425634e84f9481f1555cbdc3ca3174b7d0c5ab https://github.com/MLton/mlton/commit/b4425634e84f9481f1555cbdc3ca3174b7d0c5ab Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M mlton/codegen/c-codegen/c-codegen.fun Log Message: ----------- Translate `Word_rndToReal` primitive to `CCall` for C codegen When `Word<N>_rndToReal<M>` is treated as a primitive in the C codegen, then the function is not declared with a prototype. Currently, the prototype is picked up by `#include "basis-ffi.h"` in `c-chunk.h`, but that will be removed in the next commit. Commit: 21ea126e74cabc01fc5959f7b0e40f046eb647d7 https://github.com/MLton/mlton/commit/21ea126e74cabc01fc5959f7b0e40f046eb647d7 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M include/c-chunk.h Log Message: ----------- Omit `#include "basis-ffi.h"` in c-chunk.h Commit: 4bcae43ee4320ef314e920ef6408f0d9a7484305 https://github.com/MLton/mlton/commit/4bcae43ee4320ef314e920ef6408f0d9a7484305 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M basis-library/mlton/rusage.sml M basis-library/primitive/basis-ffi.sml M basis-library/primitive/prim-mlton.sml M runtime/basis-ffi.h M runtime/basis/MLton/Rusage/rusage.c M runtime/gen/basis-ffi.def M runtime/gen/basis-ffi.h M runtime/gen/basis-ffi.sml Log Message: ----------- Eliminate `extern struct GC_state gcState` in `MLton/Rusage/rusage.c` Commit: f7b0d35f1b8f949b116f14eb4d036937a73c6d26 https://github.com/MLton/mlton/commit/f7b0d35f1b8f949b116f14eb4d036937a73c6d26 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M basis-library/mlton/signal.sml M basis-library/primitive/basis-ffi.sml M runtime/basis-ffi.h M runtime/basis/Posix/Signal.c M runtime/gen/basis-ffi.def M runtime/gen/basis-ffi.h M runtime/gen/basis-ffi.sml Log Message: ----------- Almost eliminate `extern struct GC_state gcState` in `Posix/signal.c` Commit: 55cba62f114c4abde2873523843bd2b02711f585 https://github.com/MLton/mlton/commit/55cba62f114c4abde2873523843bd2b02711f585 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M runtime/basis/Posix/Process/fork.c M runtime/gc/signals.c M runtime/gc/signals.h Log Message: ----------- Eliminate `extern struct GC_state gcState` in `MLton/Posix/fork.c` It is still the case that on Darwin, a forked process does not inherit the alternate signal stack; Commit: 7483eb66e1365489ea739655e6f1a6eca50d76da https://github.com/MLton/mlton/commit/7483eb66e1365489ea739655e6f1a6eca50d76da Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M runtime/gc/signals.c Log Message: ----------- Simplify `initSignalStack`. Commit: 080daa8f5833b83c2698ade8f51c2de909076dd8 https://github.com/MLton/mlton/commit/080daa8f5833b83c2698ade8f51c2de909076dd8 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M include/amd64-main.h M include/c-main.h M include/common-main.h M include/x86-main.h M mlton/codegen/c-codegen/c-codegen.fun Log Message: ----------- Move declaration of global `gcState` to `<cg>-main.h`. Commit: 0444115a9c94aaeeaf2215ad975a50748a799e01 https://github.com/MLton/mlton/commit/0444115a9c94aaeeaf2215ad975a50748a799e01 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M include/amd64-main.h M include/c-main.h M include/x86-main.h M runtime/gc/gc_state.h Log Message: ----------- Introduce `GC_state MLton_gcState()` to fetch the global gcState `MLton_gcState` is used to fetch the global gcState in contexts where it is not easily available; in particular, during program initialization (MLton_main, LIB_OPEN), program termination (LIB_CLOSE), program reentry (MLton_callFromC), and signal handlers (GC_handler). This will allow the global gcState to be a static variable allocated by `<cg>-main.h`. This will also help the CMU MultiMLton project (help to minimize the diff with MLton), where `MLton_gcState` will fetch the pthread specific `gcState`. Commit: ad3d221e620f9abffd181fd00ac9d5c6a5869e8c https://github.com/MLton/mlton/commit/ad3d221e620f9abffd181fd00ac9d5c6a5869e8c Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M runtime/basis/Posix/Signal.c M runtime/gc/handler.c M runtime/gc/handler.h Log Message: ----------- Eliminate `extern struct GC_state gcState` in `Posix/signal.c` Use `MLton_gcState` in `GC_handler` to fetch the global gcState. Commit: f12937beeae958d9ba4ea901cd698036980476e2 https://github.com/MLton/mlton/commit/f12937beeae958d9ba4ea901cd698036980476e2 Author: Matthew Fluet <mat...@gm...> Date: 2019-06-13 (Thu, 13 Jun 2019) Changed paths: M include/c-main.h Log Message: ----------- Make `gcState` a static local var of `MLton_gcState` in C and LLVM codegens Commit: 1672f09db33d1120a693d7d54c076ecf76b3a75e https://github.com/MLton/mlton/commit/1672f09db33d1120a693d7d54c076ecf76b3a75e Author: Matthew Fluet <Mat...@gm...> Date: 2019-06-14 (Fri, 14 Jun 2019) Changed paths: M basis-library/mlton/call-stack.sml M basis-library/mlton/cont.sml M basis-library/mlton/gc.sml M basis-library/mlton/profile.sml M basis-library/mlton/rusage.sml M basis-library/mlton/signal.sml M basis-library/mlton/thread.sml M basis-library/mlton/world.sml M basis-library/primitive/basis-ffi.sml M basis-library/primitive/prim-mlton.sml M include/amd64-main.h M include/c-chunk.h M include/c-main.h M include/common-main.h M include/x86-main.h M mlton/atoms/prim.fun M mlton/atoms/prim.sig M mlton/backend/rep-type.fun M mlton/backend/runtime.fun M mlton/backend/runtime.sig M mlton/backend/ssa2-to-rssa.fun M mlton/codegen/c-codegen/c-codegen.fun M mlton/main/compile.fun M mlton/main/lookup-constant.fun M runtime/basis-ffi.h M runtime/basis/MLton/Rusage/rusage.c M runtime/basis/Posix/Process/fork.c M runtime/basis/Posix/Signal.c M runtime/gc/gc_state.h M runtime/gc/handler.c M runtime/gc/handler.h M runtime/gc/signals.c M runtime/gc/signals.h M runtime/gen/basis-ffi.def M runtime/gen/basis-ffi.h M runtime/gen/basis-ffi.sml M runtime/platform.h Log Message: ----------- Merge pull request #318 from MatthewFluet/gcstate-fields-and-prim Update use of global `struct GC_state` in compiler and Basis Library Simplify how the compiler proper and the Basis Library use the global `struct GC_state`. One motivation for these changes is to minimize the diff between MLton and the CMU MultiMLton project. Highlights: * Eliminate unused `Runtime.CurrentThread` and `Runtime.MaxFrameSize` in `structure BackendAtoms` (e0cbba9d2, 6a0a23206). * Introduce `GC_state` primitive, translated to `GCState` RSSA operand (d49793585), which is used instead of `_symbol "gcStateAddress"` in the Basis Library implementation (4fe198c25, 92b532131). * Eliminate `extern struct GC_state gcState` in `runtime/basis/` (4bcae43ee, f7b0d35f1, 55cba62f1, ad3d221e6). * Introduce `GC_state MLton_gcState()` to fetch the global `struct GC_state` (0444115a9). Compare: https://github.com/MLton/mlton/compare/324b32c16865...1672f09db33d |