RFR: 8265101: Remove unnecessary functions in os*.inline.hpp
Kim Barrett
kbarrett at openjdk.java.net
Wed Apr 21 04:54:09 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.
Marked as reviewed by kbarrett (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/3475
More information about the hotspot-dev
mailing list