Repository activity
40458 results across all weeks
Improve warnings on `deref_` with unused variables
This makes warnings on unused deref_ patterns more strict:
Benjamin Peters (@bn-peters)Include dependent (off-heap) bytes in GC ramp work
Gc.ramp_up and Gc.ramp_down allow the GC to account for "ramp-like" behaviour: "ramping up", when long-lived data structures are building up on the major heap, and "ramping down" when some previously ramped-up structure dies.
Nick Barnes (@NickBarnes)Incorrect/Illegal substitution of code in to_cmm
To_cmm has the ability to perform substitution of code, and it some situations, it can perform illegal substitutions, that result in miscompilations and (in the best of cases ?) segmentation faults.
Guillaume Bury (@Gbury)Interleaved blocks
This PR changes the layout of blocks on the OxCaml heap, to allow blocks with arbitrary arrangements of scannable and non-scannable words.
Nick Barnes (@NickBarnes)Introduce Compilation_unit_intf to identify interfaces
Stacked on #7505. #7507 and #7031 are based on this PR.
Zesen Qian (@riaqn)Introduce `-dprofile-level` and use it to reduce profile output in cfg
~~API sucks - WIP~~ API will do!
David Allsopp (@dra27-js)JSIR: add sourcemaps to stdlib and otherlibs
Previously JSIR-compiled apps couldn't load the sources for stdlib and otherlibs as they were not included in the compiler distribution. For compiler-libs the sourcemap is still not included, as their sources aren't installed. This is the same behaviour as in bytecode.
Leo Lee (@smjleo)JSIR: correct event emissions
Previously, debug events in JSIR were emitted around every primitive, and never around function applications, which differs from the bytecode JSOO behaviour. This PR corrects the event emissions in the JSIR pass so that they align with the bytecode JSOO path. In particular:
Leo Lee (@smjleo)JSIR: disable JSIR tests for effects/test_lazy
It is broken on JSIR, but nix builds don't run it due to multicore being disabled.
Leo Lee (@smjleo)JSIR: don't truncate block index accesses too early
Flambda represents block indices as int64 byte offsets. Since we treat every slot to be 8 bytes wide, in JSIR we right-shift this value by 3 to get the corresponding index. However, the current implementation truncates the byte offset to 32-bit integers first before right-shifting, which can throw away the 3 highest bits in the index. This PR recovers these …
Leo Lee (@smjleo)JSIR: emit static definitions in valid dependency order
The previous PR in the stack (#7796) exposed a bug in the JSIR translation, where we can emit a closure which uses some symbol, followed by the definition of that symbol. That happened to be fine so far because of a quirk in the JSOO simplifier.
Leo Lee (@smjleo)JSIR: fix and align primitives with bytecode
There were a few instances where we didn't align with bytecode behaviour, and one instance where we need a new compile-time constant. In particular:
Leo Lee (@smjleo)JSIR: global symbol table improvements
JSIR uses a global symbol table to deal with cross-unit symbol references, but our implementation was heavily unoptimised. This PR makes two closely-related improvements:
Leo Lee (@smjleo)JSIR: implement a linker for whole-program compilation
We combine a list of JSIR programs into a single JSIR program, so that we can perform whole-program optimisations using JSOO. We still keep the existing "separate compilation" mode as the default (which uses the JSOO linker instead), and add a -link-jsir flag for whole-program mode. See README on further details on how the linker works, but it is conceptuall…
Leo Lee (@smjleo)JSIR: improve debugging info support and documentation
In particular:
Leo Lee (@smjleo)JSIR: redirect classic mode to Default
Classic mode is unsupported in JSIR mode, as classic mode can emit technically invalid Flambda that JSIR mode doesn't know how to handle. (The JSIR pass also doesn't know how to deal with function calls with erased callee, as code IDs aren't exposed across modules - but this is only relevant for classic mode as far as I can tell, so we can fix this later.)
Leo Lee (@smjleo)JSIR: rename JSIR-related file extensions
As discussed internally:
Leo Lee (@smjleo)JSIR: small fixes for build system
when ocamlopt is called with -linkall, we don't pass in --linkall to js_of_ocaml compile nor keep around global registrations in whole-program mode, to align with existing bytecode behaviour (this is what the build system expects).
Leo Lee (@smjleo)JSIR: small fixes for parameterised libraries
Parameterised libraries don't currently work with JSIR due to two small reasons:
Leo Lee (@smjleo)JSIR: support wasm_of_ocaml output
As per title. In particular, while the JSIR format itself is identical between js_of_ocaml and wasm_of_ocaml, we need to change some of the code generation in our JSIR pass when we are targeting Wasm.
Leo Lee (@smjleo)