From 88f250fbe4a7e6d47955f1a894bf225181cc68bc Mon Sep 17 00:00:00 2001 From: Guoxiong Li Date: Fri, 3 May 2024 07:24:34 +0800 Subject: [PATCH] JDK-8331608 --- src/hotspot/share/oops/stackChunkOop.cpp | 32 +++++------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/hotspot/share/oops/stackChunkOop.cpp b/src/hotspot/share/oops/stackChunkOop.cpp index 8d230b334c88f..85f4c1b6243b0 100644 --- a/src/hotspot/share/oops/stackChunkOop.cpp +++ b/src/hotspot/share/oops/stackChunkOop.cpp @@ -202,13 +202,12 @@ class DerivedPointersSupport { }; }; -template -class EncodeGCModeConcurrentFrameClosure { +class TransformStackChunkClosure { stackChunkOop _chunk; - DerivedPointerClosureType* _cl; + DerivedPointersSupport::RelativizeClosure* _cl; public: - EncodeGCModeConcurrentFrameClosure(stackChunkOop chunk, DerivedPointerClosureType* cl) + TransformStackChunkClosure(stackChunkOop chunk, DerivedPointersSupport::RelativizeClosure* cl) : _chunk(chunk), _cl(cl) { } @@ -296,32 +295,12 @@ void stackChunkOopDesc::relativize_derived_pointers_concurrently() { } DerivedPointersSupport::RelativizeClosure derived_cl; - EncodeGCModeConcurrentFrameClosure frame_cl(this, &derived_cl); + TransformStackChunkClosure frame_cl(this, &derived_cl); iterate_stack(&frame_cl); release_relativization(); } -class TransformStackChunkClosure { - stackChunkOop _chunk; - -public: - TransformStackChunkClosure(stackChunkOop chunk) : _chunk(chunk) { } - - template - bool do_frame(const StackChunkFrameStream& f, const RegisterMapT* map) { - DerivedPointersSupport::RelativizeClosure derived_cl; - f.iterate_derived_pointers(&derived_cl, map); - - BarrierSetStackChunk* bs_chunk = BarrierSet::barrier_set()->barrier_set_stack_chunk(); - frame fr = f.to_frame(); - FrameOopIterator iterator(fr, map); - bs_chunk->encode_gc_mode(_chunk, &iterator); - - return true; - } -}; - void stackChunkOopDesc::transform() { assert(!is_gc_mode(), "Should only be called once per chunk"); set_gc_mode(true); @@ -330,7 +309,8 @@ void stackChunkOopDesc::transform() { set_has_bitmap(true); bitmap().clear(); - TransformStackChunkClosure closure(this); + DerivedPointersSupport::RelativizeClosure derived_cl; + TransformStackChunkClosure closure(this, &derived_cl); iterate_stack(&closure); }