Integrated: 8265101: Remove unnecessary functions in os*.inline.hpp
Ioi Lam
iklam at openjdk.java.net
Thu Apr 22 05:48:30 UTC 2021
On Tue, 13 Apr 2021 20:11:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> Many functions like `os::write`, `os::exit`, `os::dll_unload`, etc, are implemented in various os*.inline.hpp files. This forces many .hpp and .cpp files to explicitly include "runtime/os.inline.hpp".
>
> There's no performance reason to inline these functions. They will make a system call, whose overhead is way bigger than the cost of making an extra function call.
>
> The full list methods moved from `os*inline.hpp` to `os_<platform>.cpp` are:
>
>
> os::dll_unload(void *lib)
> os::lseek(int fd, jlong offset, int whence)
> os::fsync(int fd)
> os::ftruncate(int fd, jlong length)
> os::read(int fd, void *buf, unsigned int nBytes)
> os::write(int fd, const void *buf, unsigned int nBytes)
> os::close(int fd)
> os::socket_close(int fd)
> os::socket(int domain, int type, int protocol)
> os::recv(int fd, char* buf, size_t nBytes, uint flags)
> os::send(int fd, char* buf, size_t nBytes, uint flags)
> os::raw_send(int fd, char* buf, size_t nBytes, uint flags)
> os::connect(int fd, struct sockaddr* him, socklen_t len)
> os::get_host_by_name(char* name)
> os::exit(int num)
>
>
> I also took this chance to remove unnecessary inclusion of os.hpp and os.inline.hpp from various files. I added some missing `#include` directives that were exposed as a result.
>
> - **Notes for Reviewers**: please start from os*.{hpp,cpp} files first.
> - Tested with mach5: tier1, builds-tier2, builds-tier3, builds-tier4 and builds-tier5. Also locally: aarch64, arm, ppc64, s390, x86, and zero.
This pull request has now been integrated.
Changeset: 33b6378f
Author: Ioi Lam <iklam at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/33b6378f
Stats: 257 lines in 58 files changed: 109 ins; 98 del; 50 mod
8265101: Remove unnecessary functions in os*.inline.hpp
Reviewed-by: dholmes, kbarrett
-------------
PR: https://git.openjdk.java.net/jdk/pull/3475
More information about the hotspot-dev
mailing list