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

8336275: Move common Method and Constructor fields to Executable #20188

Closed
wants to merge 5 commits into from

Conversation

liach
Copy link
Member

@liach liach commented Jul 16, 2024

Move fields common to Method and Field to executable, which simplifies implementation. Removed useless transient modifiers as Method and Field were never serializable.

Note to core-libs reviewers: Please review the associated CSR on trivial removal of abstract modifier as well.


Progress

  • Change requires CSR request JDK-8336657 to be approved
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 2 Reviewers)

Issues

  • JDK-8336275: Move common Method and Constructor fields to Executable (Enhancement - P4)
  • JDK-8336657: Remove abstract modifier on some Executable methods (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20188/head:pull/20188
$ git checkout pull/20188

Update a local copy of the PR:
$ git checkout pull/20188
$ git pull https://git.openjdk.org/jdk.git pull/20188/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20188

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20188.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 16, 2024

👋 Welcome back liach! 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
Copy link

openjdk bot commented Jul 16, 2024

@liach This change is no longer ready for integration - check the PR body for details.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 16, 2024
@openjdk
Copy link

openjdk bot commented Jul 16, 2024

@liach The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

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.

@mlbridge
Copy link

mlbridge bot commented Jul 16, 2024

Webrevs

@dholmes-ora
Copy link
Member

Move fields common to Method and Field to executable

s/Field/Constructor

I was a bit confused about executable fields for a moment. :)

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.

Hotspot changes look good. Core-libs do too but I will leave that for libs folk to approve

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 16, 2024
@dholmes-ora
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jul 16, 2024

@dholmes-ora
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jul 16, 2024
@liach
Copy link
Member Author

liach commented Jul 17, 2024

/reviewers 2 reviewer

@openjdk
Copy link

openjdk bot commented Jul 17, 2024

@liach
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 2 Reviewers).

@liach
Copy link
Member Author

liach commented Jul 17, 2024

Just noted that I removed some abstract flags from Executable methods, which requires a CSR archive entry.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 17, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 14, 2024

@liach This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Copy link
Member

@jddarcy jddarcy left a comment

Choose a reason for hiding this comment

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

Catching up on reviews, core libs changes look fine. Since Executable is sealed with Constructor and Executable on its permits lists, moving methods up and down the hierarchy (as long as there are concrete methods on Constructor and Method) is fine.

@liach
Copy link
Member Author

liach commented Aug 20, 2024

Can anyone review the associated csr?

Handle java_lang_reflect_Constructor::create(TRAPS) {
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
Klass* k = vmClasses::reflect_Constructor_klass();
InstanceKlass* ik = InstanceKlass::cast(k);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need a cast because vmClasses returns InstanceKlass.

#define METHOD_FIELDS_DO(macro) \
macro(_name_offset, k, vmSymbols::name_name(), string_signature, false); \
macro(_returnType_offset, k, vmSymbols::returnType_name(), class_signature, false); \
macro(_annotation_default_offset, k, vmSymbols::annotation_default_name(), byte_array_signature, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you re-align these since you modified them?


void java_lang_reflect_Constructor::set_parameter_types(oop constructor, oop value) {
constructor->obj_field_put(_parameterTypes_offset, value);
Klass* klass = vmClasses::reflect_Method_klass();
Copy link
Contributor

Choose a reason for hiding this comment

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

This also does not need a cast, vmClasses::reflect_Method_klass() returns an InstanceKlass.

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.

The hotspot code looks okay, but I have a couple of small cleanup requests in the changes.

@liach
Copy link
Member Author

liach commented Sep 6, 2024

The new model here may no longer be valid now that deconstructors and patterns are being added. May revisit only if we are sure of the new model of deconstructors.

@liach liach closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] csr Pull request needs approved CSR before integration hotspot [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants