Skip to content

Conversation

@DZakh
Copy link
Member

@DZakh DZakh commented Aug 7, 2024

No description provided.

(* fast path, and keep track of simple bindings to unboxable numbers *)
Llet(Strict, Pgenval, id, param, body)
| _ ->
(* Turn off such optimization to reduce diff in the beginning - FIXME*)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An interesting optimisation, which might be worth resurrecting in the future
image

Comment on lines 2312 to 2316
let tag = Ident.create "tag" in
let tests =
List.fold_right
(fun (path, act) rem ->
let ext = transl_extension_path ex_pat.pat_env path in
Lifthenelse(Lprim(extension_slot_eq , [Lvar tag; ext], loc),
act, rem))
nonconsts
default
in
Llet(Alias, Pgenval,tag, arg, tests)
List.fold_right
(fun (path, act) rem ->
let ext = transl_extension_path ex_pat.pat_env path in
Lifthenelse(Lprim(extension_slot_eq , [arg; ext], loc),
act, rem))
nonconsts
default
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristianoc this code is commited by mistake from my investigation on how the try/catch compilation works.

I couldn't figure where the tag Llet is used, so I removed it. Could you correct me If I'm wrong.

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you undo changes not related to the flag and put them in a separate PR?

@DZakh
Copy link
Member Author

DZakh commented Aug 8, 2024

@cristianoc cristianoc merged commit 8a28daf into rescript-lang:master Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants