Experiment with some static evalution#2153
Draft
vouillon wants to merge 11 commits into
Draft
Conversation
- 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.