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