Store num args instead of offset in prologue and func entry SrcKeys
Summary:
If some default value arguments are not used, hhbbc optimizations may merge
multiple DV initializers together. This is problematic for prologues and func
entries, as SrcKeys for different number of arguments have the same offset and
thus become equal.
This did not cause any real issues yet, but it affects the next diff, which
performs argument type checks in prologues and assert expected types in func
entries.
Fix this by storing the number of passed args in prologue and func entry
SrcKeys instead of using the entry offset.
Kill the ambiguous Func::getEntryNumParams() API to prevent future issues.
Since tc-print may not have access to Func data, it may not be able to resolve
offsets for prologue and func entry SrcKeys. This affects all SrcKeys if repo
file is not available and all TransRec::src SrcKeys, as their func id is not
patched (and couldn't because the original func id is used elsewhere). Address
this by defaulting to the main entry offset of 0 and including additional data
about the number of passed arguments. The DV funclets are on their way out
anyway so the offset 0 will eventually become correct.
Reviewed By: mofarrell
Differential Revision:
D38685176
fbshipit-source-id:
f9f572295a6d2610c9f2f977b112b4d669ba58be