RFR: 8252981: ObjectMonitor::object() cleanup changes extracted from JDK-8247281 [v2]

Aleksey Shipilev shade at openjdk.java.net
Thu Sep 10 18:37:08 UTC 2020


On Thu, 10 Sep 2020 18:34:12 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> This is a trivial review request. This changeset was tested with Mach5 Tier[1-3],4,5,6,7,8
>> testing along with JDK-8252980 and JDK-8247281.
>> 
>> Since Erik and I are both contributors, we will need one other reviewer.
>> 
>> This sub-task is tracking ObjectMonitor::object() cleanup changes
>> extracted from Erik's work on JDK-8247281. This extraction is done
>> to ease the code review for the JDK-8247281 changes.
>> 
>> Here's the core cleanup:
>> 
>> diff -r fd7f6a424cd1 src/hotspot/share/runtime/objectMonitor.hpp
>> --- a/src/hotspot/share/runtime/objectMonitor.hpp Fri Aug 28 16:43:09 2020 -0400
>> +++ b/src/hotspot/share/runtime/objectMonitor.hpp Wed Sep 02 17:22:56 2020 -0400
>> @@ -328,9 +328,9 @@
>> 
>>   public:
>> 
>> - void* object() const;
>> - void* object_addr();
>> - void set_object(void* obj);
>> + oop object() const;
>> + oop* object_addr();
>> + void set_object(oop obj);
>>    void release_set_allocation_state(AllocationState s);
>>    void set_allocation_state(AllocationState s);
>>    AllocationState allocation_state() const;
>> 
>> and those type changes ripple into the other files.
>> 
>> Note: The type for the ObjectMonitor::_object field is intentionally not
>> being changed from "void*" in this changeset. That will be done in JDK-8247281.
>
> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove left over setting of GVars.stw_random; fixed separately via JDK-8252126.

Looks okay to me (but it's late and I don't want to formally review it yet). Building with all three
{release,fastdebug,slowdebug} is usually useful to catch oop conversion problems early.

src/hotspot/share/runtime/objectMonitor.inline.hpp line 102:

> 100:
> 101: inline oop ObjectMonitor::object() const {
> 102:   return (oop)_object;

`cast_to_oop(_object)` here?

src/hotspot/share/runtime/objectMonitor.inline.hpp line 110:

> 108:
> 109: inline void ObjectMonitor::set_object(oop obj) {
> 110:   _object = (void*)obj;

`cast_from_oop<void*>(obj)` here?

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

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


More information about the hotspot-runtime-dev mailing list