V4: Do not shift heap pointer bits on arm64 Android

Memory obtained via mmap() is not subject to heap pointer tagging. We
don't need to impose the overhead of shifting the bits around.

Amends commit c7722d4ed6.

Pick-to: 6.5
Task-number: QTBUG-101686
Task-number: QTBUG-91150
Change-Id: I45dc291c5a1208dd747199f00f819e475d5c0aec
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Ulf Hermann 2023-01-13 08:23:47 +01:00
parent 96f2d57fd6
commit b0907db9ea
1 changed files with 7 additions and 2 deletions

View File

@ -509,8 +509,13 @@ struct StaticValue
// and IA64 are not officially supported, but we can expect more platforms with
// similar "problems" in the future.
enum PointerShift {
#if defined(Q_OS_ANDROID) && defined(Q_PROCESSOR_ARM_64)
// Android on arm64 uses the top byte to store pointer tags.
#if 0 && defined(Q_OS_ANDROID) && defined(Q_PROCESSOR_ARM_64)
// We used to assume that Android on arm64 uses the top byte to store pointer tags.
// However, at least currently, the pointer tags are only applied on new/malloc and
// delete/free, not on mmap() and munmap(). We manage the JS heap directly using
// mmap, so we don't have to preserve any tags.
//
// If this ever changes, here is how to preserve the top byte:
// Move it to Upper3 and Lower5.
Top1Shift = 0,
Upper3Shift = 12,