1 /*
2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // Inline functions for SPARC frames:
26
27 // Constructors
28
29 inline frame::frame() {
30 _pc = NULL;
31 _sp = NULL;
32 _younger_sp = NULL;
33 _cb = NULL;
34 _deopt_state = unknown;
35 _sp_adjustment_by_callee = 0;
36 }
37
38 // Accessors:
39
40 inline bool frame::equal(frame other) const {
41 bool ret = sp() == other.sp()
42 && fp() == other.fp()
43 && pc() == other.pc();
44 assert(!ret || ret && cb() == other.cb() && _deopt_state == other._deopt_state, "inconsistent construction");
278
279 int allocated_in_frame = (max_nof_locals + max_nof_monitors*2) - allocated_above_frame;
280
281 return compiler_frame_vm_locals_fp_offset - allocated_in_frame;
282 }
283
284 // On SPARC, the %lN and %iN registers are non-volatile.
285 inline bool frame::volatile_across_calls(Register reg) {
286 // This predicate is (presently) applied only to temporary registers,
287 // and so it need not recognize non-volatile globals.
288 return reg->is_out() || reg->is_global();
289 }
290
291 inline oop frame::saved_oop_result(RegisterMap* map) const {
292 return *((oop*) map->location(O0->as_VMReg()));
293 }
294
295 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
296 *((oop*) map->location(O0->as_VMReg())) = obj;
297 }
|
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
26 #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
27
28 // Inline functions for SPARC frames:
29
30 // Constructors
31
32 inline frame::frame() {
33 _pc = NULL;
34 _sp = NULL;
35 _younger_sp = NULL;
36 _cb = NULL;
37 _deopt_state = unknown;
38 _sp_adjustment_by_callee = 0;
39 }
40
41 // Accessors:
42
43 inline bool frame::equal(frame other) const {
44 bool ret = sp() == other.sp()
45 && fp() == other.fp()
46 && pc() == other.pc();
47 assert(!ret || ret && cb() == other.cb() && _deopt_state == other._deopt_state, "inconsistent construction");
281
282 int allocated_in_frame = (max_nof_locals + max_nof_monitors*2) - allocated_above_frame;
283
284 return compiler_frame_vm_locals_fp_offset - allocated_in_frame;
285 }
286
287 // On SPARC, the %lN and %iN registers are non-volatile.
288 inline bool frame::volatile_across_calls(Register reg) {
289 // This predicate is (presently) applied only to temporary registers,
290 // and so it need not recognize non-volatile globals.
291 return reg->is_out() || reg->is_global();
292 }
293
294 inline oop frame::saved_oop_result(RegisterMap* map) const {
295 return *((oop*) map->location(O0->as_VMReg()));
296 }
297
298 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
299 *((oop*) map->location(O0->as_VMReg())) = obj;
300 }
301
302 #endif // CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
|