mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
Merge
This commit is contained in:
commit
8cea3ed3b4
99 changed files with 1933 additions and 1549 deletions
|
@ -24,6 +24,8 @@
|
|||
|
||||
// The following classes are C++ `closures` for iterating over objects, roots and spaces
|
||||
|
||||
class CodeBlob;
|
||||
class nmethod;
|
||||
class ReferenceProcessor;
|
||||
class DataLayout;
|
||||
|
||||
|
@ -69,9 +71,6 @@ class OopClosure : public Closure {
|
|||
virtual const bool should_remember_mdo() const { return false; }
|
||||
virtual void remember_mdo(DataLayout* v) { /* 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:
|
||||
|
||||
|
@ -176,6 +175,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(nmethod* nm) = 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(nmethod* 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