Fix some bugs with fb_setprofile in ARM mode
commitd5db0d8b98c4cbf9fbc71bca3f406bbacbe0fbbe
authorOwen Yamauchi <oyamauchi@fb.com>
Tue, 29 Oct 2013 16:07:59 +0000 (29 09:07 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 30 Oct 2013 00:05:58 +0000 (29 17:05 -0700)
tree088c2aa421791bfd2422170cf1a1abacb0041ad4
parenta2704716f4a8cea8db2c0619a5ccb853d9fc2a5a
Fix some bugs with fb_setprofile in ARM mode

- Have separate stubs for the three return helpers. They don't need to
  be implemented yet, but they all need to have distinct addresses
  because we compare against retInlHelper directly to determine whether
  to run function-exit hooks.

- This exposed a bug in cgGuardRefs, where the "is logical immediate"
  assert was firing. This time I actually invested real time into
  understanding what the hell's going on there and rewrote the thing
  properly. (There are still some improvements to be had: most notably,
  when the mask is a single bit, we can use Tst instead of And-Cmp.)

- Fixups done on faked-up ARs in the simulator's catch block were
  succeeding, but not ones done from VMRegAnchors. The underlying cause
  is that the VM stack is not participating in the native frame pointer
  chain, because we're not using native call instructions to get into or
  out of the TC. I added logic to FixupMap that looks at the stack of
  simulators stored in ExecutionContext, and reads their registers to
  look for the place to apply the fixup.

Reviewed By: @edwinsmith

Differential Revision: D1032483
hphp/runtime/vm/jit/code-gen-arm.cpp
hphp/runtime/vm/jit/code-gen-helpers-arm.cpp
hphp/runtime/vm/jit/code-gen-helpers-arm.h
hphp/runtime/vm/jit/fixup.cpp
hphp/runtime/vm/jit/fixup.h
hphp/runtime/vm/jit/unique-stubs-arm.cpp
hphp/vixl/a64/assembler-a64.h
hphp/vixl/a64/simulator-a64.h