RFR: 8202994: Add support for undoing last TLAB allocation

Per Liden per.liden at oracle.com
Mon May 14 11:46:03 UTC 2018


Thanks all for reviewing.

On 05/14/2018 01:39 PM, Stefan Karlsson wrote:
> On 2018-05-14 10:16, Aleksey Shipilev wrote:
>> On 05/14/2018 10:08 AM, Per Liden wrote:
>>> Hi,
>>>
>>> I don't really have a strong opinion on this. There's some comfort in 
>>> asserting on things we should
>>> never be doing (i.e. undo something that is in the TLAB but it's not 
>>> the last allocation). On the
>>> other hand, I think you proposal is also fine, and I _think_ it can 
>>> be simplified even further with
>>> a single pointer_delta call. Like this:
>>>
>>> http://cr.openjdk.java.net/~pliden/8202994/webrev.2
>>
>> This looks fine.
> 
> Looks good to me too.

Ok, I'll go with this version. Adding the assert would require 
re-introduction of contains(), so I'm not sure it's worth it...

/Per

> 
>>
>>> Any strong opinions from others?
>>
>> I mean, if we are to bikeshed on this more, I think it is a good idea 
>> to both make release builds do
>> the right thing (e.g. returning false as the patch above suggestes), 
>> *and* make fastdebug builds to
>> fail with assert if we are trying to do creepy things.
>>
>> I.e.:
>>
>>    if (!is_last_allocation(obj, size)) {
>>      assert(!contains(obj), "Bad undo: the object is not the last 
>> allocation");
>>      return false;
>>    }
> 
> This seems like a worthwhile assert.
> 
> Thanks,
> StefanK
> 
>>
>>
>> Thanks,
>> -Aleksey
>>



More information about the hotspot-gc-dev mailing list