annotate src/share/vm/interpreter/templateTable.hpp @ 17467:55fb97c4c58d hs25-b65

8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013 Summary: Copyright year updated for files modified during 2013 Reviewed-by: twisti, iveresov
author mikael
date Tue, 24 Dec 2013 11:48:39 -0800
parents 5ccbab1c69f3
children abec000618bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17467
55fb97c4c58d 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 12962
diff changeset
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
0
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 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
25 #ifndef SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
26 #define SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
28 #include "interpreter/bytecodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
29 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
30 #include "runtime/frame.hpp"
12962
5ccbab1c69f3 8026251: New type profiling points: parameters to methods
roland
parents: 6725
diff changeset
31 #ifdef TARGET_ARCH_x86
5ccbab1c69f3 8026251: New type profiling points: parameters to methods
roland
parents: 6725
diff changeset
32 # include "interp_masm_x86.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
33 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
34 #ifdef TARGET_ARCH_MODEL_sparc
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
35 # include "interp_masm_sparc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
36 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
37 #ifdef TARGET_ARCH_MODEL_zero
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
38 # include "interp_masm_zero.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
39 #endif
2192
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
40 #ifdef TARGET_ARCH_MODEL_arm
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
41 # include "interp_masm_arm.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
42 #endif
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
43 #ifdef TARGET_ARCH_MODEL_ppc
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
44 # include "interp_masm_ppc.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
45 #endif
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
46
0
a61af66fc99e Initial load
duke
parents:
diff changeset
47 #ifndef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // All the necessary definitions used for (bytecode) template generation. Instead of
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // spreading the implementation functionality for each bytecode in the interpreter
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // and the snippet generator, a template is assigned to each bytecode which can be
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // used to generate the bytecode's implementation if needed.
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // A Template describes the properties of a code template for a given bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // and provides a generator to generate the code template.
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 class Template VALUE_OBJ_CLASS_SPEC {
a61af66fc99e Initial load
duke
parents:
diff changeset
58 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
59 enum Flags {
a61af66fc99e Initial load
duke
parents:
diff changeset
60 uses_bcp_bit, // set if template needs the bcp pointing to bytecode
a61af66fc99e Initial load
duke
parents:
diff changeset
61 does_dispatch_bit, // set if template dispatches on its own
a61af66fc99e Initial load
duke
parents:
diff changeset
62 calls_vm_bit, // set if template calls the vm
a61af66fc99e Initial load
duke
parents:
diff changeset
63 wide_bit // set if template belongs to a wide instruction
a61af66fc99e Initial load
duke
parents:
diff changeset
64 };
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 typedef void (*generator)(int arg);
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 int _flags; // describes interpreter template properties (bcp unknown)
a61af66fc99e Initial load
duke
parents:
diff changeset
69 TosState _tos_in; // tos cache state before template execution
a61af66fc99e Initial load
duke
parents:
diff changeset
70 TosState _tos_out; // tos cache state after template execution
a61af66fc99e Initial load
duke
parents:
diff changeset
71 generator _gen; // template code generator
a61af66fc99e Initial load
duke
parents:
diff changeset
72 int _arg; // argument for template code generator
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 void initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg);
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 friend class TemplateTable;
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
79 Bytecodes::Code bytecode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 bool is_valid() const { return _gen != NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 bool uses_bcp() const { return (_flags & (1 << uses_bcp_bit )) != 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 bool does_dispatch() const { return (_flags & (1 << does_dispatch_bit)) != 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 bool calls_vm() const { return (_flags & (1 << calls_vm_bit )) != 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 bool is_wide() const { return (_flags & (1 << wide_bit )) != 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
85 TosState tos_in() const { return _tos_in; }
a61af66fc99e Initial load
duke
parents:
diff changeset
86 TosState tos_out() const { return _tos_out; }
a61af66fc99e Initial load
duke
parents:
diff changeset
87 void generate(InterpreterMacroAssembler* masm);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 };
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // The TemplateTable defines all Templates and provides accessor functions
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // to get the template for a given bytecode.
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 class TemplateTable: AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
95 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
96 enum Operation { add, sub, mul, div, rem, _and, _or, _xor, shl, shr, ushr };
a61af66fc99e Initial load
duke
parents:
diff changeset
97 enum Condition { equal, not_equal, less, less_equal, greater, greater_equal };
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
98 enum CacheByte { f1_byte = 1, f2_byte = 2 }; // byte_no codes
0
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
101 static bool _is_initialized; // true if TemplateTable has been initialized
a61af66fc99e Initial load
duke
parents:
diff changeset
102 static Template _template_table [Bytecodes::number_of_codes];
a61af66fc99e Initial load
duke
parents:
diff changeset
103 static Template _template_table_wide[Bytecodes::number_of_codes];
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 static Template* _desc; // the current template to be generated
a61af66fc99e Initial load
duke
parents:
diff changeset
106 static Bytecodes::Code bytecode() { return _desc->bytecode(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
108 static BarrierSet* _bs; // Cache the barrier set.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
110 //%note templates_1
a61af66fc99e Initial load
duke
parents:
diff changeset
111 static InterpreterMacroAssembler* _masm; // the assembler used when generating templates
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // special registers
a61af66fc99e Initial load
duke
parents:
diff changeset
116 static inline Address at_bcp(int offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // helpers
a61af66fc99e Initial load
duke
parents:
diff changeset
119 static void unimplemented_bc();
3852
fdb992d83a87 7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents: 2426
diff changeset
120 static void patch_bytecode(Bytecodes::Code bc, Register bc_reg,
fdb992d83a87 7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents: 2426
diff changeset
121 Register temp_reg, bool load_bc_into_bc_reg = true, int byte_no = -1);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // C calls
a61af66fc99e Initial load
duke
parents:
diff changeset
124 static void call_VM(Register oop_result, address entry_point);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 static void call_VM(Register oop_result, address entry_point, Register arg_1);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 static void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 static void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // these overloadings are not presently used on SPARC:
a61af66fc99e Initial load
duke
parents:
diff changeset
130 static void call_VM(Register oop_result, Register last_java_sp, address entry_point);
a61af66fc99e Initial load
duke
parents:
diff changeset
131 static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 static void call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, Register arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
136 static void nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 static void aconst_null();
a61af66fc99e Initial load
duke
parents:
diff changeset
139 static void iconst(int value);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 static void lconst(int value);
a61af66fc99e Initial load
duke
parents:
diff changeset
141 static void fconst(int value);
a61af66fc99e Initial load
duke
parents:
diff changeset
142 static void dconst(int value);
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 static void bipush();
a61af66fc99e Initial load
duke
parents:
diff changeset
145 static void sipush();
a61af66fc99e Initial load
duke
parents:
diff changeset
146 static void ldc(bool wide);
a61af66fc99e Initial load
duke
parents:
diff changeset
147 static void ldc2_w();
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1579
diff changeset
148 static void fast_aldc(bool wide);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 static void locals_index(Register reg, int offset = 1);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 static void iload();
a61af66fc99e Initial load
duke
parents:
diff changeset
152 static void fast_iload();
a61af66fc99e Initial load
duke
parents:
diff changeset
153 static void fast_iload2();
a61af66fc99e Initial load
duke
parents:
diff changeset
154 static void fast_icaload();
a61af66fc99e Initial load
duke
parents:
diff changeset
155 static void lload();
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static void fload();
a61af66fc99e Initial load
duke
parents:
diff changeset
157 static void dload();
a61af66fc99e Initial load
duke
parents:
diff changeset
158 static void aload();
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 static void locals_index_wide(Register reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
161 static void wide_iload();
a61af66fc99e Initial load
duke
parents:
diff changeset
162 static void wide_lload();
a61af66fc99e Initial load
duke
parents:
diff changeset
163 static void wide_fload();
a61af66fc99e Initial load
duke
parents:
diff changeset
164 static void wide_dload();
a61af66fc99e Initial load
duke
parents:
diff changeset
165 static void wide_aload();
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 static void iaload();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 static void laload();
a61af66fc99e Initial load
duke
parents:
diff changeset
169 static void faload();
a61af66fc99e Initial load
duke
parents:
diff changeset
170 static void daload();
a61af66fc99e Initial load
duke
parents:
diff changeset
171 static void aaload();
a61af66fc99e Initial load
duke
parents:
diff changeset
172 static void baload();
a61af66fc99e Initial load
duke
parents:
diff changeset
173 static void caload();
a61af66fc99e Initial load
duke
parents:
diff changeset
174 static void saload();
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 static void iload(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
177 static void lload(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
178 static void fload(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
179 static void dload(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
180 static void aload(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
181 static void aload_0();
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 static void istore();
a61af66fc99e Initial load
duke
parents:
diff changeset
184 static void lstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
185 static void fstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
186 static void dstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
187 static void astore();
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 static void wide_istore();
a61af66fc99e Initial load
duke
parents:
diff changeset
190 static void wide_lstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
191 static void wide_fstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
192 static void wide_dstore();
a61af66fc99e Initial load
duke
parents:
diff changeset
193 static void wide_astore();
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 static void iastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
196 static void lastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
197 static void fastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
198 static void dastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
199 static void aastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
200 static void bastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
201 static void castore();
a61af66fc99e Initial load
duke
parents:
diff changeset
202 static void sastore();
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204 static void istore(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
205 static void lstore(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 static void fstore(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 static void dstore(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
208 static void astore(int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 static void pop();
a61af66fc99e Initial load
duke
parents:
diff changeset
211 static void pop2();
a61af66fc99e Initial load
duke
parents:
diff changeset
212 static void dup();
a61af66fc99e Initial load
duke
parents:
diff changeset
213 static void dup_x1();
a61af66fc99e Initial load
duke
parents:
diff changeset
214 static void dup_x2();
a61af66fc99e Initial load
duke
parents:
diff changeset
215 static void dup2();
a61af66fc99e Initial load
duke
parents:
diff changeset
216 static void dup2_x1();
a61af66fc99e Initial load
duke
parents:
diff changeset
217 static void dup2_x2();
a61af66fc99e Initial load
duke
parents:
diff changeset
218 static void swap();
a61af66fc99e Initial load
duke
parents:
diff changeset
219
a61af66fc99e Initial load
duke
parents:
diff changeset
220 static void iop2(Operation op);
a61af66fc99e Initial load
duke
parents:
diff changeset
221 static void lop2(Operation op);
a61af66fc99e Initial load
duke
parents:
diff changeset
222 static void fop2(Operation op);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 static void dop2(Operation op);
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 static void idiv();
a61af66fc99e Initial load
duke
parents:
diff changeset
226 static void irem();
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 static void lmul();
a61af66fc99e Initial load
duke
parents:
diff changeset
229 static void ldiv();
a61af66fc99e Initial load
duke
parents:
diff changeset
230 static void lrem();
a61af66fc99e Initial load
duke
parents:
diff changeset
231 static void lshl();
a61af66fc99e Initial load
duke
parents:
diff changeset
232 static void lshr();
a61af66fc99e Initial load
duke
parents:
diff changeset
233 static void lushr();
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 static void ineg();
a61af66fc99e Initial load
duke
parents:
diff changeset
236 static void lneg();
a61af66fc99e Initial load
duke
parents:
diff changeset
237 static void fneg();
a61af66fc99e Initial load
duke
parents:
diff changeset
238 static void dneg();
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 static void iinc();
a61af66fc99e Initial load
duke
parents:
diff changeset
241 static void wide_iinc();
a61af66fc99e Initial load
duke
parents:
diff changeset
242 static void convert();
a61af66fc99e Initial load
duke
parents:
diff changeset
243 static void lcmp();
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 static void float_cmp (bool is_float, int unordered_result);
a61af66fc99e Initial load
duke
parents:
diff changeset
246 static void float_cmp (int unordered_result);
a61af66fc99e Initial load
duke
parents:
diff changeset
247 static void double_cmp(int unordered_result);
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 static void count_calls(Register method, Register temp);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 static void branch(bool is_jsr, bool is_wide);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 static void if_0cmp (Condition cc);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 static void if_icmp (Condition cc);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 static void if_nullcmp(Condition cc);
a61af66fc99e Initial load
duke
parents:
diff changeset
254 static void if_acmp (Condition cc);
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 static void _goto();
a61af66fc99e Initial load
duke
parents:
diff changeset
257 static void jsr();
a61af66fc99e Initial load
duke
parents:
diff changeset
258 static void ret();
a61af66fc99e Initial load
duke
parents:
diff changeset
259 static void wide_ret();
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 static void goto_w();
a61af66fc99e Initial load
duke
parents:
diff changeset
262 static void jsr_w();
a61af66fc99e Initial load
duke
parents:
diff changeset
263
a61af66fc99e Initial load
duke
parents:
diff changeset
264 static void tableswitch();
a61af66fc99e Initial load
duke
parents:
diff changeset
265 static void lookupswitch();
a61af66fc99e Initial load
duke
parents:
diff changeset
266 static void fast_linearswitch();
a61af66fc99e Initial load
duke
parents:
diff changeset
267 static void fast_binaryswitch();
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 static void _return(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
270
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
271 static void resolve_cache_and_index(int byte_no, // one of 1,2,11
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
272 Register cache, // output for CP cache
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
273 Register index, // output for CP index
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
274 size_t index_size); // one of 1,2,4
0
a61af66fc99e Initial load
duke
parents:
diff changeset
275 static void load_invoke_cp_cache_entry(int byte_no,
a61af66fc99e Initial load
duke
parents:
diff changeset
276 Register method,
a61af66fc99e Initial load
duke
parents:
diff changeset
277 Register itable_index,
a61af66fc99e Initial load
duke
parents:
diff changeset
278 Register flags,
1565
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
279 bool is_invokevirtual,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
280 bool is_virtual_final,
ab102d5d923e 6939207: refactor constant pool index processing
jrose
parents: 844
diff changeset
281 bool is_invokedynamic);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
282 static void load_field_cp_cache_entry(Register obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
283 Register cache,
a61af66fc99e Initial load
duke
parents:
diff changeset
284 Register index,
a61af66fc99e Initial load
duke
parents:
diff changeset
285 Register offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
286 Register flags,
a61af66fc99e Initial load
duke
parents:
diff changeset
287 bool is_static);
a61af66fc99e Initial load
duke
parents:
diff changeset
288 static void invokevirtual(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
289 static void invokespecial(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
290 static void invokestatic(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
291 static void invokeinterface(int byte_no);
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 342
diff changeset
292 static void invokedynamic(int byte_no);
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3852
diff changeset
293 static void invokehandle(int byte_no);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
294 static void fast_invokevfinal(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
295
a61af66fc99e Initial load
duke
parents:
diff changeset
296 static void getfield_or_static(int byte_no, bool is_static);
a61af66fc99e Initial load
duke
parents:
diff changeset
297 static void putfield_or_static(int byte_no, bool is_static);
a61af66fc99e Initial load
duke
parents:
diff changeset
298 static void getfield(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
299 static void putfield(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 static void getstatic(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
301 static void putstatic(int byte_no);
a61af66fc99e Initial load
duke
parents:
diff changeset
302 static void pop_and_check_object(Register obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
303
a61af66fc99e Initial load
duke
parents:
diff changeset
304 static void _new();
a61af66fc99e Initial load
duke
parents:
diff changeset
305 static void newarray();
a61af66fc99e Initial load
duke
parents:
diff changeset
306 static void anewarray();
a61af66fc99e Initial load
duke
parents:
diff changeset
307 static void arraylength();
a61af66fc99e Initial load
duke
parents:
diff changeset
308 static void checkcast();
a61af66fc99e Initial load
duke
parents:
diff changeset
309 static void instanceof();
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 static void athrow();
a61af66fc99e Initial load
duke
parents:
diff changeset
312
a61af66fc99e Initial load
duke
parents:
diff changeset
313 static void monitorenter();
a61af66fc99e Initial load
duke
parents:
diff changeset
314 static void monitorexit();
a61af66fc99e Initial load
duke
parents:
diff changeset
315
a61af66fc99e Initial load
duke
parents:
diff changeset
316 static void wide();
a61af66fc99e Initial load
duke
parents:
diff changeset
317 static void multianewarray();
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 static void fast_xaccess(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
320 static void fast_accessfield(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
321 static void fast_storefield(TosState state);
a61af66fc99e Initial load
duke
parents:
diff changeset
322
a61af66fc99e Initial load
duke
parents:
diff changeset
323 static void _breakpoint();
a61af66fc99e Initial load
duke
parents:
diff changeset
324
a61af66fc99e Initial load
duke
parents:
diff changeset
325 static void shouldnotreachhere();
a61af66fc99e Initial load
duke
parents:
diff changeset
326
a61af66fc99e Initial load
duke
parents:
diff changeset
327 // jvmti support
a61af66fc99e Initial load
duke
parents:
diff changeset
328 static void jvmti_post_field_access(Register cache, Register index, bool is_static, bool has_tos);
a61af66fc99e Initial load
duke
parents:
diff changeset
329 static void jvmti_post_field_mod(Register cache, Register index, bool is_static);
a61af66fc99e Initial load
duke
parents:
diff changeset
330 static void jvmti_post_fast_field_mod();
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 // debugging of TemplateGenerator
a61af66fc99e Initial load
duke
parents:
diff changeset
333 static void transition(TosState tos_in, TosState tos_out);// checks if in/out states expected by template generator correspond to table entries
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335 // initialization helpers
a61af66fc99e Initial load
duke
parents:
diff changeset
336 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)( ), char filler );
a61af66fc99e Initial load
duke
parents:
diff changeset
337 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(int arg ), int arg );
a61af66fc99e Initial load
duke
parents:
diff changeset
338 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg ), bool arg );
a61af66fc99e Initial load
duke
parents:
diff changeset
339 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos);
a61af66fc99e Initial load
duke
parents:
diff changeset
340 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op);
a61af66fc99e Initial load
duke
parents:
diff changeset
341 static void def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc);
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 friend class Template;
a61af66fc99e Initial load
duke
parents:
diff changeset
344
a61af66fc99e Initial load
duke
parents:
diff changeset
345 // InterpreterMacroAssembler::is_a(), etc., need TemplateTable::call_VM().
a61af66fc99e Initial load
duke
parents:
diff changeset
346 friend class InterpreterMacroAssembler;
a61af66fc99e Initial load
duke
parents:
diff changeset
347
a61af66fc99e Initial load
duke
parents:
diff changeset
348 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
349 // Initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
350 static void initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
351 static void pd_initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
352
a61af66fc99e Initial load
duke
parents:
diff changeset
353 // Templates
a61af66fc99e Initial load
duke
parents:
diff changeset
354 static Template* template_for (Bytecodes::Code code) { Bytecodes::check (code); return &_template_table [code]; }
a61af66fc99e Initial load
duke
parents:
diff changeset
355 static Template* template_for_wide(Bytecodes::Code code) { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
a61af66fc99e Initial load
duke
parents:
diff changeset
356
a61af66fc99e Initial load
duke
parents:
diff changeset
357 // Platform specifics
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
358 #ifdef TARGET_ARCH_MODEL_x86_32
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
359 # include "templateTable_x86_32.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
360 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
361 #ifdef TARGET_ARCH_MODEL_x86_64
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
362 # include "templateTable_x86_64.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
363 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
364 #ifdef TARGET_ARCH_MODEL_sparc
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
365 # include "templateTable_sparc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
366 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
367 #ifdef TARGET_ARCH_MODEL_zero
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
368 # include "templateTable_zero.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
369 #endif
2192
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
370 #ifdef TARGET_ARCH_MODEL_arm
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
371 # include "templateTable_arm.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
372 #endif
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
373 #ifdef TARGET_ARCH_MODEL_ppc
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
374 # include "templateTable_ppc.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 1972
diff changeset
375 #endif
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
376
0
a61af66fc99e Initial load
duke
parents:
diff changeset
377 };
a61af66fc99e Initial load
duke
parents:
diff changeset
378 #endif /* !CC_INTERP */
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
379
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1602
diff changeset
380 #endif // SHARE_VM_INTERPRETER_TEMPLATETABLE_HPP