Repository activity
40458 results across all weeks
Structured mangling: mark partial applications with the callee's path
Accidental partial application is a real performance hazard, yet the closures the compiler creates for it were either invisible or opaque in symbol names.
Kevin Svetlitski (@Svetlitski)Structured mangling: number anonymous functions instead of embedding positions
Previously, the mangled names for lambdas and anonymous modules contained their exact
Kevin Svetlitski (@Svetlitski)Support coercions for template functors
There's a new test that shows that this can actually merge curried functors together. This happens for normal functors too but because slambda eval currently only supports single argument functors it currently breaks things. I'm planning on implementing partial application soon so I've left it as a test to fix.
Jack Rickard (@Skepfyr)Support for abstract types in law parsing
This PR adds parsing support for abstract types (type a) to law_ and law_?.
Simon Spies (@spiessimon)Suppress backtraces for jsir/link_units_raise.ml test
Previously this test incorrectly failed if the background environment set OCAMLRUNPARAM="b=1", due to backtraces.
Leo Lee (@smjleo)TMC now closes regions before recursing
Previously, TMC annotated functions that had local allocation failed to close the region before recursing, leading to these functions using unbounded stack space. This commit changes the TMC pass to attempt to close the region when safe to do so. In the event it's not safe, we now raise a warning instead of silently producing a function that behaves unexpect…
Aaron Eline (@aaronjeline)The body of an array comprehension has no region
The body of an array comprehension has no region of its own, so what it allocates on the local stack stays until the function returns: 24 bytes for each element here, where the same body in a for loop uses 24 bytes in all. Under ulimit -v 200000 a comprehension of 4,000,000 elements ends with Local allocation stack overflow.
Mark Shinwell (@mshinwell)The code of a functor inlined at all its uses stays in the object file, and an `[@inlined]` call in it gets warning 55
Make is inlined at both applications, and in each copy of run the call (X.step [@inlined]) x is inlined. The code of run made for the functor's own body stays in the object file, called by nothing, and the compiler gives warning 55 for the call in it.
Mark Shinwell (@mshinwell)The n-way join keeps a code ID that one input does not have
With -flambda2-join-algorithm n-way (and -O2 or -O3; also with -O3 -flambda2-match-in-match, which forces that join) a correct OCaml program stops at runtime on an Invalid that Simplify put in place of a live call, and the zero_alloc check accepts a function that allocates. With the default (binary) join both programs behave correctly.
Mark Shinwell (@mshinwell)The tail call inside a function applied where it is written (`e |> fun a -> f a`) is lost when the caller allocates locally
e |> fun a -> loop (n - 1) a as the last expression of a function that allocates on the local stack (here a comparison of two tuples) does not run in constant stack in native code; so do (fun a -> ...) @@ e and (fun m a -> ...) n e. Bytecode and OCaml 5.4.0 run it in constant stack.
Mark Shinwell (@mshinwell)To_cmm: branch on the tagged value for a boolean returned by a call
To_cmm branches on the tagged value when a two-arm switch scrutinee is an untagging, but that information was lost when the untagged variable passed through an alias. This happens for if f x then ..., where the return continuation's parameter is unboxed, giving (if (>>s r 1) a b) (sar; test; je on x86-64). Env.add_alias now carries the information across, gi…
Mark Shinwell (@mshinwell)Translate dereference patterns `deref_` to lambda
This PR finishes initial support for dereference patterns by implementing their translation to lambda.
Benjamin Peters (@bn-peters)Treat classes in modules as `@@ dynamic`
Since classes are always dynamic, make class items in modules appear under an implicit @@ dynamic, when determining the staticity of the module.
Ryan Tjoa (@rtjoa)Tweak the `Apply_non_function` error message
Editors (and humans, to a certain extent) place more emphasis on the first thing they're told. If a function is applied to too many arguments, we dutifully state the type error first, but it is perhaps better to explain the problem (too many arguments) and then the reason (the function's type) second. For unit-returning functions, we already correctly insert…
David Allsopp (@dra27-js)Type checking for laws
Following #7917, this PR adds type checking for law? in signatures and structures. The core of type checking these is pretty straightforward: every clause must type check as Boolean, and then the translation in Translspec is used to turn the clauses into Typedtree.spec_expression and Spec.expression.
Simon Spies (@spiessimon)Update docs to mention failed CAS instructions count as non-atomic loads
In its current state, it was unclear how failed CAS instructions were treated. If they counted as atomic loads, they would've required an acquire fence before the CAS instruction. It was decided to treat them as non-atomic loads. This adds a comment explaining the decision.
yusumez-jsUpdate dune manifest format for cmx availability
This commit updates the Dune manifest reader to reflect the new format for CMX availability. Previously, a line like the following meant a unit's cmx files were guaranteed to be present:
Joe Kerrigan (@joe-kerrigan)Use 'f' and 'm' instead of 'file' and 'manifest' in dune manifest
Move to more concise spellings to improve filesize. We still accept the expanded forms for backward compatibility.
Joe Kerrigan (@joe-kerrigan)Use DFS for CFG dead-block reachability
This pull request simplifies the
Xavier Clerc (@xclerc)Use naked Boolean_not for switches that negate a naked boolean
Top of the stack; follows up the review comment on #8209 about simplify_switch_expr.ml.
Mark Shinwell (@mshinwell)