JDK-8353176 : C1: x86 patching stub always calls Thread::current()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-03-28
  • Updated: 2025-03-31
  • Resolved: 2025-03-31
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 25
25 masterFixed
Related Reports
Relates :  
Description
Noticed this while looking at compiled code density. In C1 PatchingStub code, we _always_ perform a runtime call to Thread::current(), even though we can rely on r15_thread to be available. This is because we are calling to `MacroAssembler::get_thread`, which is always doing slowpath.

This kind of accident would be less likely / impossible once we cleanup uses of `MacroAssembler::get_thread` with JDK-8353174.
Comments
Changeset: 6fbaa066 Branch: master Author: Aleksey Shipilev <shade@openjdk.org> Date: 2025-03-31 10:01:23 +0000 URL: https://git.openjdk.org/jdk/commit/6fbaa066ce45b70f1c288d1245b03fe18ceba126
31-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24291 Date: 2025-03-28 11:05:33 +0000
28-03-2025