RFR: 8329628: Additional changes after JDK-8329332
Stefan Karlsson
stefank at openjdk.org
Mon Apr 8 07:50:00 UTC 2024
On Fri, 5 Apr 2024 23:39:49 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> Additional clean up based on comments (mostly Stefan's) during reviews for [JDK-8329332: Remove CompiledMethod and CodeBlobLayout classes](https://bugs.openjdk.org/browse/JDK-8329332).
> - Renamed `CompiledMethod_lock` to `NMethod_lock`. (I decided to not change JVMTI's `CompiledMethod[Load|Unload]` names).
> - Renamed `NMethodIterator::all_blobs` to `NMethodIterator::all`.
> - Moved `get_deopt_original_pc()` method from `nmethod` to `frame` class.
> - Reverted `CodeCache::find_nmethod()` to previous functionality to allow return `nullptr` and be consistent with `find_blob()`.
> - Cleanup some `(nmethod*)` casts.
> - Use `for (CodeHeap* heap : *_nmethod_heaps) ` in `CodeCache::nmethod_count()` (it was @stefank suggestion, I don't know how this C++ magic works). I verified it running with `-XX:+PrintNMethodStatistics`.
>
> Testing tier1-3,xcomp,stress
Looks good. I've added two suggestions. You can choose to make them, handle them as separate issues, or just ignore them. :)
src/hotspot/share/code/codeCache.cpp line 668:
> 666: CodeBlob* cb = find_blob(start);
> 667: assert(cb == nullptr || cb->is_nmethod(), "did not find an nmethod");
> 668: return (nmethod*)cb;
There's a call to `find_nmethod` in `ZNMethod::load_oop` that now lacks a null-check. Would you mind adding one?
src/hotspot/share/code/codeCache.hpp line 340:
> 338: template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : public StackObj {
> 339: public:
> 340: enum LivenessFilter { all, only_not_unloading };
Thanks, I like this. FWIW, the `only` in `only_not_unloading` seems redundant. The code reads well without it, IMHO:
// All nmethods
NMethodIterator iter(NMethodIterator::all);
// Those that are not unloading
NMethodIterator iter(NMethodIterator::not_unloading);
-------------
Marked as reviewed by stefank (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18665#pullrequestreview-1985672842
PR Review Comment: https://git.openjdk.org/jdk/pull/18665#discussion_r1555370258
PR Review Comment: https://git.openjdk.org/jdk/pull/18665#discussion_r1555364744
More information about the hotspot-dev
mailing list