platform_bionic/libc
Elliott Hughes 2c96639eb2 Optimize the mbs fast path slightly.
From a logcat profile:
```
     |--95.06%-- convertPrintable(char*, char const*, unsigned long)
     |    |--13.95%-- [hit in function]
     |    |
     |    |--35.96%-- mbrtoc32
     |    |    |--82.72%-- [hit in function]
     |    |    |
     |    |    |--11.07%-- mbsinit
     |    |    |
     |    |    |--5.96%-- @plt
```
I think we'd assumed that mbsinit() would be inlined, but since these
functions aren't all in wchar.cpp it wasn't being. This change moves the
implementation into a (more clearly named) inline function so we can
trivially reclaim that 11%+6%.

Benchmarks before:
```
-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
BM_stdlib_mbrtowc_1            8.03 ns         7.95 ns     87144997
BM_stdlib_mbrtowc_2            22.0 ns         21.8 ns     32002437
BM_stdlib_mbrtowc_3            30.0 ns         29.7 ns     23517699
BM_stdlib_mbrtowc_4            37.4 ns         37.1 ns     18895204
BM_stdlib_mbstowcs_ascii     792373 ns       782484 ns          890 bytes_per_second=609.389M/s
BM_stdlib_mbstowcs_wide    15836785 ns     15678316 ns           44 bytes_per_second=30.4138M/s
```

Benchmarks after:
```
-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
BM_stdlib_mbrtowc_1            5.76 ns         5.72 ns    121863813
BM_stdlib_mbrtowc_2            17.1 ns         16.9 ns     41487260
BM_stdlib_mbrtowc_3            24.2 ns         24.0 ns     29141629
BM_stdlib_mbrtowc_4            30.3 ns         30.1 ns     23229291
BM_stdlib_mbstowcs_ascii     783506 ns       775389 ns          903 bytes_per_second=614.965M/s
BM_stdlib_mbstowcs_wide    12787003 ns     12672642 ns           55 bytes_per_second=37.6273M/s
```

Bug: http://b/206523398
Test: treehugger
Change-Id: If8c6c39880096ddd2cbd323c68dca82e9849ace6
2021-11-16 11:03:19 -08:00
..
arch-arm Clear the stack frame pointer in _start and __bionic_clone 2021-05-07 15:00:55 -07:00
arch-arm64 setjmp/longjmp: avoid invalid values in the stack pointer. 2021-04-05 17:43:36 -07:00
arch-common/bionic Turns out we don't need to say calll any more. 2021-05-19 09:14:41 -07:00
arch-x86 Clear the stack frame pointer in _start and __bionic_clone 2021-05-07 15:00:55 -07:00
arch-x86_64 setjmp/longjmp: avoid invalid values in the stack pointer. 2021-04-05 17:43:36 -07:00
async_safe bp2build: remove some bp2build_available props, use package_allowlist instead. 2021-03-19 02:06:27 -04:00
bionic Optimize the mbs fast path slightly. 2021-11-16 11:03:19 -08:00
dns Make res_init() work again. 2021-04-08 12:04:05 -07:00
fts/include Use the BSD license for our bogus fts.h. 2021-09-14 12:26:08 -07:00
include Update to v5.15 kernel headers. 2021-11-02 15:53:58 -07:00
kernel Update to v5.15 kernel headers. 2021-11-02 15:53:58 -07:00
malloc_debug Update for libunwindstack shared_ptr MapInfos. 2021-10-29 13:03:05 -07:00
malloc_hooks Add LOCAL_LICENSE_KINDS to bionic 2021-02-19 23:38:28 +00:00
platform Disable fdtrack post-fork. 2021-04-07 19:00:45 -07:00
private Optimize the mbs fast path slightly. 2021-11-16 11:03:19 -08:00
seccomp Use more inclusive language for seccomp filter 2020-06-15 10:12:17 -07:00
stdio Make fd overflow an abort. 2021-02-09 17:13:09 -08:00
system_properties Revert "Adding system property tracing" 2021-07-21 09:15:41 +08:00
tools Merge "Ignore backup files left by emacs." 2021-04-20 01:24:49 +00:00
tzcode Incorporate upstream's strptime %Z/%z support. 2020-09-01 19:11:28 -07:00
upstream-freebsd Fully disable clang format where needed. 2020-01-30 08:10:17 -08:00
upstream-netbsd Make res_init() work again. 2021-04-08 12:04:05 -07:00
upstream-openbsd Export fts as a static library for use with musl 2021-09-08 15:53:10 -07:00
versioner-dependencies Stop generating unused headers. 2020-02-03 17:56:06 -08:00
Android.bp Re-enable LTO for linker 2021-11-04 01:03:11 +08:00
fs_config_generator.py
libc.map.txt Add execinfo functionality. 2021-10-20 21:53:07 +00:00
libstdc++.map.txt Remove dead code. 2020-02-13 22:25:02 -08:00
MODULE_LICENSE_BSD
NOTICE Move the Rust system property bindings into librustutils. 2021-07-29 15:55:07 -07:00
SECCOMP_ALLOWLIST_APP.TXT Use more inclusive language for seccomp filter 2020-06-15 10:12:17 -07:00
SECCOMP_ALLOWLIST_COMMON.TXT Add userfaultfd syscall in SECCOMP allowlist 2021-03-11 19:30:08 +00:00
SECCOMP_ALLOWLIST_SYSTEM.TXT Use more inclusive language for seccomp filter 2020-06-15 10:12:17 -07:00
SECCOMP_BLOCKLIST_APP.TXT Use more inclusive language for seccomp filter 2020-06-15 10:12:17 -07:00
SECCOMP_BLOCKLIST_COMMON.TXT Revert "Disallow vmsplice(2) for all zygote-spawned processes." 2020-06-23 17:53:35 +00:00
SECCOMP_PRIORITY.TXT Use more inclusive language for seccomp filter 2020-06-15 10:12:17 -07:00
SYSCALLS.TXT Add preadv2/pwritev2 wrappers. 2021-10-18 12:58:47 -07:00
version_script.txt