Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
32285 views
/*1* Copyright (c) 2002, 2011, 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 SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP25#define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP2627#include "utilities/globalDefinitions.hpp"28#include "runtime/orderAccess.inline.hpp"2930//31// An object for encapsulating the machine/os dependent part of a JavaThread frame state32//33class JavaThread;3435class JavaFrameAnchor VALUE_OBJ_CLASS_SPEC {36// Too many friends...37friend class CallNativeDirectNode;38friend class OptoRuntime;39friend class Runtime1;40friend class StubAssembler;41friend class CallRuntimeDirectNode;42friend class MacroAssembler;43friend class InterpreterGenerator;44friend class LIR_Assembler;45friend class GraphKit;46friend class StubGenerator;47friend class JavaThread;48friend class frame;49friend class VMStructs;50friend class BytecodeInterpreter;51friend class JavaCallWrapper;5253private:54//55// Whenever _last_Java_sp != NULL other anchor fields MUST be valid!56// The stack may not be walkable [check with walkable() ] but the values must be valid.57// The profiler apparently depends on this.58//59intptr_t* volatile _last_Java_sp;6061// Whenever we call from Java to native we can not be assured that the return62// address that composes the last_Java_frame will be in an accessible location63// so calls from Java to native store that pc (or one good enough to locate64// the oopmap) in the frame anchor. Since the frames that call from Java to65// native are never deoptimized we never need to patch the pc and so this66// is acceptable.67volatile address _last_Java_pc;6869// tells whether the last Java frame is set70// It is important that when last_Java_sp != NULL that the rest of the frame71// anchor (including platform specific) all be valid.7273bool has_last_Java_frame() const { return _last_Java_sp != NULL; }74// This is very dangerous unless sp == NULL75// Invalidate the anchor so that has_last_frame is false76// and no one should look at the other fields.77void zap(void) { _last_Java_sp = NULL; }7879#ifdef TARGET_ARCH_x8680# include "javaFrameAnchor_x86.hpp"81#endif82#ifdef TARGET_ARCH_aarch3283# include "javaFrameAnchor_aarch32.hpp"84#endif85#ifdef TARGET_ARCH_aarch6486# include "javaFrameAnchor_aarch64.hpp"87#endif88#ifdef TARGET_ARCH_sparc89# include "javaFrameAnchor_sparc.hpp"90#endif91#ifdef TARGET_ARCH_zero92# include "javaFrameAnchor_zero.hpp"93#endif94#ifdef TARGET_ARCH_arm95# include "javaFrameAnchor_arm.hpp"96#endif97#ifdef TARGET_ARCH_ppc98# include "javaFrameAnchor_ppc.hpp"99#endif100101102public:103JavaFrameAnchor() { clear(); }104JavaFrameAnchor(JavaFrameAnchor *src) { copy(src); }105106void set_last_Java_pc(address pc) { _last_Java_pc = pc; }107108// Assembly stub generation helpers109110static ByteSize last_Java_sp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_sp); }111static ByteSize last_Java_pc_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_pc); }112113};114115#endif // SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP116117118