Simplify and fix Eval.FailJitPrologs
commitdd668e0880ebcbcd0bad52c159be66dd07ff84b6
authorJan Oravec <jan@fb.com>
Sun, 6 Oct 2019 06:00:18 +0000 (5 23:00 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 6 Oct 2019 06:03:09 +0000 (5 23:03 -0700)
treef5681c9e767f6f2d24d1d9b683cb18a0ce3be599
parent114ae409889875f82d8b451f20cbcebfcead14d2
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
hphp/runtime/vm/jit/mcgen-prologue.cpp
hphp/runtime/vm/jit/service-request-handlers.cpp
hphp/runtime/vm/jit/unique-stubs.cpp