mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
6863023: need non-perm oops in code cache for JSR 292
Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
This commit is contained in:
parent
1cf5b7ae11
commit
e261aecad8
74 changed files with 979 additions and 279 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
// The following classes are C++ `closures` for iterating over objects, roots and spaces
|
||||
|
||||
class CodeBlob;
|
||||
class ReferenceProcessor;
|
||||
|
||||
// Closure provides abortability.
|
||||
|
@ -57,9 +58,6 @@ class OopClosure : public Closure {
|
|||
virtual const bool should_remember_klasses() const { return false; }
|
||||
virtual void remember_klass(Klass* k) { /* do nothing */ }
|
||||
|
||||
// If "true", invoke on nmethods (when scanning compiled frames).
|
||||
virtual const bool do_nmethods() const { return false; }
|
||||
|
||||
// The methods below control how object iterations invoking this closure
|
||||
// should be performed:
|
||||
|
||||
|
@ -158,6 +156,51 @@ class CompactibleSpaceClosure : public StackObj {
|
|||
};
|
||||
|
||||
|
||||
// CodeBlobClosure is used for iterating through code blobs
|
||||
// in the code cache or on thread stacks
|
||||
|
||||
class CodeBlobClosure : public Closure {
|
||||
public:
|
||||
// Called for each code blob.
|
||||
virtual void do_code_blob(CodeBlob* cb) = 0;
|
||||
};
|
||||
|
||||
|
||||
class MarkingCodeBlobClosure : public CodeBlobClosure {
|
||||
public:
|
||||
// Called for each code blob, but at most once per unique blob.
|
||||
virtual void do_newly_marked_nmethod(CodeBlob* cb) = 0;
|
||||
|
||||
virtual void do_code_blob(CodeBlob* cb);
|
||||
// = { if (!nmethod(cb)->test_set_oops_do_mark()) do_newly_marked_nmethod(cb); }
|
||||
|
||||
class MarkScope : public StackObj {
|
||||
protected:
|
||||
bool _active;
|
||||
public:
|
||||
MarkScope(bool activate = true);
|
||||
// = { if (active) nmethod::oops_do_marking_prologue(); }
|
||||
~MarkScope();
|
||||
// = { if (active) nmethod::oops_do_marking_epilogue(); }
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Applies an oop closure to all ref fields in code blobs
|
||||
// iterated over in an object iteration.
|
||||
class CodeBlobToOopClosure: public MarkingCodeBlobClosure {
|
||||
OopClosure* _cl;
|
||||
bool _do_marking;
|
||||
public:
|
||||
virtual void do_newly_marked_nmethod(CodeBlob* cb);
|
||||
// = { cb->oops_do(_cl); }
|
||||
virtual void do_code_blob(CodeBlob* cb);
|
||||
// = { if (_do_marking) super::do_code_blob(cb); else cb->oops_do(_cl); }
|
||||
CodeBlobToOopClosure(OopClosure* cl, bool do_marking)
|
||||
: _cl(cl), _do_marking(do_marking) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// MonitorClosure is used for iterating over monitors in the monitors cache
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue