One of the best barriers is the one that Java uses for its default gengc. That’s sort of the gold standard against which others are measured. It’s not hard to get there, lots of others have gotten there.
You will have to be more specific. The most popular java implementation is hotspot, and hotspot’s default gc is g1; g1’s write barrier is, as I said, if ((pointer ^ pointee) >> k) goto slow—remset maintenance iff pointer and pointee belong to different regions.
why?
What do you call a ‘good barrier’? G1 is a rather well-regarded gc and uses the second barrier type I indicated.
Costs nothing on the backend, sure. Very little code is backend-bottlenecked. But yes barriers are rather cheap in practice.
score 2 · canonical
One of the best barriers is the one that Java uses for its default gengc. That’s sort of the gold standard against which others are measured. It’s not hard to get there, lots of others have gotten there.
score 3 · canonical
You will have to be more specific. The most popular java implementation is hotspot, and hotspot’s default gc is g1; g1’s write barrier is, as I said, if ((pointer ^ pointee) >> k) goto slow—remset maintenance iff pointer and pointee belong to different regions.
score 4 · canonical