Path: blob/master/src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp
40931 views
/*1* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright 2007, 2008, 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 CPU_ZERO_JAVAFRAMEANCHOR_ZERO_HPP26#define CPU_ZERO_JAVAFRAMEANCHOR_ZERO_HPP2728private:29ZeroFrame* volatile _last_Java_fp;3031public:32// Each arch must define reset, save, restore33// These are used by objects that only care about:34// 1 - initializing a new state (thread creation, javaCalls)35// 2 - saving a current state (javaCalls)36// 3 - restoring an old state (javaCalls)37// Note that whenever _last_Java_sp != NULL other anchor fields38// must be valid. The profiler apparently depends on this.3940void clear() {41// clearing _last_Java_sp must be first42_last_Java_sp = NULL;43// fence?44_last_Java_fp = NULL;45_last_Java_pc = NULL;46}4748void copy(JavaFrameAnchor* src) {49set(src->_last_Java_sp, src->_last_Java_pc, src->_last_Java_fp);50}5152void set(intptr_t* sp, address pc, ZeroFrame* fp) {53// In order to make sure the transition state is valid for "this"54// We must clear _last_Java_sp before copying the rest of the new55// data56//57// Hack Alert: Temporary bugfix for 4717480/4721647 To act like58// previous version (pd_cache_state) don't NULL _last_Java_sp59// unless the value is changing60//61if (_last_Java_sp != sp)62_last_Java_sp = NULL;6364_last_Java_fp = fp;65_last_Java_pc = pc;66// Must be last so profiler will always see valid frame if67// has_last_frame() is true68_last_Java_sp = sp;69}7071bool walkable() {72return true;73}7475void make_walkable(JavaThread* thread) {76// nothing to do77}7879intptr_t* last_Java_sp() const {80return _last_Java_sp;81}8283ZeroFrame* last_Java_fp() const {84return _last_Java_fp;85}8687address last_Java_pc() const {88return _last_Java_pc;89}9091static ByteSize last_Java_fp_offset() {92return byte_offset_of(JavaFrameAnchor, _last_Java_fp);93}9495void set_last_Java_sp(intptr_t* sp) { _last_Java_sp = sp; }9697#endif // CPU_ZERO_JAVAFRAMEANCHOR_ZERO_HPP9899100