-
Enhancement
-
Resolution: Unresolved
-
P4
-
23
A few places in Hotspot call to StubRoutines for math functions, see e.g. `LibraryCallKit::inline_math_native`:
```
bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) {
switch (id) {
case vmIntrinsics::_dsin:
return StubRoutines::dsin() != nullptr ?
runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") :
runtime_math(OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dsin), "SIN");
```
This might have been driven by the desire to avoid the expensive native calls to fdlibm. After fdlibm ports to Java (JDK-8134780, JDK-8171407), this might be unnecessary, and we could just stay in Java for these computations. This would likely eliminate the need for lots of platform-specific assembler coding for these math methods.
```
bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) {
switch (id) {
case vmIntrinsics::_dsin:
return StubRoutines::dsin() != nullptr ?
runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") :
runtime_math(OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dsin), "SIN");
```
This might have been driven by the desire to avoid the expensive native calls to fdlibm. After fdlibm ports to Java (
- relates to
-
JDK-8134780 Port fdlibm to Java, part 1
- Resolved
-
JDK-8171407 Port fdlibm to Java, part 2
- Closed