Path: blob/master/src/hotspot/cpu/arm/frame_arm.hpp
40930 views
/*1* Copyright (c) 2008, 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_ARM_FRAME_ARM_HPP25#define CPU_ARM_FRAME_ARM_HPP2627#include "runtime/synchronizer.hpp"2829public:30enum {31pc_return_offset = 0,32// All frames33link_offset = 0,34return_addr_offset = 1,35// non-interpreter frames36sender_sp_offset = 2,3738// Interpreter frames39interpreter_frame_oop_temp_offset = 2, // for native calls only4041interpreter_frame_sender_sp_offset = -1,42// outgoing sp before a call to an invoked method43interpreter_frame_last_sp_offset = interpreter_frame_sender_sp_offset - 1,44interpreter_frame_method_offset = interpreter_frame_last_sp_offset - 1,45interpreter_frame_mirror_offset = interpreter_frame_method_offset - 1,46interpreter_frame_mdp_offset = interpreter_frame_mirror_offset - 1,47interpreter_frame_cache_offset = interpreter_frame_mdp_offset - 1,48interpreter_frame_locals_offset = interpreter_frame_cache_offset - 1,49interpreter_frame_bcp_offset = interpreter_frame_locals_offset - 1,50interpreter_frame_initial_sp_offset = interpreter_frame_bcp_offset - 1,5152interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset,53interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset,5455// Entry frames56entry_frame_call_wrapper_offset = 057};5859intptr_t ptr_at(int offset) const {60return *ptr_at_addr(offset);61}6263void ptr_at_put(int offset, intptr_t value) {64*ptr_at_addr(offset) = value;65}6667private:68// an additional field beyond _sp and _pc:69intptr_t* _fp; // frame pointer70// The interpreter and adapters will extend the frame of the caller.71// Since oopMaps are based on the sp of the caller before extension72// we need to know that value. However in order to compute the address73// of the return address we need the real "raw" sp. By convention we74// use sp() to mean "raw" sp and unextended_sp() to mean the caller's75// original sp.7677intptr_t* _unextended_sp;78void adjust_unextended_sp();7980intptr_t* ptr_at_addr(int offset) const {81return (intptr_t*) addr_at(offset);82}8384#ifdef ASSERT85// Used in frame::sender_for_{interpreter,compiled}_frame86static void verify_deopt_original_pc( CompiledMethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);87static void verify_deopt_mh_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {88verify_deopt_original_pc(nm, unextended_sp, true);89}90#endif9192public:93// Constructors9495frame(intptr_t* sp, intptr_t* fp, address pc);9697frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc);9899frame(intptr_t* sp, intptr_t* fp);100101void init(intptr_t* sp, intptr_t* fp, address pc);102103// accessors for the instance variables104// Note: not necessarily the real 'frame pointer' (see real_fp)105intptr_t* fp() const { return _fp; }106107inline address* sender_pc_addr() const;108109// expression stack tos if we are nested in a java call110intptr_t* interpreter_frame_last_sp() const;111112// deoptimization support113void interpreter_frame_set_last_sp(intptr_t* sp);114115// helper to update a map with callee-saved FP116static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);117118static jint interpreter_frame_expression_stack_direction() { return -1; }119120#endif // CPU_ARM_FRAME_ARM_HPP121122123