[lworld] RFR: 8247357: Flattenable field concept needs some cleanup
Tobias Hartmann
tobias.hartmann at oracle.com
Fri Jun 12 07:53:11 UTC 2020
Just wondering if "is_inlined()" wouldn't be an option as well? "Allocated" sounds like there is
some heap allocation for that field going on.
Best regards,
Tobias
On 10.06.20 22:35, Frederic Parain wrote:
> Sure, “is_allocated_inline” (the “d” at the end was a typo,
> in the code example, it is written correctly).
>
> Thank you,
>
> Fred
>
>> On Jun 10, 2020, at 16:23, John Rose <john.r.rose at oracle.com> wrote:
>>
>> On Jun 10, 2020, at 1:12 PM, Frederic Parain <frederic.parain at oracle.com> wrote:
>>>
>>> John,
>>>
>>> Thank you for looking at these changes.
>>>
>>> “is_inline” might be confusing in the sense that it can be interpreted
>>> as a property of the field layout. And “is_declared_inline” shares the
>>> same issue (could be interpreter as a field modifier).
>>> What the is_inline() methods really do, is to answer the question:
>>> is the type of this field an inline type? So, it’s a type question,
>>> and not a layout question. And sometimes, we use is_inline to perform
>>> checks that are not related to the layout, but to the properties of
>>> the type (like null-freeness).
>>>
>>> To prevent the confusion, I would propose to change “is_inline” to
>>> “is_inline_type”, so the it would be obvious that the test is about
>>> the type of the field.
>>>
>>> And to have similar names, we would follow your suggestion and
>>> rename “is_flattened” to “is_allocated_inlined"
>>>
>>> So:
>>> if(fd->is_inline_type()) { // -> clearly a type test
>>>
>>> and
>>> if(fd->is_allocated_inline()) { // -> clearly a layout test
>>>
>>>
>>> Would these new names address the concerns you have?
>>
>> Yes, that’s great. Tiny tweak: I suggest “is_allocated_inline”,
>> or “is_inline_allocated” since the word “inline” can function
>> as an adverb. (I’m not sure, but I think you are suggesting
>> “inlined” for “inline”.)
>>
>
More information about the valhalla-dev
mailing list