RFR: 8272723: Don't use Access API to access primitive fields [v2]

Stefan Karlsson stefank at openjdk.java.net
Fri Aug 20 06:32:33 UTC 2021


On Thu, 19 Aug 2021 16:05:54 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> For earlier incarnations of Shenandoah, we needed to put barriers before accessing primitive fields. This is no longer necessary nor implemented/used by any GC, and we should simplify the code to do plain access instead.
>> 
>> (We may want to remove remaining primitive access machinery in the Access API soon)
>> 
>> Testing:
>>  - [x] tier1
>>  - [ ] tier2
>>  - [ ] hotspot_gc
>
> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove remaining primitive Access API uses

src/hotspot/share/jvmci/jvmciJavaClasses.cpp line 234:

> 232:       InstanceKlass* ik = className::klass();                                                                             \
> 233:       oop base = ik->static_field_base_raw();                                                                             \
> 234:       return *base->field_addr<jtypename>(className::_##name##_offset);                                                    \

Need to align the right end.

src/hotspot/share/jvmci/jvmciJavaClasses.cpp line 240:

> 238:       InstanceKlass* ik = className::klass();                                                                             \
> 239:       oop base = ik->static_field_base_raw();                                                                             \
> 240:       *base->field_addr<jtypename>(className::_##name##_offset) = x;                                                       \

alignment

src/hotspot/share/oops/oop.hpp line 125:

> 123: 
> 124:   // Need this as public for garbage collection.
> 125:   template <class T> inline T* obj_field_addr(int offset) const;

The `template<typename T>` doesn't match the style used for obj_field_addr.

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

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


More information about the hotspot-dev mailing list