Fwd: [graalvm-dev] Question about GC barriers work (precise vs. imprecise)
rkennke at redhat.com
Tue Feb 19 19:47:56 UTC 2019
>>>> From: Gilles Duboscq <gilles.m.duboscq at oracle.com>
>>>> Subject: Re: [graalvm-dev] Question about GC barriers work (precise vs. imprecise)
>>>> Date: 19 February 2019 at 19:15:56 CET
>>>> To: graalvm-dev at oss.oracle.com
>>>> Hi Roman,
>>>> I think that answering those 3 questions for all our writes should be feasible (oop? array? init?).
>>>> I don't think we want to generate the expanded access during parsing, that would go against the "gradual lowering" design.
>>>> I think it also makes sense to keep some knowledge about barriers in the compiler and not only have a blind lowering since some optimizations such as barrier elimination can be performed before expanding those barriers.
>>>> Regarding those questions:
>>>> - stamps/kinds of the written value should be enough to figure out if it's an oop read/write.
>>>> - location identity should be enough (or can be improved) to know if it's an array location or not (see NamedLocationIdentity#isArrayLocation).
>> That's what I was thinking at first, but doesn't Truffle use ObjectLocationIdentity for array accesses? And INIT_LOCATION is used for both array and field. So I don't think LocationIdentity can be used here. The existing BarrierType provides a more reliable indicator I think.
> The question for Roman is:
> - If it's an initialization, do you care about array vs field?
I don't think so.
> - How strict does array vs field need to be? For example if we answer field but it's actually an array at runtime, is it a problem?
I think in doubt, falling back to 'precise' is ok, as Tom mentioned
elsewhere in this thread.
I'll dig a little more into it and see what I can come up with.
More information about the graal-dev