Skip to content

8265696: Move CDS sources to src/hotspot/shared/cds #3610

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

Closed
wants to merge 11 commits into from

Conversation

iklam
Copy link
Member

@iklam iklam commented Apr 21, 2021

The number of CDS source files have grown significantly. To improve modularity, the following files should be moved a new directory, src/hotspot/share/cds.

  • src/hotspot/share/classfile/classListParser.cpp
  • src/hotspot/share/classfile/classListParser.hpp
  • src/hotspot/share/classfile/classListWriter.hpp
  • src/hotspot/share/classfile/compactHashtable.cpp
  • src/hotspot/share/classfile/compactHashtable.hpp
  • src/hotspot/share/classfile/lambdaFormInvokers.cpp
  • src/hotspot/share/classfile/lambdaFormInvokers.hpp
  • src/hotspot/share/memory/archiveBuilder.cpp
  • src/hotspot/share/memory/archiveBuilder.hpp
  • src/hotspot/share/memory/archiveUtils.cpp
  • src/hotspot/share/memory/archiveUtils.hpp
  • src/hotspot/share/memory/archiveUtils.inline.hpp
  • src/hotspot/share/memory/cppVtables.cpp
  • src/hotspot/share/memory/cppVtables.hpp
  • src/hotspot/share/memory/dumpAllocStats.cpp
  • src/hotspot/share/memory/dumpAllocStats.hpp
  • src/hotspot/share/memory/dynamicArchive.cpp
  • src/hotspot/share/memory/dynamicArchive.hpp
  • src/hotspot/share/memory/filemap.cpp
  • src/hotspot/share/memory/filemap.hpp
  • src/hotspot/share/memory/heapShared.cpp
  • src/hotspot/share/memory/heapShared.hpp
  • src/hotspot/share/memory/heapShared.inline.hpp
  • src/hotspot/share/memory/metaspaceShared.cpp
  • src/hotspot/share/memory/metaspaceShared.hpp
  • src/hotspot/share/prims/cdsoffsets.cpp
  • src/hotspot/share/prims/cdsoffsets.hpp

Testing with mach5: tier1, builds-tier2, builds-tier3, builds-tier4 and builds-tier5. Also locally: aarch64, arm, ppc64, s390, x86, and zero.


Progress

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

Issue

  • JDK-8265696: Move CDS sources to src/hotspot/shared/cds

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3610

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 21, 2021

👋 Welcome back iklam! 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 Apr 21, 2021

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

  • build
  • hotspot
  • serviceability

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.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org build build-dev@openjdk.org labels Apr 21, 2021
@iklam
Copy link
Member Author

iklam commented Apr 21, 2021

/label remove serviceability

@openjdk openjdk bot removed the serviceability serviceability-dev@openjdk.org label Apr 21, 2021
@openjdk
Copy link

openjdk bot commented Apr 21, 2021

@iklam
The serviceability label was successfully removed.

metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
sharedClassUtil.cpp \
sharedPathsMiscInfo.cpp \
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed obsolete files that no longer exist.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

Copy link
Member

Choose a reason for hiding this comment

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

I don't suppose we can just exclude the new directory rather than listing individual files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. Now all files under share/cds are excluded. I needed to move compactHashtable.cpp back to its old location since a little of it is used even when CDS is not used.

Copy link
Member

Choose a reason for hiding this comment

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

That's indeed a better idea.

@@ -39,7 +39,6 @@
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/filemap.hpp"
#include "oops/oop.inline.hpp"
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed some unnecessary inclusions.

@iklam iklam marked this pull request as ready for review April 21, 2021 22:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 21, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 21, 2021

Webrevs

Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

Build changes look good.

metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
sharedClassUtil.cpp \
sharedPathsMiscInfo.cpp \
Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

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 Ioi,

Moving these files to their own directory is fine, but all the moved headers need further adjustments for the include guards.

Thanks,
David

metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
sharedClassUtil.cpp \
sharedPathsMiscInfo.cpp \
Copy link
Member

Choose a reason for hiding this comment

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

I don't suppose we can just exclude the new directory rather than listing individual files?

@@ -25,7 +25,7 @@
#ifndef SHARE_MEMORY_ARCHIVEUTILS_INLINE_HPP
Copy link
Member

Choose a reason for hiding this comment

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

The header file include guards all need updating for the new path.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

#include "memory/memRegion.hpp"
#include "memory/virtualspace.hpp"
#include "oops/oop.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/macros.hpp"
#include "utilities/resourceHash.hpp"

#if INCLUDE_CDS
Copy link
Member

Choose a reason for hiding this comment

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

I have to wonder who is including this file and why, if CDS is not enabled.

Copy link
Member Author

Choose a reason for hiding this comment

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

E.g., jvm.cpp includes dynamicArchive.hpp, but only uses its declarations inside INCLUDE_CDS blocks. It would be too verbose to do this in jvm.cpp

#if INCLUDE_CDS
#include "cds/dynamicArchive.hpp"
#endif

Copy link
Member

Choose a reason for hiding this comment

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

We routinely do that for other INCLUDE_X features.

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.

Hi @iklam,

this is a very welcome change!

Nothing much to add to what David wrote (include guards need renaming).

Apart from that, I was surprised that no gtests needed to be adapted, but seems cds has no gtests?

I tested building without cds, works fine.

Thanks for doing this!

If you fix the include guards, this is fine by me.

..Thomas

@iklam
Copy link
Member Author

iklam commented Apr 22, 2021

Hi @iklam,

this is a very welcome change!

Nothing much to add to what David wrote (include guards need renaming).

Apart from that, I was surprised that no gtests needed to be adapted, but seems cds has no gtests?

I tested building without cds, works fine.

Thanks for doing this!

If you fix the include guards, this is fine by me.

..Thomas

Hi Thomas, thanks for the review. You're right that we don't have any gtests .... that should be fixed at some point.

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.

Updates look good.

Thanks,
David

metaspaceShared_$(HOTSPOT_TARGET_CPU).cpp \
metaspaceShared_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
sharedClassUtil.cpp \
sharedPathsMiscInfo.cpp \
Copy link
Member

Choose a reason for hiding this comment

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

That's indeed a better idea.

@iklam iklam changed the title 8265696 move cds sources 8265696: Move CDS sources to src/hotspot/shared/cds Apr 22, 2021
@openjdk
Copy link

openjdk bot commented Apr 22, 2021

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

8265696: Move CDS sources to src/hotspot/shared/cds

Reviewed-by: erikj, dholmes, stuefe

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

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

iklam commented Apr 23, 2021

Thanks @tstuefe @erikj79 @dholmes-ora for the review.
The latest merged code passes Mach5 build tiers 1-5.
I also manually tested the minimal VM build to verify the exclusion of CDS object files.
/integrate

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

openjdk bot commented Apr 23, 2021

@iklam Pushed as commit 95f0fd6.

💡 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
build build-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants