Path: blob/master/src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp
41145 views
/*1* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef CPU_X86_JAVAFRAMEANCHOR_X86_HPP25#define CPU_X86_JAVAFRAMEANCHOR_X86_HPP2627private:2829// FP value associated with _last_Java_sp:30intptr_t* volatile _last_Java_fp; // pointer is volatile not what it points to3132public:33// Each arch must define reset, save, restore34// These are used by objects that only care about:35// 1 - initializing a new state (thread creation, javaCalls)36// 2 - saving a current state (javaCalls)37// 3 - restoring an old state (javaCalls)3839void clear(void) {40// clearing _last_Java_sp must be first41_last_Java_sp = NULL;42// fence?43_last_Java_fp = NULL;44_last_Java_pc = NULL;45}4647void copy(JavaFrameAnchor* src) {48// In order to make sure the transition state is valid for "this"49// We must clear _last_Java_sp before copying the rest of the new data50//51// Hack Alert: Temporary bugfix for 4717480/472164752// To act like previous version (pd_cache_state) don't NULL _last_Java_sp53// unless the value is changing54//55if (_last_Java_sp != src->_last_Java_sp)56_last_Java_sp = NULL;5758_last_Java_fp = src->_last_Java_fp;59_last_Java_pc = src->_last_Java_pc;60// Must be last so profiler will always see valid frame if has_last_frame() is true61_last_Java_sp = src->_last_Java_sp;62}6364bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; }65void make_walkable(JavaThread* thread);66void capture_last_Java_pc(void);6768intptr_t* last_Java_sp(void) const { return _last_Java_sp; }6970address last_Java_pc(void) { return _last_Java_pc; }7172static ByteSize last_Java_fp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_fp); }7374public:7576void set_last_Java_sp(intptr_t* sp) { _last_Java_sp = sp; }7778intptr_t* last_Java_fp(void) { return _last_Java_fp; }7980#endif // CPU_X86_JAVAFRAMEANCHOR_X86_HPP818283