11/*
2- * Copyright (c) 2019, 2020 , Red Hat, Inc. All rights reserved.
2+ * Copyright (c) 2019, 2022 , Red Hat, Inc. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2424#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
2525#define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
2626
27+ #include " code/nmethod.hpp"
2728#include " memory/iterator.hpp"
2829#include " oops/accessDecorators.hpp"
2930#include " runtime/handshake.hpp"
@@ -71,7 +72,12 @@ class ShenandoahKeepAliveClosure : public OopClosure {
7172 void do_oop_work (T* p);
7273};
7374
74- class ShenandoahUpdateRefsClosure : public OopClosure {
75+ class ShenandoahOopClosureBase : public MetadataVisitingOopIterateClosure {
76+ public:
77+ inline void do_nmethod (nmethod* nm);
78+ };
79+
80+ class ShenandoahUpdateRefsClosure : public ShenandoahOopClosureBase {
7581private:
7682 ShenandoahHeap* _heap;
7783public:
@@ -84,7 +90,7 @@ class ShenandoahUpdateRefsClosure: public OopClosure {
8490};
8591
8692template <DecoratorSet MO = MO_UNORDERED>
87- class ShenandoahEvacuateUpdateMetadataClosure : public BasicOopIterateClosure {
93+ class ShenandoahEvacuateUpdateMetadataClosure : public ShenandoahOopClosureBase {
8894private:
8995 ShenandoahHeap* const _heap;
9096 Thread* const _thread;
@@ -99,7 +105,7 @@ class ShenandoahEvacuateUpdateMetadataClosure: public BasicOopIterateClosure {
99105};
100106
101107// Context free version, cannot cache calling thread
102- class ShenandoahEvacuateUpdateRootsClosure : public BasicOopIterateClosure {
108+ class ShenandoahEvacuateUpdateRootsClosure : public ShenandoahOopClosureBase {
103109private:
104110 ShenandoahHeap* const _heap;
105111public:
0 commit comments