< prev index next > src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp
Print this page
// Use ShenandoahReentrantLock as ShenandoahNMethodLock
typedef ShenandoahReentrantLock<ShenandoahSimpleLock> ShenandoahNMethodLock;
typedef ShenandoahLocker<ShenandoahNMethodLock> ShenandoahNMethodLocker;
+ struct ShenandoahNMethodBarrier {
+ address _barrier_pc;
+ address _stub_addr;
+ };
+
// ShenandoahNMethod tuple records the internal locations of oop slots within reclocation stream in
// the nmethod. This allows us to quickly scan the oops without doing the nmethod-internal scans,
// that sometimes involves parsing the machine code. Note it does not record the oops themselves,
// because it would then require handling these tuples as the new class of roots.
class ShenandoahNMethod : public CHeapObj<mtGC> {
private:
nmethod* const _nm;
oop** _oops;
int _oops_count;
+ ShenandoahNMethodBarrier* _barriers;
+ int _barriers_count;
bool _has_non_immed_oops;
bool _unregistered;
ShenandoahNMethodLock _lock;
ShenandoahNMethodLock _ic_lock;
public:
- ShenandoahNMethod(nmethod *nm, GrowableArray<oop*>& oops, bool has_non_immed_oops);
+ ShenandoahNMethod(nmethod *nm, GrowableArray<oop*>& oops, bool has_non_immed_oops, GrowableArray<ShenandoahNMethodBarrier>& barriers);
~ShenandoahNMethod();
inline nmethod* nm() const;
inline ShenandoahNMethodLock* lock();
inline ShenandoahNMethodLock* ic_lock();
inline void oops_do(OopClosure* oops, bool fix_relocations = false);
// Update oops when the nmethod is re-registered
void update();
+ void update_barriers();
+
inline bool is_unregistered() const;
static ShenandoahNMethod* for_nmethod(nmethod* nm);
static inline ShenandoahNMethodLock* lock_for_nmethod(nmethod* nm);
static inline ShenandoahNMethodLock* ic_lock_for_nmethod(nmethod* nm);
void assert_correct() NOT_DEBUG_RETURN;
void assert_same_oops() NOT_DEBUG_RETURN;
private:
- static void detect_reloc_oops(nmethod* nm, GrowableArray<oop*>& oops, bool& _has_non_immed_oops);
+ static void parse(nmethod* nm, GrowableArray<oop*>& oops, bool& _has_non_immed_oops, GrowableArray<ShenandoahNMethodBarrier>& barriers);
};
class ShenandoahNMethodTable;
// ShenandoahNMethodList holds registered nmethod data. The list is reference counted.
< prev index next >