JDK-8199424 : consider removing ObjectInputStream and ObjectOutputStream native methods
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 11
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-03-09
  • Updated: 2020-07-16
  • Resolved: 2019-09-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 14
14 b16Fixed
Related Reports
Relates :  
Description
There are several native methods in ObjectInputStream and ObjectOutputStream:

    ObjectInputStream.bytesToFloats
    ObjectInputStream.bytesToDoubles
    ObjectOutputStream.floatsToBytes
    ObjectOutputStream.doublesToBytes

Each of these method has a comment of the following form near the native method declaration in the corresponding .java file:

    // REMIND: remove once hotspot inlines Float.intBitsToFloat

The methods

    Float.floatToIntBits
    Float.intBitsToFloat
    Double.doubleToLongBits
    Double.longBitsToDouble

are all annotated with @HotSpotIntrinsicCandidate so this might indicate that the "inlining" being awaited in the comment has been fulfilled. If so, the serialization native methods can be removed.

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/da8673f61e94 User: darcy Date: 2019-09-20 16:33:08 +0000
20-09-2019

Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-September/062486.html
19-09-2019

The bitwise conversion routines were intrinsified some time ago: JDK-4808788 and JDK-4808791.
19-09-2019