RFR: JDK-8300240: Replace NULL with nullptr in share/ci/
Johan Sjölen
jsjolen at openjdk.org
Thu Jan 19 20:28:57 UTC 2023
On Tue, 17 Jan 2023 11:07:10 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
> Do the conversion in the share/ci/ sub-directory and all of its files.
Manual fixes to be done.
All of the issues I found are now fixed and this is open for review.
src/hotspot/share/ci/ciEnv.cpp line 1357:
> 1355:
> 1356: // Look up the location descriptor for the given class and return it as a string.
> 1357: // Returns nullptr if no location is found.
fix
src/hotspot/share/ci/ciEnv.hpp line 110:
> 108:
> 109: // Look up a klass by name from a particular class loader (the accessor's).
> 110: // If require_local, result must be defined in that class loader, or nullptr.
fix
src/hotspot/share/ci/ciEnv.hpp line 272:
> 270:
> 271: // See if we already have an unloaded klass for the given name
> 272: // or return nullptr if not.
fix
src/hotspot/share/ci/ciField.cpp line 47:
> 45:
> 46: // The ciObjectFactory cannot create circular data structures in one query.
> 47: // To avoid vicious circularities, we initialize ciField::_type to nullptr
fix
src/hotspot/share/ci/ciInstance.cpp line 45:
> 43: VM_ENTRY_MARK;
> 44: oop m = get_oop();
> 45: // Return nullptr if it is not java.lang.Class.
fix
src/hotspot/share/ci/ciInstanceKlass.hpp line 75:
> 73:
> 74: // The possible values of the _implementor fall into following three cases:
> 75: // nullptr: no implementor.
fix
src/hotspot/share/ci/ciMethod.cpp line 567:
> 565: * @param [in]bci bci of the call
> 566: * @param [in]i argument number
> 567: * @param [out]type profiled type of argument, nullptr if none
fix
src/hotspot/share/ci/ciMethod.cpp line 605:
> 603: *
> 604: * @param [in]bci bci of the call
> 605: * @param [out]type profiled type of argument, nullptr if none
fix
src/hotspot/share/ci/ciMethod.cpp line 640:
> 638: *
> 639: * @param [in]i parameter number
> 640: * @param [out]type profiled type of parameter, nullptr if none
fix
src/hotspot/share/ci/ciMethod.cpp line 662:
> 660: //
> 661: // Given a certain calling environment, find the monomorphic target
> 662: // for the call. Return nullptr if the call is not monomorphic in
fix
src/hotspot/share/ci/ciMethod.cpp line 751:
> 749: // if the method in question is public, protected, or private.
> 750: // If the answer is not root_m, it is conservatively correct
> 751: // to return nullptr, even if the CHA encountered irrelevant
fix
src/hotspot/share/ci/ciMethod.cpp line 814:
> 812:
> 813: if (m == nullptr) {
> 814: // Return nullptr only if there was a problem with lookup (uninitialized class, etc.)
fix
src/hotspot/share/ci/ciMethod.hpp line 291:
> 289:
> 290: // Given a certain calling environment, find the monomorphic target
> 291: // for the call. Return nullptr if the call is not monomorphic in
fix
src/hotspot/share/ci/ciMethod.hpp line 299:
> 297:
> 298: // Given a known receiver klass, find the target for the call.
> 299: // Return nullptr if the call has no target or is abstract.
fix
src/hotspot/share/ci/ciMethodData.hpp line 406:
> 404: MethodData::CompilerCounters _orig;
> 405:
> 406: // Area dedicated to parameters. nullptr if no parameter profiling for this method.
fix
src/hotspot/share/ci/ciMethodData.hpp line 521:
> 519: parameters_size()); }
> 520:
> 521: // Get the data at an arbitrary bci, or nullptr if there is none. If m
fix
src/hotspot/share/ci/ciNullObject.hpp line 25:
> 23: */
> 24:
> 25: #ifndef SHARE_CI_CInullptrOBJECT_HPP
fix
src/hotspot/share/ci/ciObjArrayKlass.cpp line 83:
> 81: ciKlass* ciObjArrayKlass::element_klass() {
> 82: if (_element_klass == nullptr) {
> 83: assert(dimension() > 1, "_element_klass should not be nullptr");
fix
src/hotspot/share/ci/ciObject.cpp line 94:
> 92: // ciObject::ciObject
> 93: //
> 94: // nullptr variant. Used only by ciNullObject.
fix
src/hotspot/share/ci/ciObject.cpp line 116:
> 114: if (_klass == nullptr) {
> 115: if (_handle == nullptr) {
> 116: // When both _klass and _handle are nullptr, we are dealing
fix
src/hotspot/share/ci/ciObject.hpp line 56:
> 54: private:
> 55: // A JNI handle referring to an oop in the VM. This
> 56: // handle may, in a small set of cases, correctly be nullptr.
fix
src/hotspot/share/ci/ciTypeFlow.cpp line 591:
> 589: ciKlass* klass = str->get_klass(will_link);
> 590: if (!will_link) {
> 591: // VM's interpreter will not load 'klass' if object is nullptr.
fix
src/hotspot/share/ci/ciTypeFlow.hpp line 177:
> 175: T_LONG2 = T_SHORT, // 2nd word of T_LONG
> 176: T_DOUBLE2 = T_CHAR, // 2nd word of T_DOUBLE
> 177: T_nullptr = T_BYTE // for now.
fix
src/hotspot/share/ci/ciTypeFlow.hpp line 183:
> 181: static ciType* long2_type() { return ciType::make((BasicType)T_LONG2); }
> 182: static ciType* double2_type(){ return ciType::make((BasicType)T_DOUBLE2); }
> 183: static ciType* null_type() { return ciType::make((BasicType)T_nullptr); }
fix
src/hotspot/share/ci/ciTypeFlow.hpp line 336:
> 334: // pop_objArray and pop_typeArray narrow the tos to ciObjArrayKlass
> 335: // or ciTypeArrayKlass (resp.). In the rare case that an explicit
> 336: // null is popped from the stack, we return nullptr. Caller beware.
fix
src/hotspot/share/ci/ciTypeFlow.hpp line 821:
> 819:
> 820: // Return an existing block containing bci which has a JsrSet compatible
> 821: // with jsrs, or nullptr if there is none.
fix
-------------
PR: https://git.openjdk.org/jdk/pull/12029
More information about the hotspot-compiler-dev
mailing list