On Thu, 1 Sep 2022 20:10:45 GMT, Alex Menkov <[email protected]> wrote:
>> Chris Plummer has updated the pull request with a new target base due to a
>> merge or a rebase. The pull request now contains four commits:
>>
>> - Merge
>> - Fix jcheck error
>> - Undo some temp test changes.
>> - Fix 64-bit alignment requirements
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java
> line 242:
>
>> 240: private boolean canUsePageCacheFor64bitRead(long address) {
>> 241: long pageMask = ~(pageSize - 1);
>> 242: if ((address & pageMask) != ((address + 4) & pageMask)) {
>
> This looks a bit over-complicated.
> Maybe something like
> ` long pageMask = pageSize - 1;
> if ((address & pageMask) > (pageSize - 8)) {
> return false;
> }`
I tinkered with this code quite a bit before I had something that both worked
and I liked. I don't know that your approach is actually any simpler, and at
the moment I still prefer mine, but that might just be because I'm more
familiar with it. However, it does seem that there should be a more elegant way
of doing this.
-------------
PR: https://git.openjdk.org/jdk/pull/10090