Skip to content

move to central ReferenceCountHolder class#1

Draft
yawkat wants to merge 7 commits into
franz1981:4.2_varhandlefrom
yawkat:varhandle-mod
Draft

move to central ReferenceCountHolder class#1
yawkat wants to merge 7 commits into
franz1981:4.2_varhandlefrom
yawkat:varhandle-mod

Conversation

@yawkat
Copy link
Copy Markdown

@yawkat yawkat commented Jul 15, 2025

Motivation:

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modification:

Describe the modifications you've done.

Result:

Fixes #.

If there is no issue then describe the changes introduced by this PR.

franz1981 and others added 7 commits July 15, 2025 05:28
Motivation:

Unsafe unavailability prevent some basic JIT optimizations while accessing
buffers and reference counters, causing some pretty severe performance regression

Modifications:

Expose a VarHandle's 9 stub to enable Ja +9 to use it, if Unsafe is unavailable

Result:

Fixes netty#15485
);
private static final AtomicIntegerFieldUpdater<ReferenceCountHolder> UPDATER = config.updater(); // todo: fixed initializer for NI
private static final long OFFSET = config.fieldOffset(); // todo: recompute offset for NI
private static final ReferenceCountUpdater.Configuration.UpdaterType TYPE = config.updaterType();
Copy link
Copy Markdown
Owner

@franz1981 franz1981 Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work well sadly for hotspot; it would be better to use an int or anything different.
enums need to check for ordinals and other untrusty fields on the switch, instead of turning it into a constant

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I thought so, I think we need to get rid of the config class anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants