Path: blob/master/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp
40931 views
/*1* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef OS_CPU_LINUX_ZERO_THREAD_LINUX_ZERO_HPP26#define OS_CPU_LINUX_ZERO_THREAD_LINUX_ZERO_HPP2728private:29ZeroStack _zero_stack;30ZeroFrame* _top_zero_frame;3132void pd_initialize() {33_top_zero_frame = NULL;34}3536public:37ZeroStack *zero_stack() {38return &_zero_stack;39}4041public:42ZeroFrame *top_zero_frame() {43return _top_zero_frame;44}45void push_zero_frame(ZeroFrame *frame) {46*(ZeroFrame **) frame = _top_zero_frame;47_top_zero_frame = frame;48}49void pop_zero_frame() {50zero_stack()->set_sp((intptr_t *) _top_zero_frame + 1);51_top_zero_frame = *(ZeroFrame **) _top_zero_frame;52}5354public:55static ByteSize zero_stack_offset() {56return byte_offset_of(JavaThread, _zero_stack);57}58static ByteSize top_zero_frame_offset() {59return byte_offset_of(JavaThread, _top_zero_frame);60}6162public:63void set_last_Java_frame() {64set_last_Java_frame(top_zero_frame(), zero_stack()->sp());65}66void reset_last_Java_frame() {67frame_anchor()->zap();68}69void set_last_Java_frame(ZeroFrame* fp, intptr_t* sp) {70frame_anchor()->set(sp, NULL, fp);71}7273public:74ZeroFrame* last_Java_fp() {75return frame_anchor()->last_Java_fp();76}7778private:79frame pd_last_frame();8081public:82static ByteSize last_Java_fp_offset() {83return byte_offset_of(JavaThread, _anchor) +84JavaFrameAnchor::last_Java_fp_offset();85}8687public:88// Check for pending suspend requests and pending asynchronous89// exceptions. There are separate accessors for these, but90// _suspend_flags is volatile so using them would be unsafe.91bool has_special_condition_for_native_trans() {92return _suspend_flags != 0;93}9495public:96bool pd_get_top_frame_for_signal_handler(frame* fr_addr,97void* ucontext,98bool isInJava) {99ShouldNotCallThis();100return false; // silence compile warning101}102103bool pd_get_top_frame_for_profiling(frame* fr_addr,104void* ucontext,105bool isInJava) {106ShouldNotCallThis();107return false; // silence compile warning108}109110#endif // OS_CPU_LINUX_ZERO_THREAD_LINUX_ZERO_HPP111112113