Simplify and fix Eval.FailJitPrologs
Summary:
While this option is used only for debugging and in a single unit tests, it did
not work properly in certain situations for unknown function calls.
Known function calls would first hit the bind call stub, which would call
handleBindCall(), which JITs the prologue (includes storing it in the func's
prologue table), but then ignores it, falls back to the fcall helper stub,
which ignores the JITed prologue again and properly goes to the doFCall.
Unknown function calls go to the redispatch helper to lookup the prologue. The
default prologue entry points to the fcall helper stub, so we would be avoiding
the prologue as expected.
However, if the callee was already called using a known function call, the
prologue entry points to a prologue, which would be used by the redispatch
helper, failing to honor the request of the FailJitPrologs option.
Fix this by moving the check to the mcgen::getFuncPrologue(), after checking
the cache, so the cost is incurred only on the slow path.
Allows simplifying fcallHelper further.
Reviewed By: ricklavoie
Differential Revision:
D17774207
fbshipit-source-id:
2c585d8a5fe6d0973451259b37e33f736ea360b3