Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ARM64 Support #1

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion runtime/isa.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
# if __arm64__
// ARM64 simulators have a larger address space, so use the ARM64e
// scheme even when simulators build for ARM64-not-e.
# if __has_feature(ptrauth_calls) || TARGET_OS_SIMULATOR
// DARLING: For the time being, we want to support older arm64 devices that don't support arm64e.
# if __has_feature(ptrauth_calls) || TARGET_OS_SIMULATOR || DARLING
# define ISA_MASK 0x007ffffffffffff8ULL
# define ISA_MAGIC_MASK 0x0000000000000001ULL
# define ISA_MAGIC_VALUE 0x0000000000000001ULL
Expand Down
3 changes: 2 additions & 1 deletion runtime/objc-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ inline void
isa_t::setClass(Class newCls, UNUSED_WITHOUT_PTRAUTH objc_object *obj)
{
// Match the conditional in isa.h.
#if __has_feature(ptrauth_calls) || TARGET_OS_SIMULATOR
// DARLING: For the time being, we want to support older arm64 devices that don't support arm64e.
#if __has_feature(ptrauth_calls) || TARGET_OS_SIMULATOR || DARLING
# if ISA_SIGNING_SIGN_MODE == ISA_SIGNING_SIGN_NONE
// No signing, just use the raw pointer.
uintptr_t signedCls = (uintptr_t)newCls;
Expand Down
10 changes: 10 additions & 0 deletions runtime/objc-runtime-new.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,17 @@
// _tryRetain/_isDeallocating/retainWeakReference/allowsWeakReference
#define FAST_HAS_DEFAULT_RR (1UL<<2)
// data pointer
#ifdef DARLING
// XNU only supports up to 47-bit address space on AArch64
// (see T0SZ_BOOT in osfmk/arm64/proc_reg.h), but Linux
// normally uses 48-bit one, and can support 52-bit one
// on hardware with FEAT_LVA. Fortunately, Apple doesn't
// seem to use the upper bits for any flags, so we can just
// extend the mask to cover them.
#define FAST_DATA_MASK 0xfffffffffffffff8UL
#else
#define FAST_DATA_MASK 0x00007ffffffffff8UL
#endif

#if __arm64__
// class or superclass has .cxx_construct/.cxx_destruct implementation
Expand Down