Adjust arguments to Unsafe.setMemory() on PPC when offheap is enabled - #7145
Conversation
08e3c4a to
259e57f
Compare
64105ac to
b839c7f
Compare
9287df5 to
89f16f3
Compare
|
@zl-wang omr changes for Unsafe.setmemory are done! When you have a chance, could you please review and (if everything looks good) merge? Just as a note: I mentioned this above as well, but this PR is dependent on this one (eclipse-openj9/openj9#18288), so they need to be merged together |
zl-wang
left a comment
There was a problem hiding this comment.
high-level (applicable to whole implementation):
- watch out for coding style and indentation requirement;
- you need to spell out those registers cannot be gr0 (otherwise, you can run into unexpected results). Just look for code examples of other fast-path implementations.
|
there are a lot you need to re-do. i suspected stxvl semantic was not understood completely before implementation started. |
89f16f3 to
3fbc461
Compare
zl-wang
left a comment
There was a problem hiding this comment.
let me know when you made substantial progress on this re-work.
3fbc461 to
d3335f6
Compare
When Unsafe.setMemory() is called on an array and offheap changes are enabled, adjust arguments so that dataAddr is passed in as base address of object. Signed-off-by: midronij <jackie.midroni@ibm.com>
5a082aa to
b0ebe22
Compare
zl-wang
left a comment
There was a problem hiding this comment.
i will come back to finish the review tmr
ba5f9a2 to
5455f66
Compare
|
you seemed adding local variables as you go. you might have a high-level frame-work in your mind, but it is not exhibited clearly. that makes reading your code harder. i need to jump up and down the code to piece them together ... making senses of the consistency of various conditions. strongly recommend you to program in a style easier to follow. |
5455f66 to
2b9817b
Compare
2b9817b to
a0700bc
Compare
fc7a0f0 to
48db45b
Compare
|
@zl-wang I've addressed your most recent round of review comments. If everything looks good, then I believe we can move on to CI testing |
zl-wang
left a comment
There was a problem hiding this comment.
simple changes i expected ...
48db45b to
bf08bc6
Compare
Only generate runtime array check in setmemoryEvaluator() if it is needed (i.e.: object type is unknown at compile time). Signed-off-by: midronij <jackie.midroni@ibm.com>
In situations where an array check is needed, there are scenarios in
which we do not want to modify the dest base address:
1.) If the object is a NULL reference (since we can't load dataAddr
from a NULL pointer)
2.) If the object is a non-array object
Thus, before the array check is performed, a null test is needed to
account for situation (1).
Signed-off-by: midronij <jackie.midroni@ibm.com>
bf08bc6 to
d51cac0
Compare
zl-wang
left a comment
There was a problem hiding this comment.
Looks reasonable now ...
|
@vijaysun-omr this needs a coordinated merge together with eclipse-openj9/openj9#18288 |
d51cac0 to
2d93e3e
Compare
|
jenkins build all |
|
jenkins build aix,plinux |
…stant When destOffset is a constant 16-bit value, it can be represented as the immediate value argument to addi when calculating the final destination address (i.e.: dest = base address + offset). This allows us to allocate one less register when generating the assembly code sequence for Unsafe.setMemory(). Signed-off-by: midronij <jackie.midroni@ibm.com>
On P8 and higher, we can make use of vector stores (stxvd2x and, for P10 specifically, stxvl) to reduce the number of memory accesses and avoid checks needed to set residual bytes in the assembly code that is generated for Unsafe.setMemory(). Signed-off-by: midronij <jackie.midroni@ibm.com>
2d93e3e to
e714da1
Compare
|
jenkins build aix,plinux |
Add runtime array check to generated assembly code for Unsafe.setMemory() on PPC and, when offheap/balanced GC policy is in use, generate assembly code to perform an arrayCHK and, if the object is an array, adjust the arguments as follows:
Subtract the array header size from the offsetno longer necessary due to this change: Array base offset zero eclipse-openj9/openj9#19326In addition, as a performance improvement for both the offheap and gencon cases on P8 and up, use vector instructions (
stxvd2xand, on P10 only,stxvl) to reduce loop iterations when setting bytes in memory to specified value.Depends on: eclipse-openj9/openj9#18288