RFR 8209087: Clean up runtime code that compares 'this' to NULL (original) (raw)

Gerard Ziemski gerard.ziemski at oracle.com
Wed Oct 17 17:41:33 UTC 2018


hi Harold,

Looks good. One question though:

In http://cr.openjdk.java.net/~hseigel/bug_8209087/webrev/src/hotspot/share/runtime/perfData.inline.hpp.frames.html

60 inline bool PerfDataManager::exists(const char* name) { 61 if (_all != NULL) { 62 return _all->contains(name); 63 } else { 64 return false; 65 } 66 }

the function “PerfDataManager::exists" can return “false” if “_all"== NULL, when before it would return “false” only if "_all->contains(name)” returned false (it assumed “_all”!= NULL). Is "_all” ever allowed to be “null” here? Is line 64 returning “false”, the same as line 62 returning “false”?

Similar question for http://cr.openjdk.java.net/~hseigel/bug_8209087/webrev/src/hotspot/share/runtime/perfData.cpp.frames.html

cheers

On Oct 17, 2018, at 8:05 AM, Harold David Seigel <harold.seigel at oracle.com> wrote:

Hi, Please review this JDK-12 fix for JDK-8209087. This fix removes comparisons of 'this' to 'NULL' from the three remaining methods containing this code. Callers of these methods were looked at to see if their calling object might be NULL. If so, then checks for NULL were added to these callers. Open Webrev: http://cr.openjdk.java.net/~hseigel/bug8209087/webrev/index.html JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8209087 The fix was tested by running Mach5 tiers 1 and 2 tests and builds on Linux-x64, Windows, and Mac OS X, running tiers 3-5 tests on Linux-x64, and by running JCK-12 Lang and VM tests on Linux-x64. Thanks, Harold



More information about the hotspot-runtime-dev mailing list