RFR(M): 8166317: InterpreterCodeSize should be computed
Claes Redestad
claes.redestad at oracle.com
Thu Aug 31 10:14:07 UTC 2017
On 2017-08-31 08:54, Volker Simonis wrote:
> While working on this, I found another problem which is related to the
> fix of JDK-8183573 and leads to crashes when executing the JTreg test
> compiler/codecache/stress/ReturnBlobToWrongHeapTest.java.
>
> The problem is that JDK-8183573 replaced
>
> virtual bool contains_blob(const CodeBlob* blob) const { return
> low_boundary() <= (char*) blob && (char*) blob < high(); }
>
> by:
>
> bool contains_blob(const CodeBlob* blob) const { return
> contains(blob->code_begin()); }
>
> But that my be wrong in the corner case where the size of the
> CodeBlob's payload is zero (i.e. the CodeBlob consists only of the
> 'header' - i.e. the C++ object itself) because in that case
> CodeBlob::code_begin() points right behind the CodeBlob's header which
> is a memory location which doesn't belong to the CodeBlob anymore.
I recall this change was somehow necessary to allow merging
AOTCodeHeap::contains_blob and CodeHead::contains_blob into
one devirtualized method, so you need to ensure all AOT tests
pass with this change (on linux-x64).
I can't help to wonder if we'd not be better served by disallowing
zero-sized payloads. Is this something that can ever actually
happen except by abuse of the white box API?
/Claes
More information about the hotspot-dev
mailing list