Skip to content
hhugo edited this page Apr 21, 2020 · 2 revisions

General

Switch-case

Outdated since https://github.com/v8/v8/commit/b0bcee3e62f67d2cf5cc8627a47accce42981605.

V8 bailout when switches contains more than 128 case. Js_of_ocaml splits big switches with conditionals. Use "-set switch_size=limit" to the maximum number of cases.

Inlining

  • Some constructs are not being optimized by JIT compilers (eval, try_catch). Js_of_ocaml tries to preserve optimizable function by not inlining such not-optimized constructs (see https://github.com/ocsigen/js_of_ocaml/pull/230)

  • Some constructs containing constants are not being optimized if those constants are aliased by variables. Js_of_ocaml doesn't alias "number" constant string so that typeof x === "number" gets optimized. The same for constant patterns in switch case.

Clone this wiki locally