On Wed, 25 Jan 2023 11:47:05 GMT, Johan Sjölen <jsjo...@openjdk.org> wrote:

> Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory 
> share/prims/. Unfortunately the script that does the change isn't perfect, 
> and so we
> need to comb through these manually to make sure nothing has gone wrong. I 
> also review these changes but things slip past my eyes sometimes.
> 
> Here are some typical things to look out for:
> 
> 1. No changes but copyright header changed (probably because I reverted some 
> changes but forgot the copyright).
> 2. Macros having their NULL changed to nullptr, these are added to the script 
> when I find them. They should be NULL.
> 3. nullptr in comments and logs. We try to use lower case "null" in these 
> cases as it reads better. An exception is made when code expressions are in a 
> comment.
> 
> An example of this:
> 
> ```c++
> // This function returns null
> void* ret_null();
> // This function returns true if *x == nullptr
> bool is_nullptr(void** x);
> 
> 
> Note how `nullptr` participates in a code expression here, we really are 
> talking about the specific value `nullptr`.
> 
> Thanks!

Changes requested by kbarrett (Reviewer).

src/hotspot/share/prims/jvmtiEnvThreadState.cpp line 151:

> 149: }
> 150: 
> 151: // Use _thread_saved if cthread is detached from JavaThread (_thread == 
> null).

s/null/nullptr/ or s/==/is/

src/hotspot/share/prims/jvmtiImpl.cpp line 125:

> 123:   GrowableElement *e1 = (GrowableElement *) v;
> 124:   assert(e1 != nullptr, "e1 != null");
> 125:   assert(e2 != nullptr, "e2 != null");

s/null/nullptr/ ?

src/hotspot/share/prims/jvmtiImpl.cpp line 162:

> 160: GrowableElement* GrowableCache::at(int index) {
> 161:   GrowableElement *e = (GrowableElement *) _elements->at(index);
> 162:   assert(e != nullptr, "e != null");

s/null/nullptr/ ?

src/hotspot/share/prims/jvmtiImpl.cpp line 180:

> 178: void GrowableCache::remove (int index) {
> 179:   GrowableElement *e = _elements->at(index);
> 180:   assert(e != nullptr, "e != null");

s/null/nullptr/ ?

src/hotspot/share/prims/jvmtiImpl.cpp line 412:

> 410:   if (_jvmti_breakpoints != nullptr) return (*_jvmti_breakpoints);
> 411:   _jvmti_breakpoints = new JvmtiBreakpoints(listener_fun);
> 412:   assert(_jvmti_breakpoints != nullptr, "_jvmti_breakpoints != null");

s/null/nullptr/ ?

src/hotspot/share/prims/jvmtiImpl.cpp line 418:

> 416: void  JvmtiCurrentBreakpoints::listener_fun(void *this_obj, address 
> *cache) {
> 417:   JvmtiBreakpoints *this_jvmti = (JvmtiBreakpoints *) this_obj;
> 418:   assert(this_jvmti != nullptr, "this_jvmti != null");

s/null/nullptr/ ?

src/hotspot/share/prims/methodHandles.cpp line 1024:

> 1022: #define VALUE_COMMA(scope,value) scope::value,
> 1023: static const int con_values[con_value_count+1] = { 
> EACH_NAMED_CON(VALUE_COMMA, IGNORE_REQ) 0 };
> 1024: #define STRING_nullptr(scope,value) #value "\0"

Should not be changed.

src/hotspot/share/prims/methodHandles.cpp line 1025:

> 1023: static const int con_values[con_value_count+1] = { 
> EACH_NAMED_CON(VALUE_COMMA, IGNORE_REQ) 0 };
> 1024: #define STRING_nullptr(scope,value) #value "\0"
> 1025: static const char con_names[] = { EACH_NAMED_CON(STRING_nullptr, 
> IGNORE_REQ) };

Should not be changed.

src/hotspot/share/prims/methodHandles.cpp line 1046:

> 1044: #undef ONE_PLUS
> 1045: #undef VALUE_COMMA
> 1046: #undef STRING_nullptr

Should not be changed.

src/hotspot/share/prims/upcallLinker.cpp line 100:

> 98: 
> 99:   // For the profiler, the last_Java_frame information in thread must 
> always be in
> 100:   // legal state. We have no last Java frame if last_Java_sp == null so

s/null/nullptr/ ?

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

PR: https://git.openjdk.org/jdk/pull/12188

Reply via email to