Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8265867: thread.hpp defines some enums but no reference #3702

Closed
wants to merge 2 commits into from

Conversation

navyxliu
Copy link
Member

@navyxliu navyxliu commented Apr 26, 2021

Deleted 2 useless enums.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8265867: thread.hpp defines some enums but no reference

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3702/head:pull/3702
$ git checkout pull/3702

Update a local copy of the PR:
$ git checkout pull/3702
$ git pull https://git.openjdk.java.net/jdk pull/3702/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3702

View PR using the GUI difftool:
$ git pr show -t 3702

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3702.diff

This patch also added const and constexpr specifiers for the applicable
member functions.
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 26, 2021

👋 Welcome back xliu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 26, 2021
@openjdk
Copy link

openjdk bot commented Apr 26, 2021

@navyxliu The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Apr 26, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 26, 2021

Webrevs

static constexpr ByteSize start_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _start); }
static constexpr ByteSize end_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _end); }
static constexpr ByteSize top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _top); }
static constexpr ByteSize pf_top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _pf_top); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is constexpr really necessary here? Isn't this usually a constant expression for most compilers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have many of these inline functions that could be either const and constexpr. Since constexpr has been allowed only recently, there are very few functions that are actually declared constexpr.

My recommendation is to limit constexpr only to new code. We can change const to constexpr when required (e.g., when an existing function is called by new code that's in a constexpr context). That way, we can limit code churn.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and it's more characters to look at for no real performance benefit. These offset functions are in many classes.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Xin,

Please don't mix together cleanups this way. Getting rid of unused enums is fine, but 99% of the patch relates to const and constexpr. I had trouble finding the enum changes among the rest, and what would otherwise be a short and trivial patch becomes more unweildy and requires a lot more time to review. A separate RFE for those would be better IMO.

Thanks,
David

@navyxliu
Copy link
Member Author

Hi Xin,

Please don't mix together cleanups this way. Getting rid of unused enums is fine, but 99% of the patch relates to const and constexpr. I had trouble finding the enum changes among the rest, and what would otherwise be a short and trivial patch becomes more unweildy and requires a lot more time to review. A separate RFE for those would be better IMO.

Thanks,
David

hi, David,

Thanks. I will create another JBS to track const and constexpr issue.
Sorry, I felt it was too "trivial" if one PR just deletes two enums. I will pay attention to it.

thanks,
--lx

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change (both the constness fixes and the removal of enums), but as David said, please make them two changes and give them clear titles.

Wrt to the constexpr, I am not against this since constexpr is to my understanding mostly a safety measure against bitrot, preventing us from accidentally making a constexpr function non-const. But the majority seems not to like that part, so I'd just leave it out for now.

Cheers, Thomas

@@ -1086,7 +1074,7 @@ class JavaThread: public Thread {

// last_Java_sp
bool has_last_Java_frame() const { return _anchor.has_last_Java_frame(); }
intptr_t* last_Java_sp() const { return _anchor.last_Java_sp(); }
intptr_t* last_Java_sp() const { return _anchor.last_Java_sp(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the whitespace change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to align with above "const". I will format this patch better next time.

@openjdk
Copy link

openjdk bot commented Apr 27, 2021

@navyxliu 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:

8265867: thread.hpp defines some enums but no reference

Reviewed-by: dholmes, stuefe, iklam, coleenp

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 53 new commits pushed to the master branch:

  • 0438cea: 8136517: [macosx]Test java/awt/Focus/8073453/AWTFocusTransitionTest.java fails on MacOSX
  • 6b5e5d7: 8266181: compiler/eliminateAutobox/TestEliminateBoxInDebugInfo should be in driver mode
  • 81b1502: 8266161: mark hotspot compiler/rtm tests which ignore VM flags
  • 4a8324d: 8266180: compiler/vectorapi/TestVectorErgonomics should be run in driver mode
  • 0601aba: 8266175: mark hotspot compiler/jsr292 tests which ignore VM flags
  • 69ad8ac: 8266169: mark hotspot compiler/jvmci tests which ignore VM flags
  • 1a2a570: 8266166: mark hotspot compiler/linkage tests which ignore VM flags
  • 5ee58b0: 8266164: mark hotspot compiler/loopstripmining tests which ignore VM flags
  • 1a37bce: 8263779: SSLEngine reports NEED_WRAP continuously without producing any further output
  • 889d246: 8265917: Different values computed by C2 and interpreter/C1 for Math.pow(x, 2.0) on x86_32
  • ... and 43 more: https://git.openjdk.java.net/jdk/compare/b9f66d93ebf7e36e5658b1e1569bb635b2a75401...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @tstuefe, @iklam, @coleenp) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 27, 2021
@navyxliu
Copy link
Member Author

Thanks reviewers.

I took a look at the building failure on macos. it should not be relevant to this patch.
Linker editor can't resolve the symbol __Copy_conjoint_words on macos/arm64.

2021-04-27T18:48:46.3842240Z Undefined symbols for architecture arm64:
2021-04-27T18:48:46.3873510Z   "__Copy_conjoint_words", referenced from:
2021-04-27T18:48:46.3894950Z       G1FullGCCompactTask::G1CompactRegionClosure::apply(oopDesc*) in g1FullGCCompactTask.o
2021-04-27T18:48:46.3931360Z       PSParallelCompact::decrement_destination_counts(ParCompactionManager*, PSParallelCompact::SpaceId, unsigned long, HeapWordImpl**) in psParallelCompact.o
2021-04-27T18:48:46.3950530Z       PSParallelCompact::copy_back(HeapWordImpl**, HeapWordImpl**) in psParallelCompact.o
2021-04-27T18:48:46.3997600Z       PSParallelCompact::fill_region(ParCompactionManager*, MoveAndUpdateClosure&, unsigned long) in psParallelCompact.o
2021-04-27T18:48:46.4034130Z       MoveAndUpdateClosure::copy_partial_obj() in psParallelCompact.o
2021-04-27T18:48:46.4052290Z       MoveAndUpdateClosure::copy_until_full() in psParallelCompact.o
2021-04-27T18:48:46.4101250Z       MoveAndUpdateClosure::do_addr(HeapWordImpl**, unsigned long) in psParallelCompact.o
2021-04-27T18:48:46.4137880Z       ...
...
2021-04-27T18:48:46.4792490Z ld: symbol(s) not found for architecture arm64
2021-04-27T18:48:46.4834120Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2021-04-27T18:48:46.4919160Z gmake[3]: *** [lib/CompileJvm.gmk:144: /Users/runner/work/jdk/jdk/jdk/build/macos-aarch64/support/modules_libs/java.base/server/libjvm.dylib] Error 1
2021-04-27T18:48:46.4920590Z gmake[3]: *** Waiting for unfinished jobs....
2021-04-27T18:48:46.7713910Z gmake[2]: *** [make/Main.gmk:255: hotspot-server-libs] Error 2

@navyxliu
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 27, 2021
@openjdk
Copy link

openjdk bot commented Apr 27, 2021

@navyxliu
Your change (at version 244b5aa) is now ready to be sponsored by a Committer.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - and now trivial :)

Thanks,
David

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@iklam
Copy link
Member

iklam commented Apr 28, 2021

/sponsor

@openjdk openjdk bot closed this Apr 28, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 28, 2021
@openjdk
Copy link

openjdk bot commented Apr 28, 2021

@iklam @navyxliu Since your change was applied there have been 58 commits pushed to the master branch:

  • 75a2354: 8266028: C2 computes -0.0 for Math.pow(-0.0, 0.5)
  • ca37be1: 8197800: Test java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java fails on Windows
  • cf92693: 8198619: java/awt/Focus/FocusTraversalPolicy/ButtonGroupLayoutTraversal/ButtonGroupLayoutTraversalTest.java fails on mac
  • 2201e11: 8266055: ZGC: ZHeap::print_extended_on() doesn't disable deferred delete
  • ce48f04: 8198617: java/awt/Focus/6382144/EndlessLoopTest.java fails on mac
  • 0438cea: 8136517: [macosx]Test java/awt/Focus/8073453/AWTFocusTransitionTest.java fails on MacOSX
  • 6b5e5d7: 8266181: compiler/eliminateAutobox/TestEliminateBoxInDebugInfo should be in driver mode
  • 81b1502: 8266161: mark hotspot compiler/rtm tests which ignore VM flags
  • 4a8324d: 8266180: compiler/vectorapi/TestVectorErgonomics should be run in driver mode
  • 0601aba: 8266175: mark hotspot compiler/jsr292 tests which ignore VM flags
  • ... and 48 more: https://git.openjdk.java.net/jdk/compare/b9f66d93ebf7e36e5658b1e1569bb635b2a75401...master

Your commit was automatically rebased without conflicts.

Pushed as commit 164454f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
5 participants