JDK-8265711 : C1: Intrinsify Class.getModifier method
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-04-22
  • Updated: 2024-12-18
  • Resolved: 2021-05-18
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 17
17 b23Fixed
Related Reports
Relates :  
Description
It's relatively a common case to get modifiers from a constant Class instance, i.e. ThirdPartyClass.class.getModifiers(). Currently, C1 Canonicalizer missed the opportunity of replacing Class.getModifiers intrinsic calls with compile-time constants. 
Comments
Hi do you have performance tests for this change? I would like to move this to Java and remove this code. It should be very much faster if done in Java only. [~yyang]
10-12-2024

Changeset: 905b41ac Author: Yi Yang <yyang@openjdk.org> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2021-05-18 07:29:18 +0000 URL: https://git.openjdk.java.net/jdk/commit/905b41ac6ae44e5adb51cff37995cff534db47f0
18-05-2021