RFR: 8368072: Remove redundant arguments of MarkingNMethodClosure [v2]

Stefan Karlsson stefank at openjdk.org
Fri Sep 19 08:34:40 UTC 2025


On Fri, 19 Sep 2025 08:18:37 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> "Inline" statically known value to callee to simplify `MarkingNMethodClosure`.
>> 
>> Test: tier1
>
> Albert Mingkun Yang has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - review
>  - review

src/hotspot/share/memory/iterator.hpp line 261:

> 259:  public:
> 260:   MarkingNMethodClosure(OopClosure* cl) :
> 261:       NMethodToOopClosure(cl, !NMethodToOopClosure::FixRelocations) {}

I think you should decouple MarkingNMethodClosure and NMethodToOopClosure. The later is only used to hold the same instance variables and one of them is unused after this change.


class MarkingNMethodClosure : public NMethodClosure {
  OopClosure* _cl;

public:
  MarkingNMethodClosure(OopClosure* cl) : _cl(cl) {}

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27382#discussion_r2362151898


More information about the hotspot-dev mailing list