accumulate hackc Profiles while computing crc
commita3f11ae707cacca01ca0c082bedca63172bcce9e
authorEdwin Smith <smith@fb.com>
Thu, 24 Feb 2022 19:16:56 +0000 (24 11:16 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 24 Feb 2022 19:16:56 +0000 (24 11:16 -0800)
tree03c915a192012985d234c6344653c157a9f1c48c
parent541157679c7da14791933e7f64bb1deafdf98366
accumulate hackc Profiles while computing crc

Summary:
I've added `codegen_bytes` to hackc's `compile::Profile` so we can measure
cumulative allocation in hackc's emitter arena.

In order to collect profiles, we need to run the compiler with a NativeEnv.
This changes the way default options are computed and introduces unwanted
changes to the bytecode. After a lot of trial and error I found the right combination
of options that matches what you get with a None NativeEnv.

Also, when attempting to run bc_compare.py on ~/www/flib, I see stack overflows
even though it uses elastic stack. I gave up debugging and hardcoded 32MB
stack for rayon workers in crc.rs.

Reviewed By: aorenste

Differential Revision: D34241123

fbshipit-source-id: 81f8a0002486b11319a2a3659691c5eff452f64b
hphp/hack/src/hackc/compile/compile.rs
hphp/hack/src/hackc/emitter/emit_expression.rs
hphp/hack/src/hh_compile/compile.rs
hphp/hack/src/hh_compile/crc.rs