RFR: 8166188: G1 Needs pre barrier on dereference of weak JNI handles
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 < (size_t)os::vm_page_size()) {
>> 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 value_state = _value_state[p];
> if (is_value_state_indirect_oop(value_state)) {
> intptr_t v = _value[p];
> - if (v != 0 ) {
> - size_t t = (size_t)v;
> - if (t < (size_t)os::vm_page_size()) {
> + if (v != 0) {
> + if (v < os::vm_page_size()) {
> + // 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 (!resolve_indirect_oop(v, value_state)->is_oop_or_null(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 ppc-aix-port-dev
mailing list