attempt to share loader for JIT-ed classes #5880
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
introduces a
-Xjit.loader.mode
which is either UNIQUE (default), SHARED or SHARED_SOURCEmost of it is making
WeakValueMap
implementMap
as I originally did something else here ...so I've kept that code and just did a fake
Map
for the single (shared) global class-loader.that can be changed as needed to a cleaner (proper oop) way.
the SHARED_SOURCE was so far only tested with jruby's test suite, the JITed class-loader count went down to 10% ... and meta-space was much less fragmented - saving around 8% of allocated space.
was not sure whether we should attempt to somehow detect
eval
-ed piecesand not share them with the same source file but rather always on their own?
given that SHARED_SOURCE isn't changed to be the new default, we can also decide later.
also if you have suggestions for better naming the option or the enum values.