annotate src/cpu/aarch64/vm/frame_aarch64.hpp @ 12823:b756e7a2ec33

Added tag jdk-9+181 for changeset 4a443796f6f5
author prr
date Thu, 03 Aug 2017 18:56:57 +0000
parents 98937e623982
children
rev   line source
aph@7879 1 /*
coleenp@11019 2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
aph@7879 3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
aph@7879 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aph@7879 5 *
aph@7879 6 * This code is free software; you can redistribute it and/or modify it
aph@7879 7 * under the terms of the GNU General Public License version 2 only, as
aph@7879 8 * published by the Free Software Foundation.
aph@7879 9 *
aph@7879 10 * This code is distributed in the hope that it will be useful, but WITHOUT
aph@7879 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aph@7879 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aph@7879 13 * version 2 for more details (a copy is included in the LICENSE file that
aph@7879 14 * accompanied this code).
aph@7879 15 *
aph@7879 16 * You should have received a copy of the GNU General Public License version
aph@7879 17 * 2 along with this work; if not, write to the Free Software Foundation,
aph@7879 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aph@7879 19 *
aph@7879 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aph@7879 21 * or visit www.oracle.com if you need additional information or have any
aph@7879 22 * questions.
aph@7879 23 *
aph@7879 24 */
aph@7879 25
aph@7879 26 #ifndef CPU_AARCH64_VM_FRAME_AARCH64_HPP
aph@7879 27 #define CPU_AARCH64_VM_FRAME_AARCH64_HPP
aph@7879 28
aph@7879 29 #include "runtime/synchronizer.hpp"
aph@7879 30
aph@7879 31 // A frame represents a physical stack frame (an activation). Frames can be
aph@7879 32 // C or Java frames, and the Java frames can be interpreted or compiled.
aph@7879 33 // In contrast, vframes represent source-level activations, so that one physical frame
aph@7879 34 // can correspond to multiple source level frames because of inlining.
aph@7879 35 // A frame is comprised of {pc, fp, sp}
aph@7879 36 // ------------------------------ Asm interpreter ----------------------------------------
aph@7879 37 // Layout of asm interpreter frame:
aph@7879 38 // [expression stack ] * <- sp
aph@7879 39
aph@7879 40 // [monitors[0] ] \
aph@7879 41 // ... | monitor block size = k
aph@7879 42 // [monitors[k-1] ] /
aph@7879 43 // [frame initial esp ] ( == &monitors[0], initially here) initial_sp_offset
aph@7879 44 // [byte code index/pointr] = bcx() bcx_offset
aph@7879 45
aph@7879 46 // [pointer to locals ] = locals() locals_offset
aph@7879 47 // [constant pool cache ] = cache() cache_offset
aph@7879 48
aph@12531 49 // [klass of method ] = mirror() mirror_offset
aph@12531 50 // [padding ]
aph@12531 51
aph@7879 52 // [methodData ] = mdp() mdx_offset
aph@7879 53 // [methodOop ] = method() method_offset
aph@7879 54
aph@7879 55 // [last esp ] = last_sp() last_sp_offset
aph@7879 56 // [old stack pointer ] (sender_sp) sender_sp_offset
aph@7879 57
aph@7879 58 // [old frame pointer ] <- fp = link()
aph@7879 59 // [return pc ]
aph@7879 60
aph@7879 61 // [last sp ]
aph@7879 62 // [oop temp ] (only for native calls)
aph@7879 63
aph@7879 64 // [locals and parameters ]
aph@7879 65 // <- sender sp
aph@7879 66 // ------------------------------ Asm interpreter ----------------------------------------
aph@7879 67
aph@7879 68 public:
aph@7879 69 enum {
aph@7879 70 pc_return_offset = 0,
aph@7879 71 // All frames
aph@7879 72 link_offset = 0,
aph@7879 73 return_addr_offset = 1,
aph@7879 74 sender_sp_offset = 2,
aph@7879 75
aph@7879 76 // Interpreter frames
aph@7879 77 interpreter_frame_oop_temp_offset = 3, // for native calls only
aph@7879 78
aph@7879 79 interpreter_frame_sender_sp_offset = -1,
aph@7879 80 // outgoing sp before a call to an invoked method
aph@7879 81 interpreter_frame_last_sp_offset = interpreter_frame_sender_sp_offset - 1,
aph@7879 82 interpreter_frame_method_offset = interpreter_frame_last_sp_offset - 1,
aph@7879 83 interpreter_frame_mdp_offset = interpreter_frame_method_offset - 1,
coleenp@11019 84 interpreter_frame_padding_offset = interpreter_frame_mdp_offset - 1,
coleenp@11019 85 interpreter_frame_mirror_offset = interpreter_frame_padding_offset - 1,
coleenp@11019 86 interpreter_frame_cache_offset = interpreter_frame_mirror_offset - 1,
aph@7879 87 interpreter_frame_locals_offset = interpreter_frame_cache_offset - 1,
aph@7879 88 interpreter_frame_bcp_offset = interpreter_frame_locals_offset - 1,
aph@7879 89 interpreter_frame_initial_sp_offset = interpreter_frame_bcp_offset - 1,
aph@7879 90
aph@7879 91 interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset,
aph@7879 92 interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset,
aph@7879 93
aph@7879 94 // Entry frames
aph@7879 95 // n.b. these values are determined by the layout defined in
aph@7879 96 // stubGenerator for the Java call stub
aph@7879 97 entry_frame_after_call_words = 27,
aph@7879 98 entry_frame_call_wrapper_offset = -8,
aph@7879 99
aph@7879 100 // we don't need a save area
mikael@7993 101 arg_reg_save_area_bytes = 0
aph@7879 102
aph@7879 103 };
aph@7879 104
aph@7879 105 intptr_t ptr_at(int offset) const {
aph@7879 106 return *ptr_at_addr(offset);
aph@7879 107 }
aph@7879 108
aph@7879 109 void ptr_at_put(int offset, intptr_t value) {
aph@7879 110 *ptr_at_addr(offset) = value;
aph@7879 111 }
aph@7879 112
aph@7879 113 private:
aph@7879 114 // an additional field beyond _sp and _pc:
aph@7879 115 intptr_t* _fp; // frame pointer
aph@7879 116 // The interpreter and adapters will extend the frame of the caller.
aph@7879 117 // Since oopMaps are based on the sp of the caller before extension
aph@7879 118 // we need to know that value. However in order to compute the address
aph@7879 119 // of the return address we need the real "raw" sp. Since sparc already
aph@7879 120 // uses sp() to mean "raw" sp and unextended_sp() to mean the caller's
aph@7879 121 // original sp we use that convention.
aph@7879 122
aph@7879 123 intptr_t* _unextended_sp;
aph@7879 124 void adjust_unextended_sp();
aph@7879 125
aph@7879 126 intptr_t* ptr_at_addr(int offset) const {
aph@7879 127 return (intptr_t*) addr_at(offset);
aph@7879 128 }
aph@7879 129
aph@7879 130 #ifdef ASSERT
aph@7879 131 // Used in frame::sender_for_{interpreter,compiled}_frame
rbackman@11078 132 static void verify_deopt_original_pc( CompiledMethod* nm, intptr_t* unextended_sp);
aph@7879 133 #endif
aph@7879 134
aph@7879 135 public:
aph@7879 136 // Constructors
aph@7879 137
aph@7879 138 frame(intptr_t* sp, intptr_t* fp, address pc);
aph@7879 139
aph@7879 140 frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc);
aph@7879 141
aph@7879 142 frame(intptr_t* sp, intptr_t* fp);
aph@7879 143
aph@7879 144 void init(intptr_t* sp, intptr_t* fp, address pc);
aph@7879 145
aph@7879 146 // accessors for the instance variables
aph@7879 147 // Note: not necessarily the real 'frame pointer' (see real_fp)
aph@7879 148 intptr_t* fp() const { return _fp; }
aph@7879 149
aph@7879 150 inline address* sender_pc_addr() const;
aph@7879 151
aph@7879 152 // expression stack tos if we are nested in a java call
aph@7879 153 intptr_t* interpreter_frame_last_sp() const;
aph@7879 154
aph@7879 155 // helper to update a map with callee-saved RBP
aph@7879 156 static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);
aph@7879 157
aph@7879 158 // deoptimization support
aph@7879 159 void interpreter_frame_set_last_sp(intptr_t* sp);
aph@7879 160
aph@7879 161 #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP