-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8271420: Extend CDS custom loader support to Windows platform #6202
Conversation
👋 Welcome back minqi! A progress list of the required criteria for merging this PR into |
/label remove core-libs |
@yminqi |
@yminqi |
@yminqi |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Yumin, the changes for custom class loaders look good. However, I think you should revert the INCLUDE_CDS_JAVA_HEAP changes since that's unrelated to custom class loaders.
src/hotspot/share/cds/heapShared.cpp
Outdated
@@ -280,10 +280,10 @@ oop HeapShared::archive_object(oop obj) { | |||
return ao; | |||
} | |||
|
|||
int len = obj->size(); | |||
int len = (int)obj->size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is used by INCLUDE_CDS_JAVA_HEAP
and is unrelated to custom class loaders.
@@ -446,7 +446,7 @@ void ClassListParser::error(const char* msg, ...) { | |||
// This function is used for loading classes for customized class loaders | |||
// during archive dumping. | |||
InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS) { | |||
#if !(defined(_LP64) && (defined(LINUX) || defined(__APPLE__))) | |||
#if !(defined(_LP64) && (defined(LINUX) || defined(__APPLE__) || defined(_WINDOWS))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments in the two lines below need to be updated.
@@ -595,7 +595,7 @@ | |||
#define COMPILER_HEADER(basename) XSTR(COMPILER_HEADER_STEM(basename).hpp) | |||
#define COMPILER_HEADER_INLINE(basename) XSTR(COMPILER_HEADER_STEM(basename).inline.hpp) | |||
|
|||
#if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64) && !defined(_WINDOWS) | |||
#if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is unrelated to custom class loaders.
@@ -766,7 +766,7 @@ void StringTable::write_to_archive(const DumpedInternedStrings* dumped_interned_ | |||
assert(HeapShared::can_write(), "must be"); | |||
|
|||
_shared_table.reset(); | |||
CompactHashtableWriter writer(_items_count, ArchiveBuilder::string_stats()); | |||
CompactHashtableWriter writer((int)_items_count, ArchiveBuilder::string_stats()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is used by INCLUDE_CDS_JAVA_HEAP
and is unrelated to custom class loaders.
src/hotspot/share/cds/heapShared.cpp
Outdated
@@ -280,10 +280,10 @@ oop HeapShared::archive_object(oop obj) { | |||
return ao; | |||
} | |||
|
|||
int len = obj->size(); | |||
int len = (int)obj->size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obj->size()
already returns an int
so I don't think the typecast is needed.
I agree with Ioi that this file shouldn't be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oop.hpp:105
// Returns the actual oop size of the object
inline size_t size();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert the change since it is not related to custom loader.
@@ -40,7 +40,7 @@ | |||
// args[2...] = arguments for the main class | |||
public static void main(String args[]) throws Throwable { | |||
File f = new File(args[0]); | |||
URL[] classLoaderUrls = new URL[] {new URL("file://" + f.getCanonicalPath())}; | |||
URL[] classLoaderUrls = new URL[] {f.toURI().toURL()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the above can handle relative path.
It is better to set f as follows:
File f = Path.of(args[0]).toRealPath().toFile();
Before the above, there should be a check if the length of args is 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have couple of comments.
@yminqi 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 50 new commits pushed to the
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. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@iklam @calvinccheung Thanks for review! |
/integrate |
Going to push as commit 603bba2.
Your commit was automatically rebased without conflicts. |
Currently CDS does not support custom loaders on Windows, this patch extends the support to Windows 64 bit platform.
Tests: mach5 tier1-4
Thanks
Yumin
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6202/head:pull/6202
$ git checkout pull/6202
Update a local copy of the PR:
$ git checkout pull/6202
$ git pull https://git.openjdk.java.net/jdk pull/6202/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6202
View PR using the GUI difftool:
$ git pr show -t 6202
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6202.diff