Request for review JDK-8185591 guarantee(_byte_map[_guard_index] == last_card) failed: card table guard has been modified
Thomas Schatzl
thomas.schatzl at oracle.com
Wed Nov 22 08:38:35 UTC 2017
Hi again,
On Wed, 2017-11-22 at 09:28 +0100, Thomas Schatzl wrote:
> On Tue, 2017-11-21 at 18:24 -0500, Kim Barrett wrote:
> > > On Nov 21, 2017, at 5:18 PM, Alexander Harlap
> > > <alexander.harlap at oracle.com> wrote:
> > >
> > > Please review change for JDK-8185591
> > > <https://bugs.openjdk.java.net/browse/JDK-8185591> -
> > > guarantee(_byte_map[_guard_index] ==
> > > last_card) failed: card table guard has been modified
> > >
[...]
> > Instead of that, might it be better to instead add something like
> > this?
> >
> > 1277 __ subptr(end, start); // end --> cards count
> > + 1278 __ jcc(Assembler::less, L_done); // negative
> > inclusive count - nothing to do
> >
> > Similar question for all of the affected platforms.
Also, ARM32 has its own instruction.
> >
> > I don't currently have a strong preference either way, but wonder
> > if there's a good reason to choose one over the other.
>
> Basically the test instruction, particularly in combination with jcc,
> has some fast paths in processors. While in current ones that
> difference is pretty small after looking at the optimization manual
> (current Intel manuals only indicate that the test instruction
> (macro-)
> fuses with all flags afterwards; the sub does not [0]). On earlier
> processors (probably includes AMD ones) only test fuses with the jcc.
>
> I.e. some nano-optimization.
Also, I think in this case testl has a denser encoding than subptr,
because subptr probably ends up using 64 bit registers (+1 prefix
byte), while testl is explicitly 32 bit.
Thanks,
Thomas
More information about the hotspot-dev
mailing list