RFR(XS) Early return results imbalanced time partition

Aleksey Shipilev shade at redhat.com
Wed May 31 19:38:27 UTC 2017


Irrationally. Sometimes goto is cleaner than anything else, like in this case.

-Aleksey

On 05/31/2017 09:36 PM, Zhengyu Gu wrote:
> People hates/avoid goto, no?
> 
> -Zhengyu
> 
> On 05/31/2017 03:33 PM, Aleksey Shipilev wrote:
>> Ah! So while loop is meant to be the scope which you can break from. Using goto
>> would be less cryptic, no?
>>
>> diff -r de1d145d1fc1 src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp
>> --- a/src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp    Wed May 31 21:13:12
>> 2017 +0200
>> +++ b/src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp    Wed May 31 21:33:19
>> 2017 +0200
>> @@ -296,8 +296,7 @@
>>
>>      if (!has_work) {
>>        reset();
>> -      _heap->gc_timer()->register_gc_end();
>> -      return;
>> +      goto end;
>>      }
>>
>>      policy->record_phase_start(ShenandoahCollectorPolicy::partial_gc_work);
>> @@ -369,6 +368,7 @@
>>      }
>>    }
>>
>> +  end:
>>    _heap->gc_timer()->register_gc_end();
>>  }
>>
>>
>> -Aleksey
>>
>> On 05/31/2017 09:30 PM, Zhengyu Gu wrote:
>>> In early return case, calling _heap->gc_timer()->register_gc_end() before
>>> GCTraceTime destructor, result an assertion in GCTimer code.
>>>
>>> -Zhengyu
>>>
>>> On 05/31/2017 03:27 PM, Aleksey Shipilev wrote:
>>>> On 05/31/2017 09:25 PM, Zhengyu Gu wrote:
>>>>> Imbalanced time partition results assertion failure in debug build.
>>>>
>>>> Can you explain a little more?
>>>>
>>>> -Aleksey
>>>>
>>
>>




More information about the shenandoah-dev mailing list