8256814: WeakProcessorPhases may be redundant#1862
8256814: WeakProcessorPhases may be redundant#1862kimbarrett wants to merge 6 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back kbarrett! A progress list of the required criteria for merging this PR into |
|
@kimbarrett Unknown command |
|
@kimbarrett The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
|
/summary Remove WeakProcessorPhase, adding scoped enum categories to OopStorageSet. |
|
@kimbarrett Setting summary to |
|
/label remove hotspot |
|
@kimbarrett |
|
@kimbarrett |
|
/label add jfr |
|
@kimbarrett |
|
@kimbarrett The label
|
|
/label add hotspot-jfr |
|
@kimbarrett |
stefank
left a comment
There was a problem hiding this comment.
I think this looks good. I have a few comments that I would like to get addressed, but they are not blockers if you want to proceed with what you have.
| ParStateArray _par_states; | ||
|
|
||
| // Base class for OopStorageSet{Strong,Weak}ParState. | ||
| template<typename T, bool concurrent, bool is_const> |
There was a problem hiding this comment.
While reviewing this, it was not immediately obvious what T represent. EnumRange uses the name StorageId, maybe use the same here?
| typedef ValueObjArray<ParStateType, OopStorageSet::strong_count> ParStateArray; | ||
|
|
||
| ParStateArray _par_states; | ||
|
|
||
| // Base class for OopStorageSet{Strong,Weak}ParState. | ||
| template<typename T, bool concurrent, bool is_const> | ||
| class OopStorageSetParState { | ||
| public: | ||
| OopStorageSetStrongParState(); | ||
| using ParState = OopStorage::ParState<concurrent, is_const>; | ||
|
|
||
| template <typename Closure> | ||
| void oops_do(Closure* cl); | ||
| ParState* par_state(T id) const { | ||
| return _par_states.at(checked_cast<int>(EnumRange<T>().index(id))); | ||
| } | ||
|
|
||
| ParStateType* par_state(int i) const { return _par_states.at(i); } | ||
| int par_state_count() const { return _par_states.count(); } | ||
| }; | ||
| protected: | ||
| OopStorageSetParState() : _par_states(OopStorageSet::Range<T>().begin()) {} | ||
| ~OopStorageSetParState() = default; | ||
|
|
||
| template <bool concurrent, bool is_const> | ||
| class OopStorageSetWeakParState { | ||
| typedef OopStorage::ParState<concurrent, is_const> ParStateType; | ||
| typedef ValueObjArray<ParStateType, OopStorageSet::weak_count> ParStateArray; | ||
| private: | ||
| ValueObjArray<ParState, EnumRange<T>().size()> _par_states; | ||
|
|
||
| ParStateArray _par_states; | ||
| NONCOPYABLE(OopStorageSetParState); | ||
| }; |
There was a problem hiding this comment.
We tend to put the member variables at the top of classes. I don't think ParState needs to be public, and this could be changed to:
template<typename T, bool concurrent, bool is_const>
class OopStorageSetParState {
using ParState = OopStorage::ParState<concurrent, is_const>;
ValueObjArray<ParState, EnumRange<T>().size()> _par_states;
public:
ParState* par_state(T id) const {
return _par_states.at(checked_cast<int>(EnumRange<T>().index(id)));
}
protected:
OopStorageSetParState() : _par_states(OopStorageSet::Range<T>().begin()) {}
~OopStorageSetParState() = default;
private:
NONCOPYABLE(OopStorageSetParState);
};
| : public OopStorageSetParState<OopStorageSet::StrongId, concurrent, is_const> | ||
| { |
There was a problem hiding this comment.
We usually keep the { on the same line.
| template<bool concurrent, bool is_const> | ||
| class OopStorageSetWeakParState | ||
| : public OopStorageSetParState<OopStorageSet::WeakId, concurrent, is_const> | ||
| { |
| template<bool concurrent, bool is_const> | ||
| template<typename Closure> |
There was a problem hiding this comment.
Other places in the file uses template < so the usage of template< makes the code inconsistent.
| class WeakProcessorTimes { | ||
| public: | ||
| using StorageId = OopStorageSet::WeakId; |
| template <uint count> | ||
| static void check_iterator(OopStorageSet::Iterator it, |
There was a problem hiding this comment.
All the functions you changed are named _iterator and tested OopStorageSet::Iterator. Now the name is the same, but instead they test the Range facility. I think these functions should be renamed. Alternatively, we keep the tests for the OopStorageSet::Iterator and create a new set for the Range?
|
@kimbarrett this pull request can not be integrated into git checkout wpp4
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@kimbarrett This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
|
Mailing list message from Kim Barrett on shenandoah-dev:
Thanks.
T -> StorageId -- done.
Having a public function whose type signature involves identifiers that Personally, I intensely dislike the typical HotSpot ordering, but go along Options are (1) drop the type alias and write out the type, (2) have
We also usually put the base class on the same line as the class, but that
Yeah, sorry, I try to be consistent with nearby code but failed here; fixed. FWIW, HotSpot uses both, and there doesn't seem to be a consensus in the
Here too I think public functions whose type signatures involve identifiers
What's being tested is iteration, so "iterator" => "iteration? throughout seems better.
Thanks for reviewing. |
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. | |||
| * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. | |||
There was a problem hiding this comment.
It's 2021 by now, I suggest to update these before pushing.
|
Mailing list message from Kim Barrett on hotspot-jfr-dev:
After thinking about this some more, I?m going to see what it looks like to just |
|
Mailing list message from Kim Barrett on hotspot-jfr-dev:
Done. The type alias didn?t really add much, just shortening some a few uses and I also updated the copyrights for 2021. |
rkennke
left a comment
There was a problem hiding this comment.
Changes look good to me! I also ran some tests with Shenandoah and they look good too! Thanks!
|
@kimbarrett Pushed as commit 7ed8ba1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this change which eliminates the WeakProcessorPhase class.
The OopStorageSet class is changed to provide scoped enums for the different
categories: StrongId, WeakId, and Id (for the union of strong and weak).
An accessor is provided for obtaining the storage corresponding to a
category value.
Various other enumerator ranges, array sizes and indices, and iterations are
derived directly from the corresponding OopStorageSet category's enum range.
Iteration over a category of enumerators can be done via EnumIterator. The
iteration over storage objects makes use of that enum iteration, rather than
having a bespoke implementation. Some use-cases need iteration of the
enumerators, with storage lookup from the enumerator; other use-cases just
need the storage objects.
Testing:
mach5 tier1-6
Local (linux-x64) hotspot:tier1 with -XX:+UseShenandoahGC
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1862/head:pull/1862$ git checkout pull/1862