Repository activity
40458 results across all weeks
Compiler: make the JS lexer state mutable
Based on #2503; the diff is the single commit on top of it.
hhugoCompiler: recursive-descent JavaScript parser
Replace the Menhir-based JavaScript parser (Parse_js) with a hand-written recursive-descent parser over the same Flow lexer.
hhugoCompiler: remove redundant array bound checks late
Specialize_js makes array bound checks explicit in the first optimization round, and only removes those which are redundant within a block. A new pass, run once the program is optimized (in Specialize_js.f_once_after), removes a check when the same array and index (the same variable, or the same constant) were already checked in a dominating position: the le…
Jérôme Vouillon (@vouillon)Compiler: use the bytecode hint on integer equality tests
With OCaml 5.6, EQ and NEQ instructions implementing an integer equality test (rather than a physical comparison) carry the hint Hint_int_equality_test (ocaml/ocaml#15135). Record it in the IR as Eq { int_only } / Neq { int_only }.
Jérôme Vouillon (@vouillon)Conversion counters
This adds two debug flags that count, at run time, the representation conversions executed by code compiled with wasm_of_ocaml. The counts are exact and deterministic, unlike timings. That makes them useful for judging changes to how numbers are represented: unboxing, int typing, or where conversions are placed.
Jérôme Vouillon (@vouillon)Extract loops from toplevel function into helper functions
Extract outermost loops of the entry function into helper closures, so engines tier up the small helpers instead of the giant initialization code. The pass benefits both JavaScript and WebAssembly output.
Jérôme Vouillon (@vouillon)Inlining improvements
Jérôme Vouillon (@vouillon)JavaScript output fixes
do not emit ES2021 logical assignments
Jérôme Vouillon (@vouillon)More bytecode optimization hints (immediate reads, variant tests) -
ocaml/ocaml#15122 provides two more pieces of information from Lambda in the bytecode hints.
Jérôme Vouillon (@vouillon)No longer call wasm-opt with --opt 1
We skip calling wasm-opt with --opt 1. Expected benefits:
Jérôme Vouillon (@vouillon)Optimize exceptions
Jérôme Vouillon (@vouillon)Optimize the placement of conversions: (un)boxing, (un)tagging, normalization
Jérôme Vouillon (@vouillon)Prepare for Oxcaml 5.4
Jérôme Vouillon (@vouillon)Range analysis
Jérôme Vouillon (@vouillon)Refined typing
Jérôme Vouillon (@vouillon)Runtime/wasm: check the size of arrays of arbitrary length
As in OCaml, arrays have at most Max_wosize = 2^28 - 1 elements, and float arrays half as many (Sys.max_array_length and Sys.max_floatarray_length). Array.make and the float array functions used to reject arrays of exactly these sizes; they now accept them, and Float.Array.create raises Invalid_argument "Float.Array.create" as in OCaml.
Jérôme Vouillon (@vouillon)Runtime: fix Str.string_partial_match
Port ocaml/ocaml#15113 (OSEC-2026-21): after a partial match, a group can have its start after its end, which made Str.replace_matched and Str.matched_group fail (out-of-bounds access in Wasm). Treat such groups as not matched, in both runtimes.
Jérôme Vouillon (@vouillon)Runtime: support Sys.filepath_exists (OCaml 5.6)
Port ocaml/ocaml#14974: caml_sys_filepath_exists is like caml_sys_file_exists, but only returns false when the path does not exist (ENOENT or ENOTDIR) and raises Sys_error on other errors.
Jérôme Vouillon (@vouillon)Small JS output improvements
Jérôme Vouillon (@vouillon)Tests: raise Wizard's stack limit
Wizard now caps the number of stacks (2048 by default), while evenodd.ml nests 10000 of them.
Jérôme Vouillon (@vouillon)