summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Richard Neill <richard.neill@arm.com> 2023-11-21 17:08:38 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-12-20 12:08:54 +0000
commite1e707624d074e4ff395b61de045e7bf55df9b6e (patch)
tree21a6af4a30b434c477cbba6bbd5f3f2c09ff66f8 /compiler/optimizing
parent1d090efadd31ead13d5491d60aaaf09992132f8c (diff)
Align BitMemoryRegion down by sizeof(uint64_t)
The page size can now be a static global non-constexpr value, which means that references to this value can incur an additional overhead. An overhead is especially observed during exception throwing, corresponding to BitMemoryRegion's usage of the page size variable. The maximum data type in a single load from the BitMemoryRegion is uint64_t (via LoadBits), during which the region's data is indexed into as a uint64_t array. This array must be naturally aligned for efficient accesses to its elements, which will occur when the region's data pointer is aligned down by any non-zero multiple of sizeof(uint64_t). Therefore, it is unnecessary to align down the region's data pointer by the page size, and the overhead can instead be avoided simply by aligning down by sizeof(uint64_t). As the actual location of data is unaffected, this change has no impact on memory usage. To provide clarity on the usage of sizeof(uint64_t) in the code, define a type alias MaxSingleLoadType and corresponding constant kMaxSingleLoadBytes, and add a compile-time check that this is greater than or equal to the data type size requested from LoadBits. The tests were run for legacy 4K, page size agnostic 4K and 16K. Test: art/tools/run-gtests.sh Test: art/test/testrunner/testrunner.py --target --64 Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 Test: art/tools/run-libjdwp-tests.sh --mode=device --variant=X64 Change-Id: I9ee90e41e22a63e3693356f79cc8df90d03d6b20
Diffstat (limited to 'compiler/optimizing')
0 files changed, 0 insertions, 0 deletions