You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid using object pinning in native blackhole (#132)
Re-implemented native blackhole without using object pinning as
it affects performance and leads to unstable results as each time GC
has to spend more and more time scanning all pinned values.
Instead, primitive values consumption is implemented as a comparison
of the value for equality with two fields and publishing the value in case
when comparison succeeds. The values themselves are never the same and
one of the fields is volatile, thus the condition is always false and it
could not be omitted because of volatility. That should prevent both
dead code elimination and movement of the code computing the consumed
value into an effectively unreachable branch.
For the objects, identifyHashCode is used to obtain an int-value that
is then passed into a regular consumption routine. That function is an
intrinsic that simply gets an address of the object, so it has no
performance impact, yet it requires an object.
Fixes#114
0 commit comments