Skip to content

Update Unsafe.copyMemory transformation to support offheap #19634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

rmnattas
Copy link
Contributor

@rmnattas rmnattas commented Jun 5, 2024

TODO

  • Move implementation to J9TrnasformUtil
  • Call it from value propagation and codegen lowertrees (LINK)
  • Do transformation in VP's doDelayedTransformations

Depends on eclipse-omr/omr#7391

Example transformation trees
Before:

n816n     BBStart <block_50> (freq 18252)                                                     [    0x736558e0eec0] bci=[8,31,1293] rc=0 vc=214 vn=- li=- udi=- nc=0
n366n     treetop                                                                             [    0x736558e06220] bci=[8,28,1291] rc=0 vc=243 vn=- li=- udi=- nc=1
n365n       call  jdk/internal/misc/Unsafe.copyMemory0(Ljava/lang/Object;JLjava/lang/Object;JJ)V[#480  final native special Method] [flags 0x20500 0x0 ] ()  [    0x736558e061d0] bci=[8,28,1291] rc=1 vc=243 vn=- li=- udi=- n>
n359n         aload  <temp slot 10>[#532  Auto] [flags 0x20000007 0x0 ] (X!=0 )               [    0x736558e05ff0] bci=[8,19,1291] rc=1 vc=243 vn=- li=- udi=- nc=0 flg=0x4
n360n         aload  <parm 1 [I>[#404  Parm] [flags 0x40000107 0x0 ]                          [    0x736558e06040] bci=[8,20,1291] rc=1 vc=243 vn=- li=- udi=- nc=0
n890n         lconst 8 (highWordZero X!=0 X>=0 )                                              [    0x736558f205f0] bci=[-1,10,15] rc=1 vc=243 vn=- li=- udi=- nc=0 flg=0x4104
n362n         aload  <parm 2 Ljava/lang/Object;>[#405  Parm] [flags 0x40000107 0x0 ]          [    0x736558e060e0] bci=[8,22,1291] rc=1 vc=243 vn=- li=- udi=- nc=0
n363n         lload  <auto slot 3>[#409  Auto] [flags 0x4 0x0 ]                               [    0x736558e06130] bci=[8,24,1291] rc=1 vc=243 vn=- li=- udi=- nc=0
n891n         lconst 4 (highWordZero X!=0 X>=0 )                                              [    0x736558f20640] bci=[-1,15,15] rc=1 vc=243 vn=- li=- udi=- nc=0 flg=0x4104
n343n     BBEnd </block_50> =====                                                             [    0x736558e05af0] bci=[8,31,1293] rc=0 vc=243 vn=- li=- udi=- nc=0

After:

n816n     BBStart <block_50> (freq 18252)                                                     [    0x736558e0eec0] bci=[8,31,1293] rc=0 vc=275 vn=- li=- udi=- nc=0
n1071n    treetop                                                                             [    0x736558f23e80] bci=[8,20,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n360n       aload  <parm 1 [I>[#404  Parm] [flags 0x40000107 0x0 ]                            [    0x736558e06040] bci=[8,20,1291] rc=3 vc=275 vn=- li=- udi=- nc=0
n1078n    astore  <temp slot 8>[#537  Auto] [flags 0x7 0x0 ]                                  [    0x736558f240b0] bci=[8,20,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n360n       ==>aload
n1072n    treetop                                                                             [    0x736558f23ed0] bci=[8,22,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n362n       aload  <parm 2 Ljava/lang/Object;>[#405  Parm] [flags 0x40000107 0x0 ]            [    0x736558e060e0] bci=[8,22,1291] rc=3 vc=275 vn=- li=- udi=- nc=0
n1077n    astore  <temp slot 7>[#536  Auto] [flags 0x7 0x0 ]                                  [    0x736558f24060] bci=[8,22,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n362n       ==>aload
n1073n    treetop                                                                             [    0x736558f23f20] bci=[8,24,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n363n       lload  <auto slot 3>[#409  Auto] [flags 0x4 0x0 ] (cannotOverflow )               [    0x736558e06130] bci=[8,24,1291] rc=2 vc=275 vn=- li=- udi=- nc=0 flg=0x1000
n1076n    lstore  <temp slot 6>[#535  Auto] [flags 0x4 0x0 ]                                  [    0x736558f24010] bci=[8,24,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n363n       ==>lload
n1084n    astore  <temp slot 9>[#538  Auto] [flags 0x7 0x0 ]                                  [    0x736558f24290] bci=[8,20,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n360n       ==>aload
n1095n    astore  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                                 [    0x736558f24600] bci=[8,22,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n362n       ==>aload
n1075n    BBEnd </block_50> =====                                                             [    0x736558f23fc0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1074n    BBStart <block_135> (freq 18252)                                                    [    0x736558f23f70] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n1091n    ifacmpeq --> block_137 BBStart at n1085n ()                                         [    0x736558f244c0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=2 flg=0x20
n1089n      aload  <temp slot 9>[#538  Auto] [flags 0x7 0x0 ]                                 [    0x736558f24420] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1090n      aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x736558f24470] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0 flg=0x302
n1088n    BBEnd </block_135> =====                                                            [    0x736558f243d0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1087n    BBStart <block_138> (freq 18252)                                                    [    0x736558f24380] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n1094n    astore  <temp slot 9>[#538  Auto] [flags 0x7 0x0 ]                                  [    0x736558f245b0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n1093n      aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x736558f24560] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=1 flg=0x8000
n1092n        aload  <temp slot 9>[#538  Auto] [flags 0x7 0x0 ]                               [    0x736558f24510] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1086n    BBEnd </block_138> =====                                                            [    0x736558f24330] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1085n    BBStart <block_137> (freq 18252)                                                    [    0x736558f242e0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n1102n    ifacmpeq --> block_139 BBStart at n1096n ()                                         [    0x736558f24830] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=2 flg=0x20
n1100n      aload  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                                [    0x736558f24790] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1101n      aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x736558f247e0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0 flg=0x302
n1104n    BBEnd </block_137> =====                                                            [    0x736558f248d0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1103n    BBStart <block_141> (freq 18252)                                                    [    0x736558f24880] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n1112n    ificmpeq --> block_139 BBStart at n1096n ()                                         [    0x736558f24b50] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=2 flg=0x20
n1110n      iand                                                                              [    0x736558f24ab0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=2
n1108n        l2i                                                                             [    0x736558f24a10] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=1
n1107n          lloadi  <isClassAndDepthFlags>[#317  Shadow +24] [flags 0x603 0x0 ]           [    0x736558f249c0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=1
n1106n            aloadi  <vft-symbol>[#320  Shadow] [flags 0x18607 0x0 ]                     [    0x736558f24970] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=1
n1105n              aload  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                        [    0x736558f24920] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1109n        iconst 0x10000 (X!=0 X>=0 )                                                     [    0x736558f24a60] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0 flg=0x104
n1111n      iconst 0                                                                          [    0x736558f24b00] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1099n    BBEnd </block_141> =====                                                            [    0x736558f24740] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1098n    BBStart <block_140> (freq 18252)                                                    [    0x736558f246f0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n1115n    astore  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                                 [    0x736558f24c40] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=1
n1114n      aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x736558f24bf0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=1 flg=0x8000
n1113n        aload  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                              [    0x736558f24ba0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1097n    BBEnd </block_140> =====                                                            [    0x736558f246a0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0

n1096n    BBStart <block_139> (freq 18252)                                                    [    0x736558f24650] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=0
n366n     treetop                                                                             [    0x736558e06220] bci=[8,28,1291] rc=0 vc=275 vn=- li=- udi=- nc=1
n365n       arraycopy  jdk/internal/misc/Unsafe.copyMemory0(Ljava/lang/Object;JLjava/lang/Object;JJ)V[#480  final native special Method] [flags 0x20500 0x0 ] ()  [    0x736558e061d0] bci=[8,28,1291] rc=1 vc=275 vn=- li=- udi=- nc=3 flg=0x20
n1119n        aladd                                                                           [    0x736558f24d80] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=2
n1117n          aload  <temp slot 9>[#538  Auto] [flags 0x7 0x0 ]                             [    0x736558f24ce0] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n890n           lconst 8 (highWordZero X!=0 X>=0 )                                            [    0x736558f205f0] bci=[-1,10,15] rc=2 vc=275 vn=- li=- udi=- nc=0 flg=0x4104
n1120n        aladd                                                                           [    0x736558f24dd0] bci=[8,28,1291] rc=0 vc=0 vn=- li=- udi=- nc=2
n1118n          aload  <temp slot 10>[#539  Auto] [flags 0x7 0x0 ]                            [    0x736558f24d30] bci=[8,28,1291] rc=1 vc=0 vn=- li=- udi=- nc=0
n1081n          lload  <temp slot 6>[#535  Auto] [flags 0x4 0x0 ]                             [    0x736558f241a0] bci=[8,24,1291] rc=2 vc=0 vn=- li=- udi=- nc=0
n891n         lconst 4 (highWordZero X!=0 X>=0 )                                              [    0x736558f20640] bci=[-1,15,15] rc=1 vc=275 vn=- li=- udi=- nc=0 flg=0x4104
n1083n    BBEnd </block_139> =====                                                            [    0x736558f24240] bci=[8,31,1293] rc=0 vc=275 vn=- li=- udi=- nc=0

@rmnattas
Copy link
Contributor Author

rmnattas commented Jun 5, 2024

@zl-wang @jdmpapin
This is the changes for Unsafe.copyMemory transformation for offheap, code is in its final shape for an early review.

@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch 3 times, most recently from 16622e7 to 5b24adf Compare June 5, 2024 18:30
@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch from 5b24adf to dd3ccc0 Compare June 21, 2024 22:05
@rmnattas
Copy link
Contributor Author

rmnattas commented Jun 21, 2024

Just pushed the changes to:

  • Move implementation to J9TrnasformUtil
  • Call it from value propagation and codegen lowertrees (LINK)
  • Do transformation in VP's doDelayedTransformations

Will look up the review feedback next.

PR now depends on eclipse-omr/omr#7391

@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch 4 times, most recently from 10815b6 to fb1363c Compare June 25, 2024 14:02
@rmnattas rmnattas marked this pull request as ready for review June 25, 2024 14:29
@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch 2 times, most recently from bbe37ab to 387a56c Compare June 26, 2024 14:25
Copy link
Contributor

@jdmpapin jdmpapin left a comment

Choose a reason for hiding this comment

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

Thanks for all of your edits. One more round of comments - hopefully the last 😅

@jdmpapin
Copy link
Contributor

Oh, could I also bother you to add a comment to the code explaining why all interface types in signatures allow arrays (not just the interfaces actually implemented by arrays)? I don't want somebody to come across it and change it thinking that it's being overly conservative

@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch from 387a56c to fbaee3f Compare June 26, 2024 19:04
@rmnattas
Copy link
Contributor Author

rmnattas commented Jun 26, 2024

Pushed requested changes.
There's an issue when the code is executed from lowerTrees, not necessarily form the last set of changes but seem like something from the last few days, investigating.

Copy link
Contributor

@jdmpapin jdmpapin left a comment

Choose a reason for hiding this comment

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

There's a problem with the line ending check now, but otherwise I'm just waiting to hear about what's going on with lowerTrees()

@rmnattas
Copy link
Contributor Author

Found issue, not sure why... the change to use loading original symRef is causing the issue.

astore srcAddrTmp
  aload src

<NULL CHECK TREE>

astore srcAddrTmp
  aloadi <dataAddr>
    aload src  <---- instead of "aload srcAddrTmp"

Trees before:

n180n     astore  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2800] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n118n       ==>aRegLoad
n191n     astore  <temp slot 13>[#441  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2b70] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n117n       ==>aRegLoad

n187n     ifacmpeq --> block_20 BBStart at n181n ()                                           [    0x730ccb0a2a30] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=2 flg=0x20
n185n       aload  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]
n186n       aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x730ccb0a29e0] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=0 flg=0x302
n190n     astore  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2b20] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n189n       aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x730ccb0a2ad0] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=1 fl>
n188n         aload  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]                              [    0x730ccb0a2a80] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=0

n198n     ifacmpeq --> block_22 BBStart at n192n ()                                           [    0x730ccb0a2da0] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=2 flg=0x20
n196n       aload  <temp slot 13>[#441  Auto] [flags 0x7 0x0 ]
n197n       aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x730ccb0a2d50] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=0 flg=0x302
n201n     astore  <temp slot 13>[#441  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2e90] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n200n       aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x730ccb0a2e40] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=1 fl>
n199n         aload  <temp slot 13>[#441  Auto] [flags 0x7 0x0 ]                              [    0x730ccb0a2df0] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=0

After:

n180n     astore  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2800] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n118n       ==>aRegLoad
n191n     astore  <temp slot 13>[#441  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2b70] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n117n       ==>aRegLoad

 [    0x7fc418d3a250]   1       std     [gr14, 0], gr30         # SymRef  <temp slot 7>[#435  Auto] [flags 0x7 0x0 ]
 [    0x7fc418d3a570]   5       std     [gr14, 0], gr31         # SymRef  <temp slot 8>[#436  Auto] [flags 0x7 0x0 ]


n187n     ifacmpeq --> block_20 BBStart at n181n ()                                           [    0x730ccb0a2a30] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=2 flg=0x20
n185n       aRegLoad gr30   <parm 1 [I>[#404  Parm] [flags 0x40000107 0x0 ] (SeenRealReference )  [    0x730ccb0a2990] bci=[-1,12,13] rc=1 vc=354 vn=- li=9 udi=- nc=0 flg=0x8000
n186n       aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x730ccb0a29e0] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=0 flg=0x302
n190n     astore  <temp slot 12>[#440  Auto] [flags 0x7 0x0 ]                                 [    0x730ccb0a2b20] bci=[-1,12,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n189n       aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x730ccb0a2ad0] bci=[-1,12,13] rc=1 vc=354 vn=- li=- udi=- nc=1 fl>
n147n         aRegLoad gr30   <parm 1 [I>[#404  Parm] [flags 0x40000107 0x0 ] (SeenRealReference )  [    0x72d3b07a1db0] bci=[-1,1,13] rc=1 vc=354 vn=- li=2 udi=- nc=0 flg=0x8000

 [    0x7fc418d3b4e0]   11      Label L0064:    
 [    0x7fc418d3b7e0]   1       cmpdi   cr0, gr3, 0
 [    0x7fc418d3b880]   1       beq     cr0, Label L0018
 [    0x7fc418d3c770]   11      Label L0080:    
 [    0x7fc418d3cc90]   1       ld      gr3, [gr3, 8]           # SymRef  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ]
 [    0x7fc418d3cda0]   1       std     [gr14, 0], gr3          # SymRef  <temp slot 7>[#435  Auto] [flags 0x7 0x0 ]


n157n     ifacmpeq --> block_16 BBStart at n151n ()                                           [    0x72d3b07a20d0] bci=[-1,5,13] rc=0 vc=354 vn=- li=- udi=- nc=2 flg=0x20
n155n       aRegLoad gr31   <parm 2 [I>[#405  Parm] [flags 0x40000107 0x0 ] (SeenRealReference )  [    0x72d3b07a2030] bci=[-1,5,13] rc=1 vc=354 vn=- li=2 udi=- nc=0 flg=0x8000
n156n       aconst NULL (X==0 X>=0 X<=0 )                                                     [    0x72d3b07a2080] bci=[-1,5,13] rc=1 vc=354 vn=- li=- udi=- nc=0 flg=0x302
n160n     astore  <temp slot 8>[#436  Auto] [flags 0x10007 0x0 ]                              [    0x72d3b07a21c0] bci=[-1,5,13] rc=0 vc=354 vn=- li=- udi=- nc=1
n159n       aloadi  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ] (internalPtr )  [    0x72d3b07a2170] bci=[-1,5,13] rc=1 vc=354 vn=- li=- udi=- nc=1 flg>
n158n         aRegLoad gr31   <parm 2 [I>[#405  Parm] [flags 0x40000107 0x0 ] (SeenRealReference )  [    0x72d3b07a2120] bci=[-1,5,13] rc=1 vc=354 vn=- li=2 udi=- nc=0 flg=0x8000


 [    0x7fc418d3dd70]   11      Label L0018:    
 [    0x7fc418d3e050]   5       cmpdi   cr0, gr3, 0
 [    0x7fc418d3e0f0]   5       beq     cr0, Label L0019
 [    0x7fc418d3efe0]   11      Label L0096:    
 [    0x7fc418d3f400]   5       ld      gr3, [gr3, 8]           # SymRef  <contiguousArrayDataAddrFieldSymbol>[#352  final Shadow +8] [flags 0x20604 0x0 ]
 [    0x7fc418d3f510]   5       std     [gr14, 0], gr3          # SymRef  <temp slot 8>[#436  Auto] [flags 0x7 0x0 ]

Its using the wrong register (r3 instead of r31/r31) for loading src/dest in the nullCheck and adjust trees

@jdmpapin
Copy link
Contributor

jdmpapin commented Jun 27, 2024

It's made inappropriate copies of the aRegLoad nodes. I think each should have been stored into two temps at the end of currentBlock: the regular collected one created by Block::split(), and then the second explicitly created non-collected one (though I only see one of the two stores in the "after" trees snippet). The problem would be that we're passing the original src or dest node to insertUnsafeCopyMemoryArgumentChecksAndAdjustForOffHeap() when instead we should pass the corresponding fixed-up child of arraycopyNode, which will be a load as expected

@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch 2 times, most recently from a438d22 to 142b7c0 Compare June 27, 2024 17:04
The transformation is performed in lowerTrees and VP, given that the
transformation changes control flow its in VP DelayedTransformations
@rmnattas rmnattas force-pushed the off-heap-unsafeMod branch from 142b7c0 to 01f382c Compare June 27, 2024 17:05
@rmnattas
Copy link
Contributor Author

Thank you @jdmpapin for all the help and suggestions.

@jdmpapin
Copy link
Contributor

I'm guessing that these latest changes actually fixed the problem with lowerTrees(). Could you please confirm?

@rmnattas
Copy link
Contributor Author

Yes 👍

@jdmpapin
Copy link
Contributor

Running limited testing because all changes are guarded by J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION except:

  • a pair of curly braces newly delimiting a scope, and
  • the declaration and initialization of _offHeapCopyMemory (a List) in J9::ValuePropagation.

At the moment, the guarded changes will not be exercised or even built in a PR build anyway

Jenkins test sanity xlinux jdk21

@jdmpapin jdmpapin merged commit 9d874fc into eclipse-openj9:master Jun 28, 2024
5 checks passed
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.

2 participants