RFR: 8166188: G1 Needs pre barrier on dereference of weak JNI handles (original) (raw)

Kim Barrett kim.barrett at oracle.com
Sat Feb 11 04:02:17 UTC 2017


On Feb 8, 2017, at 7:00 PM, Kim Barrett <kim.barrett at oracle.com> wrote:

L571: if (t < (sizet)os::vmpagesize()) {_ _Again, not your issue, but that size < page size check means_ _the oop is bad is screaming for a short comment._ _Added comment. Also removed the unnecessary intermediate variable t,_ _thereby eliminating some casts. I'm not completly convinced by the_ _comment, but remaining true to the existing code. Here's the diff:_ _@@ -566,9 +568,10 @@_ _uint valuestate = valuestate[p];_ _if (isvaluestateindirectoop(valuestate)) {_ _intptrt v = value[p];_ _- if (v != 0 ) {_ _- sizet t = (sizet)v;_ _- if (t < (sizet)os::vmpagesize()) {_ _+ if (v != 0) {_ _+ if (v < os::vmpagesize()) {_ _+ // v is a "handle" referring to an oop, cast to integral type._ _+ // There ought not be any handles in very low memory._ _bad = true;_ _} else if (!resolveindirectoop(v, valuestate)->isoopornull(true)) { bad = true;

Well, that was dumb. v can be negative, and vm_page_size return (positive) int. Just pretend you never saw that…



More information about the hotspot-dev mailing list