forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PartitionAlloc] Add compiler annotations to PA and blink allocators.
There are several attributes that we can add to malloc()-like functions: - malloc: tells the compiler that this is a malloc()-like function that is its return values are distinct and non-overlapping. - assume_aligned: tells the compiler that the return value is aligned on a certain boundary. It has practical consequences for aliasing analysis, but also to allow the compiler to use aligned SIMD instructions (as we found out the hard way in the past). For instance, from the added unittest disassembly on Linux x86_64, release build. Before, zeroing in the constructor was done with: f6ad45: e8 f6 00 00 00 callq f6ae40 <_ZN4base8internal18PartitionAllocTest5AllocEm> f6ad4a: 49 89 c7 mov %rax,%r15 f6ad4d: 0f 57 c0 xorps %xmm0,%xmm0 f6ad50: 0f 11 00 movups %xmm0,(%rax) <-- Unaligned And now it is done with: f6ad45: e8 f6 00 00 00 callq f6ae40 <_ZN4base8internal18PartitionAllocTest5AllocEm> f6ad4a: 49 89 c7 mov %rax,%r15 f6ad4d: 0f 57 c0 xorps %xmm0,%xmm0 f6ad50: 0f 29 00 movaps %xmm0,(%rax) <-- Aligned Change-Id: I89c6426c3da09c74eef2b4d7c06fba3398534746 Bug: 998048 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3059455 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Benoit L <lizeb@chromium.org> Cr-Commit-Position: refs/heads/master@{#912985}
- Loading branch information
Benoit Lize
authored and
Chromium LUCI CQ
committed
Aug 18, 2021
1 parent
17a9a44
commit f50de13
Showing
6 changed files
with
120 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters