Is the square brackets in output of -XX:+PrintStubCode a typo?

Wang Xue wangxue at loongson.cn
Thu Feb 21 01:43:25 UTC 2019


Hi John,


Thanks and I'm sorry to misunderstand the meaning of [..[ notation. I've 
looked up the ISO 80000-2:2009 and the notation [..[ is also used. But I 
found that the notation [..) was also used in hotspot.
Is it necessary to use [..[ or [..) uniformly? And I also think the [..) 
notaion may be more obvious.


I used the following command and manually filtered out 3 locations of 
using [..[ notation in src/hotspot/share/ . Similarly, I also filtered 
out more than 80 locations of using [..) notation in src/hotspot/share/ .


$ egrep -nr '\".*\[[^]]*\['  src/hotspot/share/


share/c1/c1_LinearScan.cpp:4099:  out->print("[%d, %d[ ", _from, _to);
share/runtime/stubCodeGenerator.cpp:63:  st->print(" [" INTPTR_FORMAT ", 
" INTPTR_FORMAT "[ (%d bytes)", p2i(begin()), p2i(end()), size_in_bytes());
share/code/vtableStubs.cpp:83:  st->print("vtable stub (index = %d, 
receiver_location = " INTX_FORMAT ", code = [" INTPTR_FORMAT ", " 
INTPTR_FORMAT "[)",


Thanks,

Wang Xue


在 2/20/19 06:26, John Rose 写道:
> On Feb 19, 2019, at 1:53 PM, Ioi Lam <ioi.lam at oracle.com> wrote:
>> Perhaps a [.....) notation would be more obvious?
> I expect it would.  It would still look like a typo to some.
>
> I didn't know this until today, but there's an ISO standard
> that defines both notations as correct.  It was superseded
> in 2009 by a standard that (AFAIK) may have rejected […[
> and settled on the more common […).  But I don't have
> $150 handy to spend on the ISO doc to make sure.
>
> (Full disclosure:  I think I was the one that wrote those
> format strings.  I didn't rely on any ISO standard.)
>
>



More information about the hotspot-runtime-dev mailing list