Skip to content

Commit 097c6a5

Browse files
committed
Fix code cache roots relocation
1 parent e210c55 commit 097c6a5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

openjdk/share/mmtkRootsClosure.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,14 @@ class MMTkScanObjectClosure : public BasicOopIterateClosure {
140140
// }
141141
// };
142142

143+
class CodeBlobFixRelocationClosure: public CodeBlobClosure {
144+
public:
145+
inline virtual void do_code_blob(CodeBlob* cb) {
146+
nmethod* nm = cb->as_nmethod_or_null();
147+
if (nm != NULL) {
148+
nm->fix_oop_relocations();
149+
}
150+
}
151+
};
152+
143153
#endif // MMTK_OPENJDK_MMTK_ROOTS_CLOSURE_HPP

openjdk/share/mmtkUpcalls.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ static void mmtk_resume_mutators(void *tls) {
7676
#if COMPILER2_OR_JVMCI
7777
DerivedPointerTable::update_pointers();
7878
#endif
79+
{
80+
CodeBlobFixRelocationClosure cb_cl;
81+
CodeCache::blobs_do(&cb_cl);
82+
}
7983

8084
// Note: we don't have to hold gc_lock to increment the counter.
8185
// The increment has to be done before mutators can be resumed

0 commit comments

Comments
 (0)