diff options
author | Maksim Panchenko <maks@fb.com> | 2015-09-29 22:09:16 +0000 |
---|---|---|
committer | Maksim Panchenko <maks@fb.com> | 2015-09-29 22:09:16 +0000 |
commit | 3b3752c898d041fcab9455581136ebc6de921610 (patch) | |
tree | 246cb0b831eba0625ab2e3affc81777bc500084c /test/Feature | |
parent | 5518a74f1f5e3f75e41fb2378c927218f6146f7e (diff) |
HHVM calling conventions.
HHVM calling convention, hhvmcc, is used by HHVM JIT for
functions in translated cache. We currently support LLVM back end to
generate code for X86-64 and may support other architectures in the
future.
In HHVM calling convention any GP register could be used to pass and
return values, with the exception of R12 which is reserved for
thread-local area and is callee-saved. Other than R12, we always
pass RBX and RBP as args, which are our virtual machine's stack pointer
and frame pointer respectively.
When we enter translation cache via hhvmcc function, we expect
the stack to be aligned at 16 bytes, i.e. skewed by 8 bytes as opposed
to standard ABI alignment. This affects stack object alignment and stack
adjustments for function calls.
One extra calling convention, hhvm_ccc, is used to call C++ helpers from
HHVM's translation cache. It is almost identical to standard C calling
convention with an exception of first argument which is passed in RBP
(before we use RDI, RSI, etc.)
Differential Revision: http://reviews.llvm.org/D12681
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r-- | test/Feature/callingconventions.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Feature/callingconventions.ll b/test/Feature/callingconventions.ll index 9aafb36c757..ac4c5090a51 100644 --- a/test/Feature/callingconventions.ll +++ b/test/Feature/callingconventions.ll @@ -59,4 +59,11 @@ define void @ghc_caller() { ret void } +declare hhvm_ccc void @hhvm_c_callee() + +define hhvmcc void @hhvm_caller() { + call hhvm_ccc void @hhvm_c_callee() + ret void +} + declare i32 @__gxx_personality_v0(...) |