Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8324296

Reconsider the need for math StubRoutines after fdlibm ports

XMLWordPrintable

      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.

            Unassigned Unassigned
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: