Emit func prologues using HHIR and vasm
Summary: First step towards making func prologues coalescable with PGO regions:
Emit them using the HHIR and vasm machinery instead of with raw
assemblers.
This diff only handles non-closure, non-magic functions. Support for
closures may come after some of the cleanup described in t6779320.
Changes include the following:
- Add a CodeKind argument to genCode() and a cross-trace ABI to support
func prologue codegen.
- Add HHIR opcodes for supporting func prologues: RaiseMissingArg,
StLocRange, EnterFrame, CheckStackOverflow, InitExtraArgs{,X}, and
CheckSurpriseFlagsEnter.
- Introduce vasm instructions to support func guards: cmpqims and
ldimmqs for emitting smashable instructions, jcci for conditional
jumps with immediate targets, and popm for func entry.
- Squeeze an extra bit into SrcKey to indicate whether it corresponds to
the func prologue occurring before the source location.
The genFuncPrologue() interface should be considered temporary, to be
replaced by a mechanism for spitting out an IRUnit and gluing it into a
profiled region.
Reviewed By: @jdelong
Differential Revision:
D2062303