1 /*
2 * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. 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.
167 intptr_t* _fp; // frame pointer
168 int _offset_fp; // relative frame pointer for use in stack-chunk frames
169 };
170 // The interpreter and adapters will extend the frame of the caller.
171 // Since oopMaps are based on the sp of the caller before extension
172 // we need to know that value. However in order to compute the address
173 // of the return address we need the real "raw" sp. Since sparc already
174 // uses sp() to mean "raw" sp and unextended_sp() to mean the caller's
175 // original sp we use that convention.
176
177 union {
178 intptr_t* _unextended_sp;
179 int _offset_unextended_sp; // for use in stack-chunk frames
180 };
181
182 intptr_t* ptr_at_addr(int offset) const {
183 return (intptr_t*) addr_at(offset);
184 }
185
186 public:
187 // Constructors
188
189 frame(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
190
191 frame(intptr_t* ptr_sp, intptr_t* unextended_sp, intptr_t* ptr_fp, address pc);
192
193 frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb);
194 // used for fast frame construction by continuations
195 frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map, bool on_heap);
196
197 frame(intptr_t* ptr_sp, intptr_t* ptr_fp);
198
199 void init(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
200 void setup(address pc);
201
202 // accessors for the instance variables
203 // Note: not necessarily the real 'frame pointer' (see real_fp)
204
205 intptr_t* fp() const { assert_absolute(); return _fp; }
206 void set_fp(intptr_t* newfp) { _fp = newfp; }
|
1 /*
2 * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. 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.
167 intptr_t* _fp; // frame pointer
168 int _offset_fp; // relative frame pointer for use in stack-chunk frames
169 };
170 // The interpreter and adapters will extend the frame of the caller.
171 // Since oopMaps are based on the sp of the caller before extension
172 // we need to know that value. However in order to compute the address
173 // of the return address we need the real "raw" sp. Since sparc already
174 // uses sp() to mean "raw" sp and unextended_sp() to mean the caller's
175 // original sp we use that convention.
176
177 union {
178 intptr_t* _unextended_sp;
179 int _offset_unextended_sp; // for use in stack-chunk frames
180 };
181
182 intptr_t* ptr_at_addr(int offset) const {
183 return (intptr_t*) addr_at(offset);
184 }
185
186 public:
187 // Support for scalarized inline type calling convention
188 static intptr_t* repair_sender_sp(nmethod* nm, intptr_t* sp, intptr_t** saved_fp_addr);
189 bool was_augmented_on_entry(int& real_size) const;
190
191 // Constructors
192
193 frame(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
194
195 frame(intptr_t* ptr_sp, intptr_t* unextended_sp, intptr_t* ptr_fp, address pc);
196
197 frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb);
198 // used for fast frame construction by continuations
199 frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map, bool on_heap);
200
201 frame(intptr_t* ptr_sp, intptr_t* ptr_fp);
202
203 void init(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc);
204 void setup(address pc);
205
206 // accessors for the instance variables
207 // Note: not necessarily the real 'frame pointer' (see real_fp)
208
209 intptr_t* fp() const { assert_absolute(); return _fp; }
210 void set_fp(intptr_t* newfp) { _fp = newfp; }
|