Add an imploding if-then-else vasm construct
commitb276128cc973b3b8e9f0c77887972b88cfd9ebe1
authorMax Wang <mwang@fb.com>
Thu, 23 May 2019 20:01:22 +0000 (23 13:01 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 23 May 2019 20:07:23 +0000 (23 13:07 -0700)
treee0172f9be97f55d4121febcd8f9097723e4f76db
parentb7c5054e3f4f1a0fe9cf4efd7335375b9d97d221
Add an imploding if-then-else vasm construct

Summary:
The use case here is v/darray polymorphism logging.  We want to
determine whether a given v/darray typehint sees both varray and darray
arguments, but we don't want to log with every single function
invocation (and ideally, we wouldn't even do the v/darray bit check).

To accomplish this, we use a smashable mov in the TC to flag if we've
hit each side of the branch.  If both sides are hit, we then smash a jmp
to skip over the whole sequence.

In the case where both sides of the branch are taken, this largely
eliminates the cost in the steady state.  If only one branch is taken,
this at least avoids the call, though not the branch itself.

Reviewed By: jjgriego

Differential Revision: D14197287

fbshipit-source-id: a5faf04acc60eb488e563e2b43005f696a8d5997
16 files changed:
hphp/runtime/vm/jit/cg-meta.h
hphp/runtime/vm/jit/code-gen-cf.h
hphp/runtime/vm/jit/vasm-arm.cpp
hphp/runtime/vm/jit/vasm-gen-inl.h
hphp/runtime/vm/jit/vasm-gen.h
hphp/runtime/vm/jit/vasm-info.cpp
hphp/runtime/vm/jit/vasm-instr.cpp
hphp/runtime/vm/jit/vasm-instr.h
hphp/runtime/vm/jit/vasm-internal-inl.h
hphp/runtime/vm/jit/vasm-internal.cpp
hphp/runtime/vm/jit/vasm-internal.h
hphp/runtime/vm/jit/vasm-ppc64.cpp
hphp/runtime/vm/jit/vasm-unit.h
hphp/runtime/vm/jit/vasm-x64.cpp
hphp/runtime/vm/jit/vasm.cpp
hphp/runtime/vm/jit/vasm.h