RFR: 8146709: AArch64: Incorrect use of ADRP for byte_map_base

Andrew Haley aph at redhat.com
Mon Jan 11 16:34:48 UTC 2016


On 01/11/2016 04:23 PM, Andrew Dinn wrote:
> However, I am not clear how we arrive at the circumstance it is meant to
> fix. How do we end up with a negative byte_map_base -- is that when we
> have a zero-based heap? How do we get a circumstance where it is 'not
> [necessarily] an address'?

Imagine that we have a large heap, and it is mapped fairly high in
memory.  Imagine also that our byte map is mapped low in memory.

An index into the byte map is byte_map_base[addr >> 9].  So,

  byte_map_base = _byte_map - (uintptr_t(low_bound) >> 9)

There's nothing which will prevent (low_bound >> 9) from being greater
than _byte_map.  I don't think it's happened, but there are warnings
about this in the source code.  Think of it as future proofing.

> If we do have a negative value with a zero-based heap then
> load_byte_map_base calls mov_immediate64. Would it plant a single
> movz and single movk in this case or will it require more than one
> movk?

If it ever happens, that depends on the exact value of byte_map_base.
mov_immediate64, as you know, tries very hard to do the right thing.

Andrew.


More information about the hotspot-dev mailing list