Skip to content

Use dataAddrPtr child as the baseVar when processing TR_AddressTree - #7593

Merged
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
rmnattas:oh-seqStore
Dec 18, 2024
Merged

vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
rmnattas:oh-seqStore

Conversation

@rmnattas

Copy link
Copy Markdown
Contributor

In TR_AddressTree::process(), the first child of the aladd node is considered the base node.
With OffHeap there's 2 new cases:

  1. Array accesses have aloadi <contiguousArrayDataAddrField> to get the data address for an array, and
  2. If accessing the first element of an array there is no aladd node

This PR:

  1. uses the child of the aloadi <contiguousArrayDataAddrField> if present as the base node, and
  2. Supports the case without an aladd node, setting _offset to 0
arr[1] // byte-array
n62n        aladd (X>=0 internalPtr )                                                         [0x767885060320] bci=[-1,46,2542] rc=2 vc=426 vn=- li=- udi=- nc=2 flg=0x8100
n60n          aloadi  <contiguousArrayDataAddrField>[#373  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [0x767885060280] bci=[-1,46,2542] rc=1 vc=426 vn=- li=- udi=- nc=1 flg=0x80>
n7n               aload  <parm 0 LTestSeqStore;>[#417  Parm] [flags 0x40000107 0x0 ] (X>=0 )
n61n          lconst 1 (highWordZero X!=0 X>=0 )    
 
arr[0]
n60n        aloadi  <contiguousArrayDataAddrField>[#373  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [0x767885060280] bci=[-1,46,2542] rc=1 vc=426 vn=- li=- udi=- nc=1 flg=0x80>
n7n             aload  <parm 0 LTestSeqStore;>[#417  Parm] [flags 0x40000107 0x0 ] (X>=0 )

@rmnattas

rmnattas commented Dec 16, 2024 •

Copy link
Copy Markdown
Contributor Author

fyi @hzongaro
Testing PR

@vijaysun-omr

Copy link
Copy Markdown
Contributor

I will wait for @hzongaro review and the WIP to be taken off before I consider merging.

@rmnattas

rmnattas commented Dec 17, 2024 •

Copy link
Copy Markdown
Contributor Author

Moved (opCodeAiaddFirstChild == TR::aload || opCodeAiaddFirstChild == TR::aloadi) check to include the OffHeap first-element access case.

Reason being, currently the function process address trees loading from base variable being aload[i] nodes only, which excludes newarray.
In the OffHeap case it doesn't perform that check to the dataAddrPointer child, hence a tree like the following will be invalid normally but valid for OffHeap.

n41n      bstorei  <array-shadow>[#222  Shadow] [flags 0x80000601 0x0 ]                       [0x7ae125805470] bci=[-1,25,7] rc=0 vc=1919 vn=- li=- udi=- nc=2
n40n        aladd (X>=0 internalPtr )                                                         [0x7ae125805420] bci=[-1,25,7] rc=1 vc=1919 vn=- li=- udi=- nc=2 flg=0x8100
n9n           ==>newarray
n39n          lconst 8 (highWordZero X!=0 X>=0 )                                              [0x7ae1258053d0] bci=[-1,25,7] rc=2 vc=1919 vn=- li=- udi=- nc=0 flg=0x4104
n33n        bconst  11 (X!=0 X>=0 )                                                           [0x7ae1258051f0] bci=[-1,25,7] rc=1 vc=1919 vn=- li=- udi=- nc=0 flg=0x104

OffHeap
n40n      bstorei  <array-shadow>[#222  Shadow] [flags 0x80000601 0x0 ]                       [0x7a649c605420] bci=[-1,25,7] rc=0 vc=1862 vn=- li=- udi=- nc=2
n37n        aloadi  <contiguousArrayDataAddrField>[#373  final Shadow +8] [flags 0x20604 0x0 ] (X>=0 internalPtr )  [0x7a649c605330] bci=[-1,25,7] rc=1 vc=1862 vn=- li=- udi=- nc=1 flg=0x8>
n9n           ==>newarray
n33n        bconst  11 (X!=0 X>=0 )                                                           [0x7a649c6051f0] bci=[-1,25,7] rc=1 vc=1862 vn=- li=- udi=- nc=0 flg=0x104

That raises the question of why that case is currently invalid, but to keep OffHeap code consistent to current code I made the change.

@hzongaro hzongaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes look correct. Just one suggestion for clarity.

Comment thread compiler/infra/TreeServices.cpp Resolved
Also changing variable names to include the OffHeap case

@hzongaro hzongaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@hzongaro

Copy link
Copy Markdown
Contributor

Jenkins build all

@rmnattas
rmnattas marked this pull request as ready for review December 18, 2024 15:48
@vijaysun-omr

Copy link
Copy Markdown
Contributor

Windows, zos and riscv all have known issues at present, I believe. So I am merging this now, since other platforms have finished testing.

@vijaysun-omr
vijaysun-omr merged commit b596d79 into eclipse-omr:master Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants