add xptcall routines for aarch64 macOS
Categories
(Core :: XPCOM, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
This would almost be straightforward to copy over from the aarch64 Linux support, except that Apple's aarch64 calling convention -- at least on iOS, and I don't imagine Apple would change this for macOS -- deviates from the generic standard in two significant ways:
- Function arguments passed on the stack do not consume 8 bytes apiece, they only consume the space necessary for them (subject to alignment restrictions).
- Caller performs sign/zero extension for arguments < 32 bits, rather than the callee.
I think the second deviation makes our life much easier, but the first one is potentially annoying.
Assignee | ||
Comment 1•4 years ago
|
||
These changes are consistent with what we do in other
files (xptcstubs_arm.cpp) and also make everything compile.
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
These files will all compile, but things will break at runtime because the
convention for stack arguments is slightly different on Darwin. We'll fix
that in the next patch or two.
Depends on D87004
Assignee | ||
Comment 3•4 years ago
|
||
Through some sleight-of-hand, we can treat argument allocation in aarch64's
xptcinvoke exactly the same for integer and floating-point arguments. This
change isn't so important now, but it centralizes the allocation of stack
slots, which is important for making this code handle Apple's calling
conventions.
Depends on D87005
Assignee | ||
Comment 4•4 years ago
|
||
ARM has a common calling standard for all operating systems running on
ARM64, and Apple platforms almost follow it, except for a few rules which
aren't relative to xptcall, plus one significant exception: arguments
spilled to the stack only occupy the space they need to. So in the common
calling standard, a uint16_t
would occupy eight bytes when it is passed on
the stack, whereas on Apple platforms, it only occupies two bytes.
Depends on D87006
Assignee | ||
Comment 5•4 years ago
|
||
We have to rename the files; they need to be preprocessed due to various
different assembler and object file conventions.
Depends on D87007
Comment 6•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/1ef1dd6379d1 add appropriate Apple-specific syntax bits in aarch64 C stubs r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/a7ce18db1c01 compile the correct files for xptcall on arm64 macOS r=glandium,xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/fdb21f59c0b1 unify integer and floating-point argument allocation r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/bb0d64c2a6bb make arm64 xptcinvoke handle both aapcs and apple stack conventions r=xpcom-reviewers,nika,froydnj https://hg.mozilla.org/integration/autoland/rev/30267a93822f make aarch64 assembly glue suitable for compiling with macOS r=glandium,xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/b3b212539baa make arm64 xptcstubs handle both aapcs and apple stack conventions. r=froydnj
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1ef1dd6379d1
https://hg.mozilla.org/mozilla-central/rev/a7ce18db1c01
https://hg.mozilla.org/mozilla-central/rev/fdb21f59c0b1
https://hg.mozilla.org/mozilla-central/rev/bb0d64c2a6bb
https://hg.mozilla.org/mozilla-central/rev/30267a93822f
https://hg.mozilla.org/mozilla-central/rev/b3b212539baa
Description
•