Implement function prologues in ARM
commit0e34715a4a483a0e9bb51ce44254671f71e6f27f
authorOwen Yamauchi <oyamauchi@fb.com>
Tue, 15 Oct 2013 16:25:06 +0000 (15 09:25 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 23 Oct 2013 15:24:33 +0000 (23 08:24 -0700)
tree4a52684f41ede4dfabf92556448ce1bda1f65b58
parentebb082916f5fe3eff3566cbabab867c1f89fe9c7
Implement function prologues in ARM

This is mainly what's holding us back in test/quick. There's a lot of
stuff going on here:

- Adding code-gen-helpers-arm.cpp. There's a practical need for this:
  we're starting to write out a lot of calls to C++ functions, which
  should be abstracted out because it happens differently depending on
  whether we're simulating ARM or running on native ARM.

- Initialize rStashedAR when starting the simulator. This was a bug.

- Change the order of pushing x29 and x30 around calls to properly mimic
  the x64 stack frame.

- Implement fcallHelperThunk.

- Templatize a couple of vixl functions to let us move pointers into
  registers without reinterpret_cast. Also fill the simulator stack with
  junk before starting up a simulator; in an early version of this diff
  we were actually reading from the stack out-of-bounds. It wasn't
  causing any bugs, but let's get out ahead of that.

Reviewed By: @jdelong

Differential Revision: D1019980
13 files changed:
hphp/runtime/vm/jit/code-gen-arm.cpp
hphp/runtime/vm/jit/code-gen-arm.h
hphp/runtime/vm/jit/code-gen-helpers-arm.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/code-gen-helpers-arm.h [new file with mode: 0644]
hphp/runtime/vm/jit/func-prologues-arm.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/func-prologues-arm.h [new file with mode: 0644]
hphp/runtime/vm/jit/func-prologues.h [new file with mode: 0644]
hphp/runtime/vm/jit/translator-x64.cpp
hphp/runtime/vm/jit/unique-stubs-arm.cpp
hphp/vixl/a64/assembler-a64.h
hphp/vixl/a64/constants-a64.h
hphp/vixl/a64/macro-assembler-a64.h
hphp/vixl/a64/simulator-a64.cc