RFR: 8295214: Generational ZGC: Guard nmethods from cross modifying code

David Holmes dholmes at openjdk.org
Thu Nov 10 04:55:34 UTC 2022


On Wed, 9 Nov 2022 10:42:47 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> src/hotspot/share/runtime/safepointMechanism.cpp line 108:
>> 
>>> 106:     if (prev_poll_word != poll_word ||
>>> 107:         prev_poll_word == _poll_word_armed_value) {
>>> 108:       // After updating the poll value, we allow entering new nmethods
>> 
>> I'm a little confused about the positioning here. The comment says "after updating the poll value", but we haven't updated yet (happens below) so don't we need the fence after that point?
>
> The important thing is that it is called after the handshake/safepoint/stack watermark operation. The wording is just unfortunate. Maybe I should change it to "While updating the poll value" to be less confusing? Does that read better?

Yes "while" reads better - thanks.

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

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


More information about the hotspot-dev mailing list