annotate src/cpu/sparc/vm/interp_masm_sparc.hpp @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents a61af66fc99e
children 87684f1a88b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // This file specializes the assember with interpreter-specific macros
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 REGISTER_DECLARATION( Register, Otos_i , O0); // tos for ints, etc
a61af66fc99e Initial load
duke
parents:
diff changeset
28 REGISTER_DECLARATION( Register, Otos_l , O0); // for longs
a61af66fc99e Initial load
duke
parents:
diff changeset
29 REGISTER_DECLARATION( Register, Otos_l1, O0); // for 1st part of longs
a61af66fc99e Initial load
duke
parents:
diff changeset
30 REGISTER_DECLARATION( Register, Otos_l2, O1); // for 2nd part of longs
a61af66fc99e Initial load
duke
parents:
diff changeset
31 REGISTER_DECLARATION(FloatRegister, Ftos_f , F0); // for floats
a61af66fc99e Initial load
duke
parents:
diff changeset
32 REGISTER_DECLARATION(FloatRegister, Ftos_d , F0); // for doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
33 REGISTER_DECLARATION(FloatRegister, Ftos_d1, F0); // for 1st part of double
a61af66fc99e Initial load
duke
parents:
diff changeset
34 REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 #ifndef DONT_USE_REGISTER_DEFINES
a61af66fc99e Initial load
duke
parents:
diff changeset
37 #define Otos_i O0
a61af66fc99e Initial load
duke
parents:
diff changeset
38 #define Otos_l O0
a61af66fc99e Initial load
duke
parents:
diff changeset
39 #define Otos_l1 O0
a61af66fc99e Initial load
duke
parents:
diff changeset
40 #define Otos_l2 O1
a61af66fc99e Initial load
duke
parents:
diff changeset
41 #define Ftos_f F0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 #define Ftos_d F0
a61af66fc99e Initial load
duke
parents:
diff changeset
43 #define Ftos_d1 F0
a61af66fc99e Initial load
duke
parents:
diff changeset
44 #define Ftos_d2 F1
a61af66fc99e Initial load
duke
parents:
diff changeset
45 #endif // DONT_USE_REGISTER_DEFINES
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 class InterpreterMacroAssembler: public MacroAssembler {
a61af66fc99e Initial load
duke
parents:
diff changeset
48 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
49 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // Interpreter specific version of call_VM_base
a61af66fc99e Initial load
duke
parents:
diff changeset
51 virtual void call_VM_leaf_base(
a61af66fc99e Initial load
duke
parents:
diff changeset
52 Register java_thread,
a61af66fc99e Initial load
duke
parents:
diff changeset
53 address entry_point,
a61af66fc99e Initial load
duke
parents:
diff changeset
54 int number_of_arguments
a61af66fc99e Initial load
duke
parents:
diff changeset
55 );
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 virtual void call_VM_base(
a61af66fc99e Initial load
duke
parents:
diff changeset
58 Register oop_result,
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Register java_thread,
a61af66fc99e Initial load
duke
parents:
diff changeset
60 Register last_java_sp,
a61af66fc99e Initial load
duke
parents:
diff changeset
61 address entry_point,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 int number_of_arguments,
a61af66fc99e Initial load
duke
parents:
diff changeset
63 bool check_exception=true
a61af66fc99e Initial load
duke
parents:
diff changeset
64 );
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 virtual void check_and_handle_popframe(Register java_thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
67 virtual void check_and_handle_earlyret(Register java_thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // base routine for all dispatches
a61af66fc99e Initial load
duke
parents:
diff changeset
70 void dispatch_base(TosState state, address* table);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
74 InterpreterMacroAssembler(CodeBuffer* c)
a61af66fc99e Initial load
duke
parents:
diff changeset
75 : MacroAssembler(c) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
78 virtual void load_earlyret_value(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static const Address l_tmp ;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 static const Address d_tmp ;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // helper routine for frame allocation/deallocation
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // compute the delta by which the caller's SP has to
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // be adjusted to accomodate for the non-argument
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // locals
a61af66fc99e Initial load
duke
parents:
diff changeset
88 void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta);
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // dispatch routines
a61af66fc99e Initial load
duke
parents:
diff changeset
93 void dispatch_prolog(TosState state, int step = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 void dispatch_epilog(TosState state, int step = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
95 void dispatch_only(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 void dispatch_normal(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 void dispatch_next(TosState state, int step = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 void dispatch_next_noverify_oop(TosState state, int step = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 void dispatch_via (TosState state, address* table);
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Removes the current activation (incl. unlocking of monitors).
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // Additionally this code is used for earlyReturn in which case we
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // want to skip throwing an exception and installing an exception.
a61af66fc99e Initial load
duke
parents:
diff changeset
105 void remove_activation(TosState state,
a61af66fc99e Initial load
duke
parents:
diff changeset
106 bool throw_monitor_exception = true,
a61af66fc99e Initial load
duke
parents:
diff changeset
107 bool install_monitor_exception = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
110 void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls
a61af66fc99e Initial load
duke
parents:
diff changeset
115 void super_call_VM(Register thread_cache,
a61af66fc99e Initial load
duke
parents:
diff changeset
116 Register oop_result,
a61af66fc99e Initial load
duke
parents:
diff changeset
117 Register last_java_sp,
a61af66fc99e Initial load
duke
parents:
diff changeset
118 address entry_point,
a61af66fc99e Initial load
duke
parents:
diff changeset
119 Register arg_1,
a61af66fc99e Initial load
duke
parents:
diff changeset
120 Register arg_2,
a61af66fc99e Initial load
duke
parents:
diff changeset
121 bool check_exception = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
124 void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1);
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // a subtype of super_klass. Blows registers tmp1, tmp2 and tmp3.
a61af66fc99e Initial load
duke
parents:
diff changeset
128 void gen_subtype_check( Register sub_klass, Register super_klass, Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype );
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // helpers for tossing exceptions
a61af66fc99e Initial load
duke
parents:
diff changeset
131 void throw_if_not_1_icc( Condition ok_condition, Label& ok );
a61af66fc99e Initial load
duke
parents:
diff changeset
132 void throw_if_not_1_xcc( Condition ok_condition, Label& ok );
a61af66fc99e Initial load
duke
parents:
diff changeset
133 void throw_if_not_1_x ( Condition ok_condition, Label& ok ); // chooses icc or xcc based on _LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 void throw_if_not_2( address throw_entry_point, Register Rscratch, Label& ok);
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 void throw_if_not_icc( Condition ok_condition, address throw_entry_point, Register Rscratch );
a61af66fc99e Initial load
duke
parents:
diff changeset
138 void throw_if_not_xcc( Condition ok_condition, address throw_entry_point, Register Rscratch );
a61af66fc99e Initial load
duke
parents:
diff changeset
139 void throw_if_not_x ( Condition ok_condition, address throw_entry_point, Register Rscratch );
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // helpers for expression stack
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 void pop_i( Register r = Otos_i);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 void pop_ptr( Register r = Otos_i, Register scratch = O4);
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void pop_l( Register r = Otos_l1);
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // G4_scratch and Lscratch are used at call sites!!
a61af66fc99e Initial load
duke
parents:
diff changeset
147 void pop_f(FloatRegister f = Ftos_f, Register scratch = G1_scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
148 void pop_d(FloatRegister f = Ftos_d1, Register scratch = G1_scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 void push_i( Register r = Otos_i);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 void push_ptr( Register r = Otos_i);
a61af66fc99e Initial load
duke
parents:
diff changeset
152 void push_ptr( Register r, Register tag);
a61af66fc99e Initial load
duke
parents:
diff changeset
153 void push_l( Register r = Otos_l1);
a61af66fc99e Initial load
duke
parents:
diff changeset
154 void push_f(FloatRegister f = Ftos_f);
a61af66fc99e Initial load
duke
parents:
diff changeset
155 void push_d(FloatRegister f = Ftos_d1);
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 void pop (TosState state); // transition vtos -> state
a61af66fc99e Initial load
duke
parents:
diff changeset
159 void push(TosState state); // transition state -> vtos
a61af66fc99e Initial load
duke
parents:
diff changeset
160 void empty_expression_stack(); // resets both Lesp and SP
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // Support for Tagged Stacks
a61af66fc99e Initial load
duke
parents:
diff changeset
163 void tag_stack(frame::Tag t, Register r);
a61af66fc99e Initial load
duke
parents:
diff changeset
164 void tag_stack(Register tag);
a61af66fc99e Initial load
duke
parents:
diff changeset
165 void tag_local(frame::Tag t, Register src, Register base, int n = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
168 void verify_sp(Register Rsp, Register Rtemp);
a61af66fc99e Initial load
duke
parents:
diff changeset
169 void verify_esp(Register Resp); // verify that Lesp points to a word in the temp stack
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 void verify_stack_tag(frame::Tag t, Register r, Register scratch = G0);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 void verify_local_tag(frame::Tag t, Register base, Register scr, int n = 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
173 #endif // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
176 void if_cmp(Condition cc, bool ptr_compare);
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // Load values from bytecode stream:
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 enum signedOrNot { Signed, Unsigned };
a61af66fc99e Initial load
duke
parents:
diff changeset
181 enum setCCOrNot { set_CC, dont_set_CC };
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 void get_2_byte_integer_at_bcp( int bcp_offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
184 Register Rtmp,
a61af66fc99e Initial load
duke
parents:
diff changeset
185 Register Rdst,
a61af66fc99e Initial load
duke
parents:
diff changeset
186 signedOrNot is_signed,
a61af66fc99e Initial load
duke
parents:
diff changeset
187 setCCOrNot should_set_CC = dont_set_CC );
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 void get_4_byte_integer_at_bcp( int bcp_offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
190 Register Rtmp,
a61af66fc99e Initial load
duke
parents:
diff changeset
191 Register Rdst,
a61af66fc99e Initial load
duke
parents:
diff changeset
192 setCCOrNot should_set_CC = dont_set_CC );
a61af66fc99e Initial load
duke
parents:
diff changeset
193
a61af66fc99e Initial load
duke
parents:
diff changeset
194 void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
195 void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197
a61af66fc99e Initial load
duke
parents:
diff changeset
198 // common code
a61af66fc99e Initial load
duke
parents:
diff changeset
199
a61af66fc99e Initial load
duke
parents:
diff changeset
200 void field_offset_at(int n, Register tmp, Register dest, Register base);
a61af66fc99e Initial load
duke
parents:
diff changeset
201 int field_offset_at(Register object, address bcp, int offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
202 void fast_iaaccess(int n, address bcp);
a61af66fc99e Initial load
duke
parents:
diff changeset
203 void fast_iagetfield(address bcp);
a61af66fc99e Initial load
duke
parents:
diff changeset
204 void fast_iaputfield(address bcp, bool do_store_check );
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 void index_check(Register array, Register index, int index_shift, Register tmp, Register res);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 void index_check_without_pop(Register array, Register index, int index_shift, Register tmp, Register res);
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 void get_constant_pool(Register Rdst);
a61af66fc99e Initial load
duke
parents:
diff changeset
210 void get_constant_pool_cache(Register Rdst);
a61af66fc99e Initial load
duke
parents:
diff changeset
211 void get_cpool_and_tags(Register Rcpool, Register Rtags);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 void is_a(Label& L);
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 // Load compiled (i2c) or interpreter entry and call from interpreted
a61af66fc99e Initial load
duke
parents:
diff changeset
215 void call_from_interpreter(Register target, Register scratch, Register Rret);
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // --------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 void unlock_if_synchronized_method(TosState state, bool throw_monitor_exception = true, bool install_monitor_exception = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 void add_monitor_to_stack( bool stack_is_empty,
a61af66fc99e Initial load
duke
parents:
diff changeset
222 Register Rtemp,
a61af66fc99e Initial load
duke
parents:
diff changeset
223 Register Rtemp2 );
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // Load/store aligned in _LP64 but unaligned otherwise
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // These only apply to the Interpreter expression stack and locals!
a61af66fc99e Initial load
duke
parents:
diff changeset
227 void load_unaligned_double(Register r1, int offset, FloatRegister d);
a61af66fc99e Initial load
duke
parents:
diff changeset
228 void store_unaligned_double(FloatRegister d, Register r1, int offset );
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 // Load/store aligned in _LP64 but unaligned otherwise
a61af66fc99e Initial load
duke
parents:
diff changeset
231 void load_unaligned_long(Register r1, int offset, Register d);
a61af66fc99e Initial load
duke
parents:
diff changeset
232 void store_unaligned_long(Register d, Register r1, int offset );
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 void access_local_int( Register index, Register dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
235 void access_local_ptr( Register index, Register dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
236 void access_local_returnAddress( Register index, Register dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
237 void access_local_long( Register index, Register dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
238 void access_local_float( Register index, FloatRegister dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
239 void access_local_double( Register index, FloatRegister dst );
a61af66fc99e Initial load
duke
parents:
diff changeset
240 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
241 void check_for_regarea_stomp( Register Rindex, int offset, Register Rlimit, Register Rscratch, Register Rscratch1);
a61af66fc99e Initial load
duke
parents:
diff changeset
242 #endif // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
243 void store_local_int( Register index, Register src );
a61af66fc99e Initial load
duke
parents:
diff changeset
244 void store_local_ptr( Register index, Register src, Register tag = Otos_l2 );
a61af66fc99e Initial load
duke
parents:
diff changeset
245 void store_local_ptr( int n, Register src, Register tag = Otos_l2 );
a61af66fc99e Initial load
duke
parents:
diff changeset
246 void store_local_long( Register index, Register src );
a61af66fc99e Initial load
duke
parents:
diff changeset
247 void store_local_float( Register index, FloatRegister src );
a61af66fc99e Initial load
duke
parents:
diff changeset
248 void store_local_double( Register index, FloatRegister src );
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 // Tagged stack helpers for swap and dup
a61af66fc99e Initial load
duke
parents:
diff changeset
251 void load_ptr_and_tag(int n, Register val, Register tag);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 void store_ptr_and_tag(int n, Register val, Register tag);
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // Tagged stack helper for getting receiver in register.
a61af66fc99e Initial load
duke
parents:
diff changeset
255 void load_receiver(Register param_count, Register recv);
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257 static int top_most_monitor_byte_offset(); // offset in bytes to top of monitor block
a61af66fc99e Initial load
duke
parents:
diff changeset
258 Address top_most_monitor();
a61af66fc99e Initial load
duke
parents:
diff changeset
259 void compute_stack_base( Register Rdest );
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
262 void increment_invocation_counter( Register Rtmp, Register Rtmp2 );
a61af66fc99e Initial load
duke
parents:
diff changeset
263 void increment_backedge_counter( Register Rtmp, Register Rtmp2 );
a61af66fc99e Initial load
duke
parents:
diff changeset
264 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
265 void test_backedge_count_for_osr( Register backedge_count, Register branch_bcp, Register Rtmp );
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
268 // Object locking
a61af66fc99e Initial load
duke
parents:
diff changeset
269 void lock_object (Register lock_reg, Register obj_reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
270 void unlock_object(Register lock_reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // Interpreter profiling operations
a61af66fc99e Initial load
duke
parents:
diff changeset
274 void set_method_data_pointer() { set_method_data_pointer_offset(noreg); }
a61af66fc99e Initial load
duke
parents:
diff changeset
275 void set_method_data_pointer_for_bcp();
a61af66fc99e Initial load
duke
parents:
diff changeset
276 void set_method_data_pointer_offset(Register mdi_reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
277 void test_method_data_pointer(Label& zero_continue);
a61af66fc99e Initial load
duke
parents:
diff changeset
278 void verify_method_data_pointer();
a61af66fc99e Initial load
duke
parents:
diff changeset
279 void test_invocation_counter_for_mdp(Register invocation_count, Register cur_bcp, Register Rtmp, Label &profile_continue);
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 void set_mdp_data_at(int constant, Register value);
a61af66fc99e Initial load
duke
parents:
diff changeset
282 void increment_mdp_data_at(Address counter, Register bumped_count,
a61af66fc99e Initial load
duke
parents:
diff changeset
283 bool decrement = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
284 void increment_mdp_data_at(int constant, Register bumped_count,
a61af66fc99e Initial load
duke
parents:
diff changeset
285 bool decrement = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
286 void increment_mdp_data_at(Register reg, int constant,
a61af66fc99e Initial load
duke
parents:
diff changeset
287 Register bumped_count, Register scratch2,
a61af66fc99e Initial load
duke
parents:
diff changeset
288 bool decrement = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
289 void set_mdp_flag_at(int flag_constant, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
290 void test_mdp_data_at(int offset, Register value, Label& not_equal_continue,
a61af66fc99e Initial load
duke
parents:
diff changeset
291 Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
292
a61af66fc99e Initial load
duke
parents:
diff changeset
293 void record_klass_in_profile(Register receiver, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
294 void record_klass_in_profile_helper(Register receiver, Register scratch,
a61af66fc99e Initial load
duke
parents:
diff changeset
295 int start_row, Label& done);
a61af66fc99e Initial load
duke
parents:
diff changeset
296
a61af66fc99e Initial load
duke
parents:
diff changeset
297 void update_mdp_by_offset(int offset_of_disp, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
298 void update_mdp_by_offset(Register reg, int offset_of_disp,
a61af66fc99e Initial load
duke
parents:
diff changeset
299 Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 void update_mdp_by_constant(int constant);
a61af66fc99e Initial load
duke
parents:
diff changeset
301 void update_mdp_for_ret(TosState state, Register return_bci);
a61af66fc99e Initial load
duke
parents:
diff changeset
302
a61af66fc99e Initial load
duke
parents:
diff changeset
303 void profile_taken_branch(Register scratch, Register bumped_count);
a61af66fc99e Initial load
duke
parents:
diff changeset
304 void profile_not_taken_branch(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
305 void profile_call(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
306 void profile_final_call(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
307 void profile_virtual_call(Register receiver, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
308 void profile_ret(TosState state, Register return_bci, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
309 void profile_null_seen(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
310 void profile_typecheck(Register klass, Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
311 void profile_typecheck_failed(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
312 void profile_switch_default(Register scratch);
a61af66fc99e Initial load
duke
parents:
diff changeset
313 void profile_switch_case(Register index,
a61af66fc99e Initial load
duke
parents:
diff changeset
314 Register scratch1,
a61af66fc99e Initial load
duke
parents:
diff changeset
315 Register scratch2,
a61af66fc99e Initial load
duke
parents:
diff changeset
316 Register scratch3);
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
319 void interp_verify_oop(Register reg, TosState state, const char * file, int line); // only if +VerifyOops && state == atos
a61af66fc99e Initial load
duke
parents:
diff changeset
320 void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
a61af66fc99e Initial load
duke
parents:
diff changeset
321 void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU && (state == ftos || state == dtos)
a61af66fc99e Initial load
duke
parents:
diff changeset
322
a61af66fc99e Initial load
duke
parents:
diff changeset
323 #endif /* CC_INTERP */
a61af66fc99e Initial load
duke
parents:
diff changeset
324 // support for JVMTI/Dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
325 typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
a61af66fc99e Initial load
duke
parents:
diff changeset
326 void notify_method_entry();
a61af66fc99e Initial load
duke
parents:
diff changeset
327 void notify_method_exit(
a61af66fc99e Initial load
duke
parents:
diff changeset
328 bool save_result, TosState state, NotifyMethodExitMode mode);
a61af66fc99e Initial load
duke
parents:
diff changeset
329
a61af66fc99e Initial load
duke
parents:
diff changeset
330 void save_return_value(TosState state, bool is_native_call);
a61af66fc99e Initial load
duke
parents:
diff changeset
331 void restore_return_value(TosState state, bool is_native_call);
a61af66fc99e Initial load
duke
parents:
diff changeset
332 };