8200106: Move NoSafepointVerifier out from gcLocker.hpp

Reviewed-by: coleenp
This commit is contained in:
Stefan Karlsson 2018-03-23 18:54:12 +01:00
parent 7595845e9a
commit 1a1aecd166
69 changed files with 412 additions and 332 deletions

View file

@ -576,6 +576,31 @@ void VMThread::loop() {
}
}
// A SkipGCALot object is used to elide the usual effect of gc-a-lot
// over a section of execution by a thread. Currently, it's used only to
// prevent re-entrant calls to GC.
class SkipGCALot : public StackObj {
private:
bool _saved;
Thread* _t;
public:
#ifdef ASSERT
SkipGCALot(Thread* t) : _t(t) {
_saved = _t->skip_gcalot();
_t->set_skip_gcalot(true);
}
~SkipGCALot() {
assert(_t->skip_gcalot(), "Save-restore protocol invariant");
_t->set_skip_gcalot(_saved);
}
#else
SkipGCALot(Thread* t) { }
~SkipGCALot() { }
#endif
};
void VMThread::execute(VM_Operation* op) {
Thread* t = Thread::current();