Skip to content

Experiment with some static evalution#2153

Draft
vouillon wants to merge 11 commits into
masterfrom
static-eval
Draft

Experiment with some static evalution#2153
vouillon wants to merge 11 commits into
masterfrom
static-eval

Conversation

@vouillon
Copy link
Copy Markdown
Member

No description provided.

vouillon added 9 commits May 21, 2026 22:03
- Add fuel counter (1000) to prevent divergence on cyclic CFG.
- Gate debug eprintf calls behind Debug.find "static-eval".
- Inner Apply: build callee env from Var.Map.empty so caller locals
  don't leak into the callee body.
- Cond: replace `assert false` (would crash on unexpected operand) with
  fall-through to `None`; drop spurious `Tuple` arm.
- caml_obj_dup / Constant cases: add Float32 and Null_ to the
  immediate-constant set.
Match the kinds already used by the JS backend in compiler/lib/generate.ml:
- Pure: caml_alloc_dummy{,_float,_mixed}, caml_js_{to_int32,to_nativeint,
  from_bool,to_bool}
- Mutable: caml_array_unsafe_get, caml_js_{,strict_}equals
vouillon added 2 commits May 22, 2026 00:21
A returned Tuple/Float_array constant would lose the array_or_not and
field-type information the back-end needs (notably for float records),
miscompiling e.g. let f x = { x; y = 2. } -> f 1.. Keep the original
Apply in that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant