Path: blob/master/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp
40930 views
/*1* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2016 SAP SE. All rights reserved.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_S390_JAVAFRAMEANCHOR_S390_HPP26#define CPU_S390_JAVAFRAMEANCHOR_S390_HPP2728public:2930// Each arch must define reset, save, restore.31// These are used by objects that only care about:32// 1 - initializing a new state (thread creation, javaCalls)33// 2 - saving a current state (javaCalls)34// 3 - restoring an old state (javaCalls).3536inline void clear(void) {37// Clearing _last_Java_sp must be first.38OrderAccess::release();39_last_Java_sp = NULL;40// Fence?41OrderAccess::fence();4243_last_Java_pc = NULL;44}4546inline void set(intptr_t* sp, address pc) {47_last_Java_pc = pc;4849OrderAccess::release();50_last_Java_sp = sp;51}5253void copy(JavaFrameAnchor* src) {54// In order to make sure the transition state is valid for "this"55// we must clear _last_Java_sp before copying the rest of the new data.56// Hack Alert: Temporary bugfix for 4717480/472164757// To act like previous version (pd_cache_state) don't NULL _last_Java_sp58// unless the value is changing.59//60if (_last_Java_sp != src->_last_Java_sp) {61OrderAccess::release();62_last_Java_sp = NULL;63OrderAccess::fence();64}65_last_Java_pc = src->_last_Java_pc;66// Must be last so profiler will always see valid frame if has_last_frame() is true.6768OrderAccess::release();69_last_Java_sp = src->_last_Java_sp;70}7172// We don't have to flush registers, so the stack is always walkable.73inline bool walkable(void) { return true; }74inline void make_walkable(JavaThread* thread) { }7576public:7778// We don't have a frame pointer.79intptr_t* last_Java_fp(void) { return NULL; }8081intptr_t* last_Java_sp() const { return _last_Java_sp; }82void set_last_Java_sp(intptr_t* sp) { OrderAccess::release(); _last_Java_sp = sp; }8384address last_Java_pc(void) { return _last_Java_pc; }8586#endif // CPU_S390_JAVAFRAMEANCHOR_S390_HPP878889