RFR: 8202994: Add support for undoing last TLAB allocation

Stefan Karlsson stefan.karlsson at oracle.com
Mon May 14 11:39:29 UTC 2018


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.

> 
>> 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