/* * Copyright (c) 2018, 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. *
*/
assert(thread->is_in_full_stack((address)entry), ""); returntrue; // return false if called when transitioning to Java on return from freeze // return !thread->has_last_Java_frame() || thread->last_Java_sp() < cont->entry_sp();
}
// When walking the virtual stack, this method returns true // iff the frame is a thawed continuation frame whose // caller is still frozen on the h-stack. // The continuation object can be extracted from the thread. bool Continuation::is_cont_barrier_frame(const frame& f) {
assert(f.is_interpreted_frame() || f.cb() != nullptr, ""); if (!Continuations::enabled()) returnfalse; return is_return_barrier_entry(f.is_interpreted_frame() ? ContinuationHelper::InterpretedFrame::return_pc(f)
: ContinuationHelper::CompiledFrame::return_pc(f));
}
bool Continuation::is_return_barrier_entry(const address pc) { if (!Continuations::enabled()) returnfalse; return pc == StubRoutines::cont_returnBarrier();
}
bool Continuation::is_continuation_entry_frame(const frame& f, const RegisterMap *map) { // we can do this because the entry frame is never inlined
Method* m = (map != nullptr && map->in_cont() && f.is_interpreted_frame())
? map->stack_chunk()->interpreter_frame_method(f)
: ContinuationHelper::Frame::frame_method(f); return m != nullptr && m->intrinsic_id() == vmIntrinsics::_Continuation_enter;
}
// The parameter `sp` should be the actual sp and not the unextended sp because at // least on PPC64 unextended_sp < sp is possible as interpreted frames are trimmed // to the actual size of the expression stack before calls. The problem there is // that even unextended_sp < entry_sp < sp is possible for an interpreted frame. staticinlinebool is_sp_in_continuation(const ContinuationEntry* entry, intptr_t* const sp) { // entry_sp() returns the unextended_sp which is always greater or equal to the actual sp return entry->entry_sp() > sp;
}
log_develop_trace(continuations)("continuation_parent_frame"); if (map->update_map()) { // we need to register the link address for the entry frame if (cont.entry() != nullptr) {
cont.entry()->update_register_map(map);
} else {
map->clear();
}
}
if (!cont.is_mounted()) { // When we're walking an unmounted continuation and reached the end
oop parent = jdk_internal_vm_Continuation::parent(cont.continuation());
stackChunkOop chunk = parent != nullptr ? ContinuationWrapper(parent).last_nonempty_chunk() : nullptr; if (chunk != nullptr) { return chunk->top_frame(map);
}
// While virtual threads are in Preview, there are some VM mechanisms we disable if continuations aren't used bool Continuations::enabled() { return VMContinuations && Arguments::enable_preview();
}
#define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
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 ist noch experimentell.