JDK-8292758 : put support for UNSIGNED5 format into its own header file
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-08-23
  • Updated: 2022-09-15
  • Resolved: 2022-09-08
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 20
20 b15Fixed
Related Reports
Blocks :  
Description
The JVM uses the UNSIGNED5 format (from Pack200) for storing streams of debug and register liveness information.  The format is implemented inside CompressedStream.  It should be brought out into its own separate header file, so it can be maintained and upgraded separately, and possibly used for additional purposes.

When it goes in its own header, it needs a reasonable "kit" of API points:

 - a reader and a writer (templates to avoid implementation coupling)
 - a writer which can also expand its output buffer (template again; used by `CompressedWriteStream`)
 - a function (constant-foldable) which computes the byte-length of a given value to encode
 - another function (constant-foldable) which, given a byte-length, reports the largest encodable value of that length
 - maximum byte-length and encoded-value (constants)
 - a function or two to test correctness or feasibility of encoding, plus a debug.cpp function to display compressed data
 - some miscellaneous functions to encode and decode signed numbers (s4 <-> u4)

A gtest is needed for these API points.

- - - -

A future cleanup of field metadata (probably necessary for Valhalla and/or Leyden) should use UNSIGNED5 format instead of the fixed-sized arrays of u2 elements, which are bursting at the seams with no incremental fix in sight.

Similarly, relocation information could be simpified if structured as a compact stream of 32-bit tokens.

Any stream-oriented data structure that favors smaller values (such as Pack200 value bands) benefits from a varint format like UNSIGNED5.

Proof of concept:  https://github.com/rose00/jdk/commit/compressed-stream
Comments
Changeset: 8d3399bf Author: John R Rose <jrose@openjdk.org> Date: 2022-09-08 07:36:53 +0000 URL: https://git.openjdk.org/jdk/commit/8d3399bf5f354931b0c62d2ed8095e554be71680
08-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10067 Date: 2022-08-29 18:20:42 +0000
01-09-2022