-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b26
On x86 ther c1/interpreter post write barrier always uses 32 bit accesses to access the PtrQueue::_index parameter although it's a size_t.
Particular this code:
__ cmpl(queue_index, 0); // fixed 32 bit read/comparison
__ jcc(Assembler::equal, runtime);
__ subl(queue_index, wordSize); // fixed 32 bit subtraction
__ movptr(tmp2, buffer);
#ifdef _LP64
__ movslq(rscratch1, queue_index); // fixed 32 bit read + sign extension(?)
__ addq(tmp2, rscratch1);
__ movq(Address(tmp2, 0), card_addr);
#else
is wrong. The pre-write barrier is fine, and cursory look through other architectures the code used is fine too.
This is no real issue due to endianess and the index never > 2^31.
Particular this code:
__ cmpl(queue_index, 0); // fixed 32 bit read/comparison
__ jcc(Assembler::equal, runtime);
__ subl(queue_index, wordSize); // fixed 32 bit subtraction
__ movptr(tmp2, buffer);
#ifdef _LP64
__ movslq(rscratch1, queue_index); // fixed 32 bit read + sign extension(?)
__ addq(tmp2, rscratch1);
__ movq(Address(tmp2, 0), card_addr);
#else
is wrong. The pre-write barrier is fine, and cursory look through other architectures the code used is fine too.
This is no real issue due to endianess and the index never > 2^31.
- relates to
-
JDK-8303961 VM crash when add option '-XX:G1UpdateBufferSize=512M'
- Open
-
JDK-8329261 G1: interpreter post-barrier x86 code asserts index size of wrong buffer
- Resolved