JDK-8294973 : Convert jdk.jfr to use the Classfile API for class instrumentation (umbrella)
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: jfr
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2022-10-07
  • Updated: 2024-07-01
  • Resolved: 2024-07-01
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 23
23Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Class instrumentation in jdk.jfr module is a very complex class transformation spread across following classes:
- ASMToolkit
- EventClassBuilder
- EventHandlerCreator
- EventInstrumentation
- EventWriterMethod
- Utils
- ConstructorTracerWriter
- ConstructorWriter
- JIClassInstrumentation
- JIInliner
- JIMethodCallInliner
- JIMethodInliningAdapter
- JIMethodMergeAdapter

These are fixed by 3 related tasks in the issue links section; now JFR no longer has any dependency on ASM, and all its instructions use Class-File API.
Comments
This task has been handled by individual issues linked in the comments, all of which are done by RDP1 of release 23.
21-06-2024

JI* classes will be removed with JDK-8331877 to reduce startup cost.
13-05-2024

In JDK-8318124, some event instrumentation was converted to Classfile API. In JDK-8319374, ConstructorTracerWriter and ConstructorWriter are removed. Now these classes still depend on ASM, all of which are deprecated: - JIClassInstrumentation - JIInliner - JIMethodCallInliner - JIMethodInliningAdapter - JIMethodMergeAdapter
11-05-2024

Draft of prototype pull request: https://github.com/openjdk/jdk/pull/12946
09-03-2023

This use case has been included in the Classfile API development, see: https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch#use-cases jdk.jfr form of class instrumentation is directly included in the Classfile API tests: https://github.com/openjdk/jdk-sandbox/blob/classfile-api-dev-branch/test/jdk/jdk/classfile/AdvancedTransformationsTest.java#L290
07-10-2022