RFR: JDK-8256864: [windows] Improve tracing for mapping errors [v4]

Thomas Stuefe stuefe at openjdk.java.net
Tue Dec 1 20:20:57 UTC 2020


On Tue, 1 Dec 2020 20:09:38 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Print a short snippet for unknown mappings
>>  - Merge
>>  - Fix gtest for MacOS and AIX
>>  - Merge
>>  - Initial patch
>
> src/hotspot/os/windows/os_windows.cpp line 6002:
> 
>> 6000:   for (int i = 0; i < num_words; i++) {
>> 6001:     v[i] = SafeFetch32((int*)p + i, errval);
>> 6002:     if (v[i] == errval) {
> 
> How about
> if (SafeFetch32((int*)p + i, 0x1234) == 0x1234 && 
>     SafeFetch32((int*)p + i, 0x5678) == 0x5678) {
>   return;
> } else {
>   v[i] = SafeFetch32((int*)p + i, 0);
> }

Okay, I'll do that (minus the else part). I left it out because come on, its a 1 in 4 billion chance :) but the second SafeFetch only triggers when the first condition is true so this may still be cleaner.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1390


More information about the hotspot-dev mailing list