1 /*
2 * Copyright (c) 1997, 2011, 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 *
60 InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
61
62 void load_earlyret_value(TosState state);
63
64 // Interpreter-specific registers
65 #ifdef CC_INTERP
66 void save_bcp() { /* not needed in c++ interpreter and harmless */ }
67 void restore_bcp() { /* not needed in c++ interpreter and harmless */ }
68
69 // Helpers for runtime call arguments/results
70 void get_method(Register reg);
71
72 #else
73
74 void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); }
75 void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); }
76 void restore_locals() { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); }
77
78 // Helpers for runtime call arguments/results
79 void get_method(Register reg) { movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); }
80 void get_constant_pool(Register reg) { get_method(reg); movptr(reg, Address(reg, methodOopDesc::constants_offset())); }
81 void get_constant_pool_cache(Register reg) { get_constant_pool(reg); movptr(reg, Address(reg, constantPoolOopDesc::cache_offset_in_bytes())); }
82 void get_cpool_and_tags(Register cpool, Register tags) { get_constant_pool(cpool); movptr(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes()));
83 }
84 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset);
85 void get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset, size_t index_size = sizeof(u2));
86 void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register index, Register bytecode, int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
87 void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
88 void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2));
89
90 // Expression stack
91 void f2ieee(); // truncate ftos to 32bits
92 void d2ieee(); // truncate dtos to 64bits
93
94 void pop_ptr(Register r = rax);
95 void pop_i(Register r = rax);
96 void pop_l(Register lo = rax, Register hi = rdx);
97 void pop_f();
98 void pop_d();
99
100 void push_ptr(Register r = rax);
|
1 /*
2 * Copyright (c) 1997, 2012, 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 *
60 InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
61
62 void load_earlyret_value(TosState state);
63
64 // Interpreter-specific registers
65 #ifdef CC_INTERP
66 void save_bcp() { /* not needed in c++ interpreter and harmless */ }
67 void restore_bcp() { /* not needed in c++ interpreter and harmless */ }
68
69 // Helpers for runtime call arguments/results
70 void get_method(Register reg);
71
72 #else
73
74 void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); }
75 void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); }
76 void restore_locals() { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); }
77
78 // Helpers for runtime call arguments/results
79 void get_method(Register reg) { movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); }
80 void get_const(Register reg) { get_method(reg); movptr(reg, Address(reg, methodOopDesc::const_offset())); }
81 void get_constant_pool(Register reg) { get_const(reg); movptr(reg, Address(reg, constMethodOopDesc::constants_offset())); }
82 void get_constant_pool_cache(Register reg) { get_constant_pool(reg); movptr(reg, Address(reg, constantPoolOopDesc::cache_offset_in_bytes())); }
83 void get_cpool_and_tags(Register cpool, Register tags) { get_constant_pool(cpool); movptr(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes()));
84 }
85 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset);
86 void get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset, size_t index_size = sizeof(u2));
87 void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register index, Register bytecode, int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
88 void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
89 void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2));
90
91 // Expression stack
92 void f2ieee(); // truncate ftos to 32bits
93 void d2ieee(); // truncate dtos to 64bits
94
95 void pop_ptr(Register r = rax);
96 void pop_i(Register r = rax);
97 void pop_l(Register lo = rax, Register hi = rdx);
98 void pop_f();
99 void pop_d();
100
101 void push_ptr(Register r = rax);
|