/* * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
if (_cl->verify_fixed()) {
assert(stack_watermark->processing_started(), "Should already have been fixed");
assert(stack_watermark->processing_completed(), "Should already have been fixed");
} else { // We don't really know the state of the stack, verify watermark. if (!stack_watermark->processing_started()) {
_verifying_bad_frames = true;
} else { // Not time yet to verify bad frames
_last_good = stack_watermark->last_processed();
}
}
}
void prepare_next_frame(frame& frame) { if (_cl->verify_fixed()) { // All frames need to be good return;
}
// The verification has two modes, depending on whether we have reached the // last processed frame or not. Before it is reached, we expect everything to // be good. After reaching it, we expect everything to be bad. const uintptr_t sp = reinterpret_cast<uintptr_t>(frame.sp());
if (!_verifying_bad_frames && sp == _last_good) { // Found the last good frame, now verify the bad ones
_verifying_bad_frames = true;
}
}
virtualvoid do_oop(oop* p) { if (_verify_weaks) {
z_verify_possibly_weak_oop(p);
} else { // We should never encounter finalizable oops through strong // paths. This assumes we have only visited strong roots.
z_verify_oop(p);
}
}
virtualvoid do_nmethod(nmethod* nm) {
assert(!trust_nmethod_state() || !_bs_nm->is_armed(nm), "Should not encounter any armed nmethods");
ZNMethod::nmethod_oops_do(nm, _cl);
}
};
void ZVerify::roots_strong(bool verify_fixed) {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
assert(!ZResurrection::is_blocked(), "Invalid phase");
void ZVerify::roots_weak() {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
assert(!ZResurrection::is_blocked(), "Invalid phase");
ZVerifyViewsFlip::ZVerifyViewsFlip(const ZPageAllocator* allocator) :
_allocator(allocator) { if (ZVerifyViews) { // Unmap all pages
ZPageDebugMapOrUnmapClosure<false/* Map */> cl(_allocator);
ZHeap::heap()->pages_do(&cl);
}
}
ZVerifyViewsFlip::~ZVerifyViewsFlip() { if (ZVerifyViews) { // Map all pages
ZPageDebugMapOrUnmapClosure<true/* Map */> cl(_allocator);
ZHeap::heap()->pages_do(&cl);
}
}
#ifdef ASSERT
class ZVerifyBadOopClosure : public OopClosure { public: virtualvoid do_oop(oop* p) { const oop o = *p;
assert(!ZAddress::is_good(ZOop::to_address(o)), "Should not be good: " PTR_FORMAT, p2i(o));
}
// This class encapsulates various marks we need to deal with calling the // frame iteration code from arbitrary points in the runtime. It is mostly // due to problems that we might want to eventually clean up inside of the // frame iteration code, such as creating random handles even though there // is no safepoint to protect against, and fiddling around with exceptions. class StackWatermarkProcessingMark {
ResetNoHandleMark _rnhm;
HandleMark _hm;
PreserveExceptionMark _pem;
ResourceMark _rm;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.