author | jprovino |
Mon, 23 Mar 2015 12:18:20 +0100 | |
changeset 29695 | 7f733c2a8db4 |
parent 29461 | 3f6358b7c82c |
child 30120 | af79e35d33e1 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5419
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5419
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5419
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
13961
diff
changeset
|
26 |
#include "asm/macroAssembler.hpp" |
7397 | 27 |
#include "interpreter/interpreter.hpp" |
28 |
#include "interpreter/interpreterRuntime.hpp" |
|
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
24322
diff
changeset
|
29 |
#include "interpreter/interp_masm.hpp" |
7397 | 30 |
#include "interpreter/templateTable.hpp" |
31 |
#include "memory/universe.inline.hpp" |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
32 |
#include "oops/methodData.hpp" |
7397 | 33 |
#include "oops/objArrayKlass.hpp" |
34 |
#include "oops/oop.inline.hpp" |
|
35 |
#include "prims/methodHandles.hpp" |
|
36 |
#include "runtime/sharedRuntime.hpp" |
|
37 |
#include "runtime/stubRoutines.hpp" |
|
38 |
#include "runtime/synchronizer.hpp" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
14626
diff
changeset
|
39 |
#include "utilities/macros.hpp" |
1 | 40 |
|
1066 | 41 |
#ifndef CC_INTERP |
42 |
||
1 | 43 |
#define __ _masm-> |
44 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
45 |
// Global Register Names |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
46 |
Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
47 |
Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
48 |
|
1 | 49 |
// Platform-dependent initialization |
50 |
void TemplateTable::pd_initialize() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
51 |
// No x86 specific initialization |
1 | 52 |
} |
53 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
54 |
// Address Computation: local variables |
1 | 55 |
static inline Address iaddress(int n) { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
56 |
return Address(rlocals, Interpreter::local_offset_in_bytes(n)); |
1 | 57 |
} |
58 |
||
59 |
static inline Address laddress(int n) { |
|
60 |
return iaddress(n + 1); |
|
61 |
} |
|
62 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
63 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
64 |
static inline Address haddress(int n) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
65 |
return iaddress(n + 0); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
66 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
67 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
68 |
|
1 | 69 |
static inline Address faddress(int n) { |
70 |
return iaddress(n); |
|
71 |
} |
|
72 |
||
73 |
static inline Address daddress(int n) { |
|
74 |
return laddress(n); |
|
75 |
} |
|
76 |
||
77 |
static inline Address aaddress(int n) { |
|
78 |
return iaddress(n); |
|
79 |
} |
|
80 |
||
81 |
static inline Address iaddress(Register r) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
82 |
return Address(rlocals, r, Address::times_ptr); |
1 | 83 |
} |
84 |
||
85 |
static inline Address laddress(Register r) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
86 |
return Address(rlocals, r, Address::times_ptr, Interpreter::local_offset_in_bytes(1)); |
1 | 87 |
} |
88 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
89 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
90 |
static inline Address haddress(Register r) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
91 |
return Address(rlocals, r, Interpreter::stackElementScale(), Interpreter::local_offset_in_bytes(0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
92 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
93 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
94 |
|
1 | 95 |
static inline Address faddress(Register r) { |
96 |
return iaddress(r); |
|
97 |
} |
|
98 |
||
99 |
static inline Address daddress(Register r) { |
|
100 |
return laddress(r); |
|
101 |
} |
|
102 |
||
103 |
static inline Address aaddress(Register r) { |
|
104 |
return iaddress(r); |
|
105 |
} |
|
106 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
107 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
108 |
// expression stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
109 |
// (Note: Must not use symmetric equivalents at_rsp_m1/2 since they store |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
110 |
// data beyond the rsp which is potentially unsafe in an MT environment; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
111 |
// an interrupt may overwrite that data.) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
112 |
static inline Address at_rsp () { |
1 | 113 |
return Address(rsp, 0); |
114 |
} |
|
115 |
||
116 |
// At top of Java expression stack which may be different than esp(). It |
|
117 |
// isn't for category 1 objects. |
|
118 |
static inline Address at_tos () { |
|
119 |
return Address(rsp, Interpreter::expr_offset_in_bytes(0)); |
|
120 |
} |
|
121 |
||
122 |
static inline Address at_tos_p1() { |
|
123 |
return Address(rsp, Interpreter::expr_offset_in_bytes(1)); |
|
124 |
} |
|
125 |
||
126 |
static inline Address at_tos_p2() { |
|
127 |
return Address(rsp, Interpreter::expr_offset_in_bytes(2)); |
|
128 |
} |
|
129 |
||
130 |
// Condition conversion |
|
131 |
static Assembler::Condition j_not(TemplateTable::Condition cc) { |
|
132 |
switch (cc) { |
|
133 |
case TemplateTable::equal : return Assembler::notEqual; |
|
134 |
case TemplateTable::not_equal : return Assembler::equal; |
|
135 |
case TemplateTable::less : return Assembler::greaterEqual; |
|
136 |
case TemplateTable::less_equal : return Assembler::greater; |
|
137 |
case TemplateTable::greater : return Assembler::lessEqual; |
|
138 |
case TemplateTable::greater_equal: return Assembler::less; |
|
139 |
} |
|
140 |
ShouldNotReachHere(); |
|
141 |
return Assembler::zero; |
|
142 |
} |
|
143 |
||
144 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
145 |
|
1 | 146 |
// Miscelaneous helper routines |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
147 |
// Store an oop (or NULL) at the address described by obj. |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
148 |
// If val == noreg this means store a NULL |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
149 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
150 |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
151 |
static void do_oop_store(InterpreterMacroAssembler* _masm, |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
152 |
Address obj, |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
153 |
Register val, |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
154 |
BarrierSet::Name barrier, |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
155 |
bool precise) { |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
156 |
assert(val == noreg || val == rax, "parameter is just for looks"); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
157 |
switch (barrier) { |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
14626
diff
changeset
|
158 |
#if INCLUDE_ALL_GCS |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
159 |
case BarrierSet::G1SATBCTLogging: |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
160 |
{ |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
161 |
// flatten object address if needed |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
162 |
// We do it regardless of precise because we need the registers |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
163 |
if (obj.index() == noreg && obj.disp() == 0) { |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
164 |
if (obj.base() != rdx) { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
165 |
__ movptr(rdx, obj.base()); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
166 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
167 |
} else { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
168 |
__ lea(rdx, obj); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
169 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
170 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
171 |
Register rtmp = LP64_ONLY(r8) NOT_LP64(rsi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
172 |
Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
173 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
174 |
NOT_LP64(__ get_thread(rcx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
175 |
NOT_LP64(__ save_bcp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
176 |
|
9176
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
177 |
__ g1_write_barrier_pre(rdx /* obj */, |
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
178 |
rbx /* pre_val */, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
179 |
rthread /* thread */, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
180 |
rtmp /* tmp */, |
9176
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
181 |
val != noreg /* tosca_live */, |
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
182 |
false /* expand_call */); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
183 |
if (val == noreg) { |
4102
11d514e508d9
6889740: G1: OpenDS fails with "unhandled exception in compiled code"
johnc
parents:
3261
diff
changeset
|
184 |
__ store_heap_oop_null(Address(rdx, 0)); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
185 |
} else { |
16997
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
186 |
// G1 barrier needs uncompressed oop for region cross check. |
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
187 |
Register new_val = val; |
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
188 |
if (UseCompressedOops) { |
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
189 |
new_val = rbx; |
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
190 |
__ movptr(new_val, val); |
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
191 |
} |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
192 |
__ store_heap_oop(Address(rdx, 0), val); |
9176
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
193 |
__ g1_write_barrier_post(rdx /* store_adr */, |
16997
d5dfdf746abd
8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.
johnc
parents:
15482
diff
changeset
|
194 |
new_val /* new_val */, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
195 |
rthread /* thread */, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
196 |
rtmp /* tmp */, |
9176
42d9d1010f38
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
8676
diff
changeset
|
197 |
rbx /* tmp2 */); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
198 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
199 |
NOT_LP64( __ restore_bcp()); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
200 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
201 |
break; |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
14626
diff
changeset
|
202 |
#endif // INCLUDE_ALL_GCS |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
203 |
case BarrierSet::CardTableModRef: |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
204 |
case BarrierSet::CardTableExtension: |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
205 |
{ |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
206 |
if (val == noreg) { |
4102
11d514e508d9
6889740: G1: OpenDS fails with "unhandled exception in compiled code"
johnc
parents:
3261
diff
changeset
|
207 |
__ store_heap_oop_null(obj); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
208 |
} else { |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
209 |
__ store_heap_oop(obj, val); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
210 |
// flatten object address if needed |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
211 |
if (!precise || (obj.index() == noreg && obj.disp() == 0)) { |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
212 |
__ store_check(obj.base()); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
213 |
} else { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
214 |
__ lea(rdx, obj); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
215 |
__ store_check(rdx); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
216 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
217 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
218 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
219 |
break; |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
220 |
case BarrierSet::ModRef: |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
221 |
if (val == noreg) { |
4102
11d514e508d9
6889740: G1: OpenDS fails with "unhandled exception in compiled code"
johnc
parents:
3261
diff
changeset
|
222 |
__ store_heap_oop_null(obj); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
223 |
} else { |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
224 |
__ store_heap_oop(obj, val); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
225 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
226 |
break; |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
227 |
default : |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
228 |
ShouldNotReachHere(); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
229 |
|
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
230 |
} |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
231 |
} |
1 | 232 |
|
233 |
Address TemplateTable::at_bcp(int offset) { |
|
234 |
assert(_desc->uses_bcp(), "inconsistent uses_bcp information"); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
235 |
return Address(rbcp, offset); |
1 | 236 |
} |
237 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
238 |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
239 |
void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg, |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
240 |
Register temp_reg, bool load_bc_into_bc_reg/*=true*/, |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
241 |
int byte_no) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
242 |
if (!RewriteBytecodes) return; |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
243 |
Label L_patch_done; |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
244 |
|
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
245 |
switch (bc) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
246 |
case Bytecodes::_fast_aputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
247 |
case Bytecodes::_fast_bputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
248 |
case Bytecodes::_fast_cputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
249 |
case Bytecodes::_fast_dputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
250 |
case Bytecodes::_fast_fputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
251 |
case Bytecodes::_fast_iputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
252 |
case Bytecodes::_fast_lputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
253 |
case Bytecodes::_fast_sputfield: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
254 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
255 |
// We skip bytecode quickening for putfield instructions when |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
256 |
// the put_code written to the constant pool cache is zero. |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
257 |
// This is required so that every execution of this instruction |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
258 |
// calls out to InterpreterRuntime::resolve_get_put to do |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
259 |
// additional, required work. |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
260 |
assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
261 |
assert(load_bc_into_bc_reg, "we use bc_reg as temp"); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
262 |
__ get_cache_and_index_and_bytecode_at_bcp(temp_reg, bc_reg, temp_reg, byte_no, 1); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
263 |
__ movl(bc_reg, bc); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
264 |
__ cmpl(temp_reg, (int) 0); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
265 |
__ jcc(Assembler::zero, L_patch_done); // don't patch |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
266 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
267 |
break; |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
268 |
default: |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
269 |
assert(byte_no == -1, "sanity"); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
270 |
// the pair bytecodes have already done the load. |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
271 |
if (load_bc_into_bc_reg) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
272 |
__ movl(bc_reg, bc); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
273 |
} |
1 | 274 |
} |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
275 |
|
1 | 276 |
if (JvmtiExport::can_post_breakpoint()) { |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
277 |
Label L_fast_patch; |
1 | 278 |
// if a breakpoint is present we can't rewrite the stream directly |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
279 |
__ movzbl(temp_reg, at_bcp(0)); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
280 |
__ cmpl(temp_reg, Bytecodes::_breakpoint); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
281 |
__ jcc(Assembler::notEqual, L_fast_patch); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
282 |
__ get_method(temp_reg); |
1 | 283 |
// Let breakpoint table handling rewrite to quicker bytecode |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
284 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), temp_reg, rbcp, bc_reg); |
1 | 285 |
#ifndef ASSERT |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
286 |
__ jmpb(L_patch_done); |
4478 | 287 |
#else |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
288 |
__ jmp(L_patch_done); |
4478 | 289 |
#endif |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
290 |
__ bind(L_fast_patch); |
1 | 291 |
} |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
292 |
|
4478 | 293 |
#ifdef ASSERT |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
294 |
Label L_okay; |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
295 |
__ load_unsigned_byte(temp_reg, at_bcp(0)); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
296 |
__ cmpl(temp_reg, (int) Bytecodes::java_code(bc)); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
297 |
__ jcc(Assembler::equal, L_okay); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
298 |
__ cmpl(temp_reg, bc_reg); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
299 |
__ jcc(Assembler::equal, L_okay); |
1 | 300 |
__ stop("patching the wrong bytecode"); |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
301 |
__ bind(L_okay); |
1 | 302 |
#endif |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
303 |
|
1 | 304 |
// patch bytecode |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
305 |
__ movb(at_bcp(0), bc_reg); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
306 |
__ bind(L_patch_done); |
1 | 307 |
} |
308 |
// Individual instructions |
|
309 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
310 |
|
1 | 311 |
void TemplateTable::nop() { |
312 |
transition(vtos, vtos); |
|
313 |
// nothing to do |
|
314 |
} |
|
315 |
||
316 |
void TemplateTable::shouldnotreachhere() { |
|
317 |
transition(vtos, vtos); |
|
318 |
__ stop("shouldnotreachhere bytecode"); |
|
319 |
} |
|
320 |
||
321 |
void TemplateTable::aconst_null() { |
|
322 |
transition(vtos, atos); |
|
323 |
__ xorl(rax, rax); |
|
324 |
} |
|
325 |
||
326 |
void TemplateTable::iconst(int value) { |
|
327 |
transition(vtos, itos); |
|
328 |
if (value == 0) { |
|
329 |
__ xorl(rax, rax); |
|
330 |
} else { |
|
331 |
__ movl(rax, value); |
|
332 |
} |
|
333 |
} |
|
334 |
||
335 |
void TemplateTable::lconst(int value) { |
|
336 |
transition(vtos, ltos); |
|
337 |
if (value == 0) { |
|
338 |
__ xorl(rax, rax); |
|
339 |
} else { |
|
340 |
__ movl(rax, value); |
|
341 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
342 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
343 |
assert(value >= 0, "check this code"); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
344 |
__ xorptr(rdx, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
345 |
#endif |
1 | 346 |
} |
347 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
348 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
349 |
|
1 | 350 |
void TemplateTable::fconst(int value) { |
351 |
transition(vtos, ftos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
352 |
#ifdef _LP64 |
1 | 353 |
static float one = 1.0f, two = 2.0f; |
354 |
switch (value) { |
|
355 |
case 0: |
|
356 |
__ xorps(xmm0, xmm0); |
|
357 |
break; |
|
358 |
case 1: |
|
359 |
__ movflt(xmm0, ExternalAddress((address) &one)); |
|
360 |
break; |
|
361 |
case 2: |
|
362 |
__ movflt(xmm0, ExternalAddress((address) &two)); |
|
363 |
break; |
|
364 |
default: |
|
365 |
ShouldNotReachHere(); |
|
366 |
break; |
|
367 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
368 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
369 |
if (value == 0) { __ fldz(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
370 |
} else if (value == 1) { __ fld1(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
371 |
} else if (value == 2) { __ fld1(); __ fld1(); __ faddp(); // should do a better solution here |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
372 |
} else { ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
373 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
374 |
#endif |
1 | 375 |
} |
376 |
||
377 |
void TemplateTable::dconst(int value) { |
|
378 |
transition(vtos, dtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
379 |
#ifdef _LP64 |
1 | 380 |
static double one = 1.0; |
381 |
switch (value) { |
|
382 |
case 0: |
|
383 |
__ xorpd(xmm0, xmm0); |
|
384 |
break; |
|
385 |
case 1: |
|
386 |
__ movdbl(xmm0, ExternalAddress((address) &one)); |
|
387 |
break; |
|
388 |
default: |
|
389 |
ShouldNotReachHere(); |
|
390 |
break; |
|
391 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
392 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
393 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
394 |
if (value == 0) { __ fldz(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
395 |
} else if (value == 1) { __ fld1(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
396 |
} else { ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
397 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
398 |
#endif |
1 | 399 |
} |
400 |
||
401 |
void TemplateTable::bipush() { |
|
402 |
transition(vtos, itos); |
|
403 |
__ load_signed_byte(rax, at_bcp(1)); |
|
404 |
} |
|
405 |
||
406 |
void TemplateTable::sipush() { |
|
407 |
transition(vtos, itos); |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
408 |
__ load_unsigned_short(rax, at_bcp(1)); |
1 | 409 |
__ bswapl(rax); |
410 |
__ sarl(rax, 16); |
|
411 |
} |
|
412 |
||
413 |
void TemplateTable::ldc(bool wide) { |
|
414 |
transition(vtos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
415 |
Register rarg = NOT_LP64(rcx) LP64_ONLY(c_rarg1); |
1 | 416 |
Label call_ldc, notFloat, notClass, Done; |
417 |
||
418 |
if (wide) { |
|
419 |
__ get_unsigned_2_byte_index_at_bcp(rbx, 1); |
|
420 |
} else { |
|
421 |
__ load_unsigned_byte(rbx, at_bcp(1)); |
|
422 |
} |
|
423 |
||
424 |
__ get_cpool_and_tags(rcx, rax); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
425 |
const int base_offset = ConstantPool::header_size() * wordSize; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
426 |
const int tags_offset = Array<u1>::base_offset_in_bytes(); |
1 | 427 |
|
428 |
// get type |
|
429 |
__ movzbl(rdx, Address(rax, rbx, Address::times_1, tags_offset)); |
|
430 |
||
431 |
// unresolved class - get the resolved class |
|
432 |
__ cmpl(rdx, JVM_CONSTANT_UnresolvedClass); |
|
433 |
__ jccb(Assembler::equal, call_ldc); |
|
434 |
||
435 |
// unresolved class in error state - call into runtime to throw the error |
|
436 |
// from the first resolution attempt |
|
437 |
__ cmpl(rdx, JVM_CONSTANT_UnresolvedClassInError); |
|
438 |
__ jccb(Assembler::equal, call_ldc); |
|
439 |
||
440 |
// resolved class - need to call vm to get java mirror of the class |
|
441 |
__ cmpl(rdx, JVM_CONSTANT_Class); |
|
442 |
__ jcc(Assembler::notEqual, notClass); |
|
443 |
||
444 |
__ bind(call_ldc); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
445 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
446 |
__ movl(rarg, wide); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
447 |
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::ldc), rarg); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
448 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
449 |
__ push(atos); |
1 | 450 |
__ jmp(Done); |
451 |
||
452 |
__ bind(notClass); |
|
453 |
__ cmpl(rdx, JVM_CONSTANT_Float); |
|
454 |
__ jccb(Assembler::notEqual, notFloat); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
455 |
|
1 | 456 |
// ftos |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
457 |
LP64_ONLY(__ movflt(xmm0, Address(rcx, rbx, Address::times_8, base_offset))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
458 |
NOT_LP64(__ fld_s( Address(rcx, rbx, Address::times_ptr, base_offset))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
459 |
__ push(ftos); |
1 | 460 |
__ jmp(Done); |
461 |
||
462 |
__ bind(notFloat); |
|
463 |
#ifdef ASSERT |
|
464 |
{ |
|
465 |
Label L; |
|
466 |
__ cmpl(rdx, JVM_CONSTANT_Integer); |
|
467 |
__ jcc(Assembler::equal, L); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
468 |
// String and Object are rewritten to fast_aldc |
1 | 469 |
__ stop("unexpected tag type in ldc"); |
470 |
__ bind(L); |
|
471 |
} |
|
472 |
#endif |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
473 |
// itos JVM_CONSTANT_Integer only |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
474 |
__ movl(rax, Address(rcx, rbx, Address::times_ptr, base_offset)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
475 |
__ push(itos); |
1 | 476 |
__ bind(Done); |
477 |
} |
|
478 |
||
5882 | 479 |
// Fast path for caching oop constants. |
480 |
void TemplateTable::fast_aldc(bool wide) { |
|
481 |
transition(vtos, atos); |
|
482 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
483 |
Register result = rax; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
484 |
Register tmp = rdx; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
485 |
int index_size = wide ? sizeof(u2) : sizeof(u1); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
486 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
487 |
Label resolved; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
488 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
489 |
// We are resolved if the resolved reference cache entry contains a |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
490 |
// non-null object (String, MethodType, etc.) |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
491 |
assert_different_registers(result, tmp); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
492 |
__ get_cache_index_at_bcp(tmp, 1, index_size); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
493 |
__ load_resolved_reference_at_index(result, tmp); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
494 |
__ testl(result, result); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
495 |
__ jcc(Assembler::notZero, resolved); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
496 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
497 |
address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
498 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
499 |
// first time invocation - must resolve first |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
500 |
__ movl(tmp, (int)bytecode()); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
501 |
__ call_VM(result, entry, tmp); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
502 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
503 |
__ bind(resolved); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
504 |
|
5882 | 505 |
if (VerifyOops) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
506 |
__ verify_oop(result); |
5882 | 507 |
} |
508 |
} |
|
509 |
||
1 | 510 |
void TemplateTable::ldc2_w() { |
511 |
transition(vtos, vtos); |
|
512 |
Label Long, Done; |
|
513 |
__ get_unsigned_2_byte_index_at_bcp(rbx, 1); |
|
514 |
||
515 |
__ get_cpool_and_tags(rcx, rax); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
516 |
const int base_offset = ConstantPool::header_size() * wordSize; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
517 |
const int tags_offset = Array<u1>::base_offset_in_bytes(); |
1 | 518 |
|
519 |
// get type |
|
520 |
__ cmpb(Address(rax, rbx, Address::times_1, tags_offset), |
|
521 |
JVM_CONSTANT_Double); |
|
522 |
__ jccb(Assembler::notEqual, Long); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
523 |
|
1 | 524 |
// dtos |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
525 |
LP64_ONLY(__ movdbl(xmm0, Address(rcx, rbx, Address::times_8, base_offset))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
526 |
NOT_LP64(__ fld_d( Address(rcx, rbx, Address::times_ptr, base_offset))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
527 |
__ push(dtos); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
528 |
|
1 | 529 |
__ jmpb(Done); |
530 |
__ bind(Long); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
531 |
|
1 | 532 |
// ltos |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
533 |
__ movptr(rax, Address(rcx, rbx, Address::times_ptr, base_offset + 0 * wordSize)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
534 |
NOT_LP64(__ movptr(rdx, Address(rcx, rbx, Address::times_ptr, base_offset + 1 * wordSize))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
535 |
__ push(ltos); |
1 | 536 |
|
537 |
__ bind(Done); |
|
538 |
} |
|
539 |
||
540 |
void TemplateTable::locals_index(Register reg, int offset) { |
|
541 |
__ load_unsigned_byte(reg, at_bcp(offset)); |
|
1066 | 542 |
__ negptr(reg); |
1 | 543 |
} |
544 |
||
545 |
void TemplateTable::iload() { |
|
546 |
transition(vtos, itos); |
|
547 |
if (RewriteFrequentPairs) { |
|
548 |
Label rewrite, done; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
549 |
const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
550 |
LP64_ONLY(assert(rbx != bc, "register damaged")); |
1 | 551 |
|
552 |
// get next byte |
|
553 |
__ load_unsigned_byte(rbx, |
|
554 |
at_bcp(Bytecodes::length_for(Bytecodes::_iload))); |
|
555 |
// if _iload, wait to rewrite to iload2. We only want to rewrite the |
|
556 |
// last two iloads in a pair. Comparing against fast_iload means that |
|
557 |
// the next bytecode is neither an iload or a caload, and therefore |
|
558 |
// an iload pair. |
|
559 |
__ cmpl(rbx, Bytecodes::_iload); |
|
560 |
__ jcc(Assembler::equal, done); |
|
561 |
||
562 |
__ cmpl(rbx, Bytecodes::_fast_iload); |
|
563 |
__ movl(bc, Bytecodes::_fast_iload2); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
564 |
|
1 | 565 |
__ jccb(Assembler::equal, rewrite); |
566 |
||
567 |
// if _caload, rewrite to fast_icaload |
|
568 |
__ cmpl(rbx, Bytecodes::_caload); |
|
569 |
__ movl(bc, Bytecodes::_fast_icaload); |
|
570 |
__ jccb(Assembler::equal, rewrite); |
|
571 |
||
572 |
// rewrite so iload doesn't check again. |
|
573 |
__ movl(bc, Bytecodes::_fast_iload); |
|
574 |
||
575 |
// rewrite |
|
576 |
// bc: fast bytecode |
|
577 |
__ bind(rewrite); |
|
578 |
patch_bytecode(Bytecodes::_iload, bc, rbx, false); |
|
579 |
__ bind(done); |
|
580 |
} |
|
581 |
||
582 |
// Get the local value into tos |
|
583 |
locals_index(rbx); |
|
584 |
__ movl(rax, iaddress(rbx)); |
|
585 |
} |
|
586 |
||
587 |
void TemplateTable::fast_iload2() { |
|
588 |
transition(vtos, itos); |
|
589 |
locals_index(rbx); |
|
590 |
__ movl(rax, iaddress(rbx)); |
|
591 |
__ push(itos); |
|
592 |
locals_index(rbx, 3); |
|
593 |
__ movl(rax, iaddress(rbx)); |
|
594 |
} |
|
595 |
||
596 |
void TemplateTable::fast_iload() { |
|
597 |
transition(vtos, itos); |
|
598 |
locals_index(rbx); |
|
599 |
__ movl(rax, iaddress(rbx)); |
|
600 |
} |
|
601 |
||
602 |
void TemplateTable::lload() { |
|
603 |
transition(vtos, ltos); |
|
604 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
605 |
__ movptr(rax, laddress(rbx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
606 |
NOT_LP64(__ movl(rdx, haddress(rbx))); |
1 | 607 |
} |
608 |
||
609 |
void TemplateTable::fload() { |
|
610 |
transition(vtos, ftos); |
|
611 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
612 |
LP64_ONLY(__ movflt(xmm0, faddress(rbx))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
613 |
NOT_LP64(__ fld_s(faddress(rbx))); |
1 | 614 |
} |
615 |
||
616 |
void TemplateTable::dload() { |
|
617 |
transition(vtos, dtos); |
|
618 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
619 |
LP64_ONLY(__ movdbl(xmm0, daddress(rbx))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
620 |
NOT_LP64(__ fld_d(daddress(rbx))); |
1 | 621 |
} |
622 |
||
623 |
void TemplateTable::aload() { |
|
624 |
transition(vtos, atos); |
|
625 |
locals_index(rbx); |
|
1066 | 626 |
__ movptr(rax, aaddress(rbx)); |
1 | 627 |
} |
628 |
||
629 |
void TemplateTable::locals_index_wide(Register reg) { |
|
21515
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
630 |
__ load_unsigned_short(reg, at_bcp(2)); |
1 | 631 |
__ bswapl(reg); |
632 |
__ shrl(reg, 16); |
|
1066 | 633 |
__ negptr(reg); |
1 | 634 |
} |
635 |
||
636 |
void TemplateTable::wide_iload() { |
|
637 |
transition(vtos, itos); |
|
638 |
locals_index_wide(rbx); |
|
639 |
__ movl(rax, iaddress(rbx)); |
|
640 |
} |
|
641 |
||
642 |
void TemplateTable::wide_lload() { |
|
643 |
transition(vtos, ltos); |
|
644 |
locals_index_wide(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
645 |
__ movptr(rax, laddress(rbx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
646 |
NOT_LP64(__ movl(rdx, haddress(rbx))); |
1 | 647 |
} |
648 |
||
649 |
void TemplateTable::wide_fload() { |
|
650 |
transition(vtos, ftos); |
|
651 |
locals_index_wide(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
652 |
LP64_ONLY(__ movflt(xmm0, faddress(rbx))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
653 |
NOT_LP64(__ fld_s(faddress(rbx))); |
1 | 654 |
} |
655 |
||
656 |
void TemplateTable::wide_dload() { |
|
657 |
transition(vtos, dtos); |
|
658 |
locals_index_wide(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
659 |
LP64_ONLY(__ movdbl(xmm0, daddress(rbx))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
660 |
NOT_LP64(__ fld_d(daddress(rbx))); |
1 | 661 |
} |
662 |
||
663 |
void TemplateTable::wide_aload() { |
|
664 |
transition(vtos, atos); |
|
665 |
locals_index_wide(rbx); |
|
1066 | 666 |
__ movptr(rax, aaddress(rbx)); |
1 | 667 |
} |
668 |
||
669 |
void TemplateTable::index_check(Register array, Register index) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
670 |
// Pop ptr into array |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
671 |
__ pop_ptr(array); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
672 |
index_check_without_pop(array, index); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
673 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
674 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
675 |
void TemplateTable::index_check_without_pop(Register array, Register index) { |
1 | 676 |
// destroys rbx |
677 |
// check array |
|
678 |
__ null_check(array, arrayOopDesc::length_offset_in_bytes()); |
|
679 |
// sign extend index for use by indexed load |
|
1066 | 680 |
__ movl2ptr(index, index); |
1 | 681 |
// check index |
682 |
__ cmpl(index, Address(array, arrayOopDesc::length_offset_in_bytes())); |
|
683 |
if (index != rbx) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
684 |
// ??? convention: move aberrant index into rbx for exception message |
1 | 685 |
assert(rbx != array, "different registers"); |
686 |
__ movl(rbx, index); |
|
687 |
} |
|
688 |
__ jump_cc(Assembler::aboveEqual, |
|
689 |
ExternalAddress(Interpreter::_throw_ArrayIndexOutOfBoundsException_entry)); |
|
690 |
} |
|
691 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
692 |
|
1 | 693 |
void TemplateTable::iaload() { |
694 |
transition(itos, itos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
695 |
// rax: index |
1 | 696 |
// rdx: array |
697 |
index_check(rdx, rax); // kills rbx |
|
698 |
__ movl(rax, Address(rdx, rax, |
|
699 |
Address::times_4, |
|
700 |
arrayOopDesc::base_offset_in_bytes(T_INT))); |
|
701 |
} |
|
702 |
||
703 |
void TemplateTable::laload() { |
|
704 |
transition(itos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
705 |
// rax: index |
1 | 706 |
// rdx: array |
707 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
708 |
NOT_LP64(__ mov(rbx, rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
709 |
// rbx,: index |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
710 |
__ movptr(rax, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 0 * wordSize)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
711 |
NOT_LP64(__ movl(rdx, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 1 * wordSize))); |
1 | 712 |
} |
713 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
714 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
715 |
|
1 | 716 |
void TemplateTable::faload() { |
717 |
transition(itos, ftos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
718 |
// rax: index |
1 | 719 |
// rdx: array |
720 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
721 |
LP64_ONLY(__ movflt(xmm0, Address(rdx, rax, |
1 | 722 |
Address::times_4, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
723 |
arrayOopDesc::base_offset_in_bytes(T_FLOAT)))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
724 |
NOT_LP64(__ fld_s(Address(rdx, rax, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)))); |
1 | 725 |
} |
726 |
||
727 |
void TemplateTable::daload() { |
|
728 |
transition(itos, dtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
729 |
// rax: index |
1 | 730 |
// rdx: array |
731 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
732 |
LP64_ONLY(__ movdbl(xmm0, Address(rdx, rax, |
1 | 733 |
Address::times_8, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
734 |
arrayOopDesc::base_offset_in_bytes(T_DOUBLE)))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
735 |
NOT_LP64(__ fld_d(Address(rdx, rax, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)))); |
1 | 736 |
} |
737 |
||
738 |
void TemplateTable::aaload() { |
|
739 |
transition(itos, atos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
740 |
// rax: index |
1 | 741 |
// rdx: array |
742 |
index_check(rdx, rax); // kills rbx |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
743 |
__ load_heap_oop(rax, Address(rdx, rax, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
744 |
UseCompressedOops ? Address::times_4 : Address::times_ptr, |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
745 |
arrayOopDesc::base_offset_in_bytes(T_OBJECT))); |
1 | 746 |
} |
747 |
||
748 |
void TemplateTable::baload() { |
|
749 |
transition(itos, itos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
750 |
// rax: index |
1 | 751 |
// rdx: array |
752 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
753 |
__ load_signed_byte(rax, Address(rdx, rax, Address::times_1, arrayOopDesc::base_offset_in_bytes(T_BYTE))); |
1 | 754 |
} |
755 |
||
756 |
void TemplateTable::caload() { |
|
757 |
transition(itos, itos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
758 |
// rax: index |
1 | 759 |
// rdx: array |
760 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
761 |
__ load_unsigned_short(rax, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
1 | 762 |
} |
763 |
||
764 |
// iload followed by caload frequent pair |
|
765 |
void TemplateTable::fast_icaload() { |
|
766 |
transition(vtos, itos); |
|
767 |
// load index out of locals |
|
768 |
locals_index(rbx); |
|
769 |
__ movl(rax, iaddress(rbx)); |
|
770 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
771 |
// rax: index |
1 | 772 |
// rdx: array |
773 |
index_check(rdx, rax); // kills rbx |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
774 |
__ load_unsigned_short(rax, |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
775 |
Address(rdx, rax, |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
776 |
Address::times_2, |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
777 |
arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
1 | 778 |
} |
779 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
780 |
|
1 | 781 |
void TemplateTable::saload() { |
782 |
transition(itos, itos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
783 |
// rax: index |
1 | 784 |
// rdx: array |
785 |
index_check(rdx, rax); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
786 |
__ load_signed_short(rax, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_SHORT))); |
1 | 787 |
} |
788 |
||
789 |
void TemplateTable::iload(int n) { |
|
790 |
transition(vtos, itos); |
|
791 |
__ movl(rax, iaddress(n)); |
|
792 |
} |
|
793 |
||
794 |
void TemplateTable::lload(int n) { |
|
795 |
transition(vtos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
796 |
__ movptr(rax, laddress(n)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
797 |
NOT_LP64(__ movptr(rdx, haddress(n))); |
1 | 798 |
} |
799 |
||
800 |
void TemplateTable::fload(int n) { |
|
801 |
transition(vtos, ftos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
802 |
LP64_ONLY(__ movflt(xmm0, faddress(n))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
803 |
NOT_LP64(__ fld_s(faddress(n))); |
1 | 804 |
} |
805 |
||
806 |
void TemplateTable::dload(int n) { |
|
807 |
transition(vtos, dtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
808 |
LP64_ONLY(__ movdbl(xmm0, daddress(n))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
809 |
NOT_LP64(__ fld_d(daddress(n))); |
1 | 810 |
} |
811 |
||
812 |
void TemplateTable::aload(int n) { |
|
813 |
transition(vtos, atos); |
|
1066 | 814 |
__ movptr(rax, aaddress(n)); |
1 | 815 |
} |
816 |
||
817 |
void TemplateTable::aload_0() { |
|
818 |
transition(vtos, atos); |
|
819 |
// According to bytecode histograms, the pairs: |
|
820 |
// |
|
821 |
// _aload_0, _fast_igetfield |
|
822 |
// _aload_0, _fast_agetfield |
|
823 |
// _aload_0, _fast_fgetfield |
|
824 |
// |
|
825 |
// occur frequently. If RewriteFrequentPairs is set, the (slow) |
|
826 |
// _aload_0 bytecode checks if the next bytecode is either |
|
827 |
// _fast_igetfield, _fast_agetfield or _fast_fgetfield and then |
|
828 |
// rewrites the current bytecode into a pair bytecode; otherwise it |
|
829 |
// rewrites the current bytecode into _fast_aload_0 that doesn't do |
|
830 |
// the pair check anymore. |
|
831 |
// |
|
832 |
// Note: If the next bytecode is _getfield, the rewrite must be |
|
833 |
// delayed, otherwise we may miss an opportunity for a pair. |
|
834 |
// |
|
835 |
// Also rewrite frequent pairs |
|
836 |
// aload_0, aload_1 |
|
837 |
// aload_0, iload_1 |
|
838 |
// These bytecodes with a small amount of code are most profitable |
|
839 |
// to rewrite |
|
840 |
if (RewriteFrequentPairs) { |
|
841 |
Label rewrite, done; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
842 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
843 |
const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
844 |
LP64_ONLY(assert(rbx != bc, "register damaged")); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
845 |
|
1 | 846 |
// get next byte |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
847 |
__ load_unsigned_byte(rbx, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0))); |
1 | 848 |
|
849 |
// do actual aload_0 |
|
850 |
aload(0); |
|
851 |
||
852 |
// if _getfield then wait with rewrite |
|
853 |
__ cmpl(rbx, Bytecodes::_getfield); |
|
854 |
__ jcc(Assembler::equal, done); |
|
855 |
||
856 |
// if _igetfield then reqrite to _fast_iaccess_0 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
857 |
assert(Bytecodes::java_code(Bytecodes::_fast_iaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); |
1 | 858 |
__ cmpl(rbx, Bytecodes::_fast_igetfield); |
859 |
__ movl(bc, Bytecodes::_fast_iaccess_0); |
|
860 |
__ jccb(Assembler::equal, rewrite); |
|
861 |
||
862 |
// if _agetfield then reqrite to _fast_aaccess_0 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
863 |
assert(Bytecodes::java_code(Bytecodes::_fast_aaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); |
1 | 864 |
__ cmpl(rbx, Bytecodes::_fast_agetfield); |
865 |
__ movl(bc, Bytecodes::_fast_aaccess_0); |
|
866 |
__ jccb(Assembler::equal, rewrite); |
|
867 |
||
868 |
// if _fgetfield then reqrite to _fast_faccess_0 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
869 |
assert(Bytecodes::java_code(Bytecodes::_fast_faccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); |
1 | 870 |
__ cmpl(rbx, Bytecodes::_fast_fgetfield); |
871 |
__ movl(bc, Bytecodes::_fast_faccess_0); |
|
872 |
__ jccb(Assembler::equal, rewrite); |
|
873 |
||
874 |
// else rewrite to _fast_aload0 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
875 |
assert(Bytecodes::java_code(Bytecodes::_fast_aload_0) == Bytecodes::_aload_0, "fix bytecode definition"); |
1 | 876 |
__ movl(bc, Bytecodes::_fast_aload_0); |
877 |
||
878 |
// rewrite |
|
879 |
// bc: fast bytecode |
|
880 |
__ bind(rewrite); |
|
881 |
patch_bytecode(Bytecodes::_aload_0, bc, rbx, false); |
|
882 |
||
883 |
__ bind(done); |
|
884 |
} else { |
|
885 |
aload(0); |
|
886 |
} |
|
887 |
} |
|
888 |
||
889 |
void TemplateTable::istore() { |
|
890 |
transition(itos, vtos); |
|
891 |
locals_index(rbx); |
|
892 |
__ movl(iaddress(rbx), rax); |
|
893 |
} |
|
894 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
895 |
|
1 | 896 |
void TemplateTable::lstore() { |
897 |
transition(ltos, vtos); |
|
898 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
899 |
__ movptr(laddress(rbx), rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
900 |
NOT_LP64(__ movptr(haddress(rbx), rdx)); |
1 | 901 |
} |
902 |
||
903 |
void TemplateTable::fstore() { |
|
904 |
transition(ftos, vtos); |
|
905 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
906 |
LP64_ONLY(__ movflt(faddress(rbx), xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
907 |
NOT_LP64(__ fstp_s(faddress(rbx))); |
1 | 908 |
} |
909 |
||
910 |
void TemplateTable::dstore() { |
|
911 |
transition(dtos, vtos); |
|
912 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
913 |
LP64_ONLY(__ movdbl(daddress(rbx), xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
914 |
NOT_LP64(__ fstp_d(daddress(rbx))); |
1 | 915 |
} |
916 |
||
917 |
void TemplateTable::astore() { |
|
918 |
transition(vtos, vtos); |
|
5419 | 919 |
__ pop_ptr(rax); |
1 | 920 |
locals_index(rbx); |
1066 | 921 |
__ movptr(aaddress(rbx), rax); |
1 | 922 |
} |
923 |
||
924 |
void TemplateTable::wide_istore() { |
|
925 |
transition(vtos, vtos); |
|
926 |
__ pop_i(); |
|
927 |
locals_index_wide(rbx); |
|
928 |
__ movl(iaddress(rbx), rax); |
|
929 |
} |
|
930 |
||
931 |
void TemplateTable::wide_lstore() { |
|
932 |
transition(vtos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
933 |
NOT_LP64(__ pop_l(rax, rdx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
934 |
LP64_ONLY(__ pop_l()); |
1 | 935 |
locals_index_wide(rbx); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
936 |
__ movptr(laddress(rbx), rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
937 |
NOT_LP64(__ movl(haddress(rbx), rdx)); |
1 | 938 |
} |
939 |
||
940 |
void TemplateTable::wide_fstore() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
941 |
#ifdef _LP64 |
1 | 942 |
transition(vtos, vtos); |
943 |
__ pop_f(); |
|
944 |
locals_index_wide(rbx); |
|
945 |
__ movflt(faddress(rbx), xmm0); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
946 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
947 |
wide_istore(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
948 |
#endif |
1 | 949 |
} |
950 |
||
951 |
void TemplateTable::wide_dstore() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
952 |
#ifdef _LP64 |
1 | 953 |
transition(vtos, vtos); |
954 |
__ pop_d(); |
|
955 |
locals_index_wide(rbx); |
|
956 |
__ movdbl(daddress(rbx), xmm0); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
957 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
958 |
wide_lstore(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
959 |
#endif |
1 | 960 |
} |
961 |
||
962 |
void TemplateTable::wide_astore() { |
|
963 |
transition(vtos, vtos); |
|
5419 | 964 |
__ pop_ptr(rax); |
1 | 965 |
locals_index_wide(rbx); |
1066 | 966 |
__ movptr(aaddress(rbx), rax); |
1 | 967 |
} |
968 |
||
969 |
void TemplateTable::iastore() { |
|
970 |
transition(itos, vtos); |
|
971 |
__ pop_i(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
972 |
// rax: value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
973 |
// rbx: index |
1 | 974 |
// rdx: array |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
975 |
index_check(rdx, rbx); // prefer index in rbx |
1 | 976 |
__ movl(Address(rdx, rbx, |
977 |
Address::times_4, |
|
978 |
arrayOopDesc::base_offset_in_bytes(T_INT)), |
|
979 |
rax); |
|
980 |
} |
|
981 |
||
982 |
void TemplateTable::lastore() { |
|
983 |
transition(ltos, vtos); |
|
984 |
__ pop_i(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
985 |
// rax,: low(value) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
986 |
// rcx: array |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
987 |
// rdx: high(value) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
988 |
index_check(rcx, rbx); // prefer index in rbx, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
989 |
// rbx,: index |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
990 |
__ movptr(Address(rcx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 0 * wordSize), rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
991 |
NOT_LP64(__ movl(Address(rcx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG) + 1 * wordSize), rdx)); |
1 | 992 |
} |
993 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
994 |
|
1 | 995 |
void TemplateTable::fastore() { |
996 |
transition(ftos, vtos); |
|
997 |
__ pop_i(rbx); |
|
998 |
// xmm0: value |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
999 |
// rbx: index |
1 | 1000 |
// rdx: array |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1001 |
index_check(rdx, rbx); // prefer index in rbx |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1002 |
LP64_ONLY(__ movflt(Address(rdx, rbx, |
1 | 1003 |
Address::times_4, |
1004 |
arrayOopDesc::base_offset_in_bytes(T_FLOAT)), |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1005 |
xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1006 |
NOT_LP64(__ fstp_s(Address(rdx, rbx, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)))); |
1 | 1007 |
} |
1008 |
||
1009 |
void TemplateTable::dastore() { |
|
1010 |
transition(dtos, vtos); |
|
1011 |
__ pop_i(rbx); |
|
1012 |
// xmm0: value |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1013 |
// rbx: index |
1 | 1014 |
// rdx: array |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1015 |
index_check(rdx, rbx); // prefer index in rbx |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1016 |
LP64_ONLY(__ movdbl(Address(rdx, rbx, |
1 | 1017 |
Address::times_8, |
1018 |
arrayOopDesc::base_offset_in_bytes(T_DOUBLE)), |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1019 |
xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1020 |
NOT_LP64(__ fstp_d(Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)))); |
1 | 1021 |
} |
1022 |
||
1023 |
void TemplateTable::aastore() { |
|
1024 |
Label is_null, ok_is_subtype, done; |
|
1025 |
transition(vtos, vtos); |
|
1026 |
// stack: ..., array, index, value |
|
1066 | 1027 |
__ movptr(rax, at_tos()); // value |
1 | 1028 |
__ movl(rcx, at_tos_p1()); // index |
1066 | 1029 |
__ movptr(rdx, at_tos_p2()); // array |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1030 |
|
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1031 |
Address element_address(rdx, rcx, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1032 |
UseCompressedOops? Address::times_4 : Address::times_ptr, |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1033 |
arrayOopDesc::base_offset_in_bytes(T_OBJECT)); |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1034 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1035 |
index_check_without_pop(rdx, rcx); // kills rbx |
1066 | 1036 |
__ testptr(rax, rax); |
1 | 1037 |
__ jcc(Assembler::zero, is_null); |
1038 |
||
1039 |
// Move subklass into rbx |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
1040 |
__ load_klass(rbx, rax); |
1 | 1041 |
// Move superklass into rax |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
1042 |
__ load_klass(rax, rdx); |
1066 | 1043 |
__ movptr(rax, Address(rax, |
13952
e3cf184080bc
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
13743
diff
changeset
|
1044 |
ObjArrayKlass::element_klass_offset())); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
1045 |
// Compress array + index*oopSize + 12 into a single register. Frees rcx. |
1394 | 1046 |
__ lea(rdx, element_address); |
1 | 1047 |
|
1048 |
// Generate subtype check. Blows rcx, rdi |
|
1049 |
// Superklass in rax. Subklass in rbx. |
|
1050 |
__ gen_subtype_check(rbx, ok_is_subtype); |
|
1051 |
||
1052 |
// Come here on failure |
|
1053 |
// object is at TOS |
|
1054 |
__ jump(ExternalAddress(Interpreter::_throw_ArrayStoreException_entry)); |
|
1055 |
||
1056 |
// Come here on success |
|
1057 |
__ bind(ok_is_subtype); |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1058 |
|
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1059 |
// Get the value we will store |
1394 | 1060 |
__ movptr(rax, at_tos()); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1061 |
// Now store using the appropriate barrier |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1062 |
do_oop_store(_masm, Address(rdx, 0), rax, _bs->kind(), true); |
1 | 1063 |
__ jmp(done); |
1064 |
||
1065 |
// Have a NULL in rax, rdx=array, ecx=index. Store NULL at ary[idx] |
|
1066 |
__ bind(is_null); |
|
1067 |
__ profile_null_seen(rbx); |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1068 |
|
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1069 |
// Store a NULL |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
1070 |
do_oop_store(_masm, element_address, noreg, _bs->kind(), true); |
1 | 1071 |
|
1072 |
// Pop stack arguments |
|
1073 |
__ bind(done); |
|
5419 | 1074 |
__ addptr(rsp, 3 * Interpreter::stackElementSize); |
1 | 1075 |
} |
1076 |
||
1077 |
void TemplateTable::bastore() { |
|
1078 |
transition(itos, vtos); |
|
1079 |
__ pop_i(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1080 |
// rax: value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1081 |
// rbx: index |
1 | 1082 |
// rdx: array |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1083 |
index_check(rdx, rbx); // prefer index in rbx |
1 | 1084 |
__ movb(Address(rdx, rbx, |
1085 |
Address::times_1, |
|
1086 |
arrayOopDesc::base_offset_in_bytes(T_BYTE)), |
|
1087 |
rax); |
|
1088 |
} |
|
1089 |
||
1090 |
void TemplateTable::castore() { |
|
1091 |
transition(itos, vtos); |
|
1092 |
__ pop_i(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1093 |
// rax: value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1094 |
// rbx: index |
1 | 1095 |
// rdx: array |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1096 |
index_check(rdx, rbx); // prefer index in rbx |
1 | 1097 |
__ movw(Address(rdx, rbx, |
1098 |
Address::times_2, |
|
1099 |
arrayOopDesc::base_offset_in_bytes(T_CHAR)), |
|
1100 |
rax); |
|
1101 |
} |
|
1102 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1103 |
|
1 | 1104 |
void TemplateTable::sastore() { |
1105 |
castore(); |
|
1106 |
} |
|
1107 |
||
1108 |
void TemplateTable::istore(int n) { |
|
1109 |
transition(itos, vtos); |
|
1110 |
__ movl(iaddress(n), rax); |
|
1111 |
} |
|
1112 |
||
1113 |
void TemplateTable::lstore(int n) { |
|
1114 |
transition(ltos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1115 |
__ movptr(laddress(n), rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1116 |
NOT_LP64(__ movptr(haddress(n), rdx)); |
1 | 1117 |
} |
1118 |
||
1119 |
void TemplateTable::fstore(int n) { |
|
1120 |
transition(ftos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1121 |
LP64_ONLY(__ movflt(faddress(n), xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1122 |
NOT_LP64(__ fstp_s(faddress(n))); |
1 | 1123 |
} |
1124 |
||
1125 |
void TemplateTable::dstore(int n) { |
|
1126 |
transition(dtos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1127 |
LP64_ONLY(__ movdbl(daddress(n), xmm0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1128 |
NOT_LP64(__ fstp_d(daddress(n))); |
1 | 1129 |
} |
1130 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1131 |
|
1 | 1132 |
void TemplateTable::astore(int n) { |
1133 |
transition(vtos, vtos); |
|
5419 | 1134 |
__ pop_ptr(rax); |
1066 | 1135 |
__ movptr(aaddress(n), rax); |
1 | 1136 |
} |
1137 |
||
1138 |
void TemplateTable::pop() { |
|
1139 |
transition(vtos, vtos); |
|
5419 | 1140 |
__ addptr(rsp, Interpreter::stackElementSize); |
1 | 1141 |
} |
1142 |
||
1143 |
void TemplateTable::pop2() { |
|
1144 |
transition(vtos, vtos); |
|
5419 | 1145 |
__ addptr(rsp, 2 * Interpreter::stackElementSize); |
1 | 1146 |
} |
1147 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1148 |
|
1 | 1149 |
void TemplateTable::dup() { |
1150 |
transition(vtos, vtos); |
|
5419 | 1151 |
__ load_ptr(0, rax); |
1152 |
__ push_ptr(rax); |
|
1 | 1153 |
// stack: ..., a, a |
1154 |
} |
|
1155 |
||
1156 |
void TemplateTable::dup_x1() { |
|
1157 |
transition(vtos, vtos); |
|
1158 |
// stack: ..., a, b |
|
5419 | 1159 |
__ load_ptr( 0, rax); // load b |
1160 |
__ load_ptr( 1, rcx); // load a |
|
1161 |
__ store_ptr(1, rax); // store b |
|
1162 |
__ store_ptr(0, rcx); // store a |
|
1163 |
__ push_ptr(rax); // push b |
|
1 | 1164 |
// stack: ..., b, a, b |
1165 |
} |
|
1166 |
||
1167 |
void TemplateTable::dup_x2() { |
|
1168 |
transition(vtos, vtos); |
|
1169 |
// stack: ..., a, b, c |
|
5419 | 1170 |
__ load_ptr( 0, rax); // load c |
1171 |
__ load_ptr( 2, rcx); // load a |
|
1172 |
__ store_ptr(2, rax); // store c in a |
|
1173 |
__ push_ptr(rax); // push c |
|
1 | 1174 |
// stack: ..., c, b, c, c |
5419 | 1175 |
__ load_ptr( 2, rax); // load b |
1176 |
__ store_ptr(2, rcx); // store a in b |
|
1 | 1177 |
// stack: ..., c, a, c, c |
5419 | 1178 |
__ store_ptr(1, rax); // store b in c |
1 | 1179 |
// stack: ..., c, a, b, c |
1180 |
} |
|
1181 |
||
1182 |
void TemplateTable::dup2() { |
|
1183 |
transition(vtos, vtos); |
|
1184 |
// stack: ..., a, b |
|
5419 | 1185 |
__ load_ptr(1, rax); // load a |
1186 |
__ push_ptr(rax); // push a |
|
1187 |
__ load_ptr(1, rax); // load b |
|
1188 |
__ push_ptr(rax); // push b |
|
1 | 1189 |
// stack: ..., a, b, a, b |
1190 |
} |
|
1191 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1192 |
|
1 | 1193 |
void TemplateTable::dup2_x1() { |
1194 |
transition(vtos, vtos); |
|
1195 |
// stack: ..., a, b, c |
|
5419 | 1196 |
__ load_ptr( 0, rcx); // load c |
1197 |
__ load_ptr( 1, rax); // load b |
|
1198 |
__ push_ptr(rax); // push b |
|
1199 |
__ push_ptr(rcx); // push c |
|
1 | 1200 |
// stack: ..., a, b, c, b, c |
5419 | 1201 |
__ store_ptr(3, rcx); // store c in b |
1 | 1202 |
// stack: ..., a, c, c, b, c |
5419 | 1203 |
__ load_ptr( 4, rcx); // load a |
1204 |
__ store_ptr(2, rcx); // store a in 2nd c |
|
1 | 1205 |
// stack: ..., a, c, a, b, c |
5419 | 1206 |
__ store_ptr(4, rax); // store b in a |
1 | 1207 |
// stack: ..., b, c, a, b, c |
1208 |
} |
|
1209 |
||
1210 |
void TemplateTable::dup2_x2() { |
|
1211 |
transition(vtos, vtos); |
|
1212 |
// stack: ..., a, b, c, d |
|
5419 | 1213 |
__ load_ptr( 0, rcx); // load d |
1214 |
__ load_ptr( 1, rax); // load c |
|
1215 |
__ push_ptr(rax); // push c |
|
1216 |
__ push_ptr(rcx); // push d |
|
1 | 1217 |
// stack: ..., a, b, c, d, c, d |
5419 | 1218 |
__ load_ptr( 4, rax); // load b |
1219 |
__ store_ptr(2, rax); // store b in d |
|
1220 |
__ store_ptr(4, rcx); // store d in b |
|
1 | 1221 |
// stack: ..., a, d, c, b, c, d |
5419 | 1222 |
__ load_ptr( 5, rcx); // load a |
1223 |
__ load_ptr( 3, rax); // load c |
|
1224 |
__ store_ptr(3, rcx); // store a in c |
|
1225 |
__ store_ptr(5, rax); // store c in a |
|
1 | 1226 |
// stack: ..., c, d, a, b, c, d |
1227 |
} |
|
1228 |
||
1229 |
void TemplateTable::swap() { |
|
1230 |
transition(vtos, vtos); |
|
1231 |
// stack: ..., a, b |
|
5419 | 1232 |
__ load_ptr( 1, rcx); // load a |
1233 |
__ load_ptr( 0, rax); // load b |
|
1234 |
__ store_ptr(0, rcx); // store a in b |
|
1235 |
__ store_ptr(1, rax); // store b in a |
|
1 | 1236 |
// stack: ..., b, a |
1237 |
} |
|
1238 |
||
1239 |
void TemplateTable::iop2(Operation op) { |
|
1240 |
transition(itos, itos); |
|
1241 |
switch (op) { |
|
1242 |
case add : __ pop_i(rdx); __ addl (rax, rdx); break; |
|
1243 |
case sub : __ movl(rdx, rax); __ pop_i(rax); __ subl (rax, rdx); break; |
|
1244 |
case mul : __ pop_i(rdx); __ imull(rax, rdx); break; |
|
1245 |
case _and : __ pop_i(rdx); __ andl (rax, rdx); break; |
|
1246 |
case _or : __ pop_i(rdx); __ orl (rax, rdx); break; |
|
1247 |
case _xor : __ pop_i(rdx); __ xorl (rax, rdx); break; |
|
1248 |
case shl : __ movl(rcx, rax); __ pop_i(rax); __ shll (rax); break; |
|
1249 |
case shr : __ movl(rcx, rax); __ pop_i(rax); __ sarl (rax); break; |
|
1250 |
case ushr : __ movl(rcx, rax); __ pop_i(rax); __ shrl (rax); break; |
|
1251 |
default : ShouldNotReachHere(); |
|
1252 |
} |
|
1253 |
} |
|
1254 |
||
1255 |
void TemplateTable::lop2(Operation op) { |
|
1256 |
transition(ltos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1257 |
#ifdef _LP64 |
1 | 1258 |
switch (op) { |
5419 | 1259 |
case add : __ pop_l(rdx); __ addptr(rax, rdx); break; |
1260 |
case sub : __ mov(rdx, rax); __ pop_l(rax); __ subptr(rax, rdx); break; |
|
1261 |
case _and : __ pop_l(rdx); __ andptr(rax, rdx); break; |
|
1262 |
case _or : __ pop_l(rdx); __ orptr (rax, rdx); break; |
|
1263 |
case _xor : __ pop_l(rdx); __ xorptr(rax, rdx); break; |
|
1264 |
default : ShouldNotReachHere(); |
|
1 | 1265 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1266 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1267 |
__ pop_l(rbx, rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1268 |
switch (op) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1269 |
case add : __ addl(rax, rbx); __ adcl(rdx, rcx); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1270 |
case sub : __ subl(rbx, rax); __ sbbl(rcx, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1271 |
__ mov (rax, rbx); __ mov (rdx, rcx); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1272 |
case _and : __ andl(rax, rbx); __ andl(rdx, rcx); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1273 |
case _or : __ orl (rax, rbx); __ orl (rdx, rcx); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1274 |
case _xor : __ xorl(rax, rbx); __ xorl(rdx, rcx); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1275 |
default : ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1276 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1277 |
#endif |
1 | 1278 |
} |
1279 |
||
1280 |
void TemplateTable::idiv() { |
|
1281 |
transition(itos, itos); |
|
1282 |
__ movl(rcx, rax); |
|
1283 |
__ pop_i(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1284 |
// Note: could xor rax and ecx and compare with (-1 ^ min_int). If |
1 | 1285 |
// they are not equal, one could do a normal division (no correction |
1286 |
// needed), which may speed up this implementation for the common case. |
|
1287 |
// (see also JVM spec., p.243 & p.271) |
|
1288 |
__ corrected_idivl(rcx); |
|
1289 |
} |
|
1290 |
||
1291 |
void TemplateTable::irem() { |
|
1292 |
transition(itos, itos); |
|
1293 |
__ movl(rcx, rax); |
|
1294 |
__ pop_i(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1295 |
// Note: could xor rax and ecx and compare with (-1 ^ min_int). If |
1 | 1296 |
// they are not equal, one could do a normal division (no correction |
1297 |
// needed), which may speed up this implementation for the common case. |
|
1298 |
// (see also JVM spec., p.243 & p.271) |
|
1299 |
__ corrected_idivl(rcx); |
|
1300 |
__ movl(rax, rdx); |
|
1301 |
} |
|
1302 |
||
1303 |
void TemplateTable::lmul() { |
|
1304 |
transition(ltos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1305 |
#ifdef _LP64 |
1 | 1306 |
__ pop_l(rdx); |
1307 |
__ imulq(rax, rdx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1308 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1309 |
__ pop_l(rbx, rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1310 |
__ push(rcx); __ push(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1311 |
__ push(rdx); __ push(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1312 |
__ lmul(2 * wordSize, 0); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1313 |
__ addptr(rsp, 4 * wordSize); // take off temporaries |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1314 |
#endif |
1 | 1315 |
} |
1316 |
||
1317 |
void TemplateTable::ldiv() { |
|
1318 |
transition(ltos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1319 |
#ifdef _LP64 |
1066 | 1320 |
__ mov(rcx, rax); |
1 | 1321 |
__ pop_l(rax); |
1322 |
// generate explicit div0 check |
|
1323 |
__ testq(rcx, rcx); |
|
1324 |
__ jump_cc(Assembler::zero, |
|
1325 |
ExternalAddress(Interpreter::_throw_ArithmeticException_entry)); |
|
1326 |
// Note: could xor rax and rcx and compare with (-1 ^ min_int). If |
|
1327 |
// they are not equal, one could do a normal division (no correction |
|
1328 |
// needed), which may speed up this implementation for the common case. |
|
1329 |
// (see also JVM spec., p.243 & p.271) |
|
1330 |
__ corrected_idivq(rcx); // kills rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1331 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1332 |
__ pop_l(rbx, rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1333 |
__ push(rcx); __ push(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1334 |
__ push(rdx); __ push(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1335 |
// check if y = 0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1336 |
__ orl(rax, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1337 |
__ jump_cc(Assembler::zero, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1338 |
ExternalAddress(Interpreter::_throw_ArithmeticException_entry)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1339 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::ldiv)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1340 |
__ addptr(rsp, 4 * wordSize); // take off temporaries |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1341 |
#endif |
1 | 1342 |
} |
1343 |
||
1344 |
void TemplateTable::lrem() { |
|
1345 |
transition(ltos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1346 |
#ifdef _LP64 |
1066 | 1347 |
__ mov(rcx, rax); |
1 | 1348 |
__ pop_l(rax); |
1349 |
__ testq(rcx, rcx); |
|
1350 |
__ jump_cc(Assembler::zero, |
|
1351 |
ExternalAddress(Interpreter::_throw_ArithmeticException_entry)); |
|
1352 |
// Note: could xor rax and rcx and compare with (-1 ^ min_int). If |
|
1353 |
// they are not equal, one could do a normal division (no correction |
|
1354 |
// needed), which may speed up this implementation for the common case. |
|
1355 |
// (see also JVM spec., p.243 & p.271) |
|
1356 |
__ corrected_idivq(rcx); // kills rbx |
|
1066 | 1357 |
__ mov(rax, rdx); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1358 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1359 |
__ pop_l(rbx, rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1360 |
__ push(rcx); __ push(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1361 |
__ push(rdx); __ push(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1362 |
// check if y = 0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1363 |
__ orl(rax, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1364 |
__ jump_cc(Assembler::zero, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1365 |
ExternalAddress(Interpreter::_throw_ArithmeticException_entry)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1366 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::lrem)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1367 |
__ addptr(rsp, 4 * wordSize); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1368 |
#endif |
1 | 1369 |
} |
1370 |
||
1371 |
void TemplateTable::lshl() { |
|
1372 |
transition(itos, ltos); |
|
1373 |
__ movl(rcx, rax); // get shift count |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1374 |
#ifdef _LP64 |
1 | 1375 |
__ pop_l(rax); // get shift value |
1376 |
__ shlq(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1377 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1378 |
__ pop_l(rax, rdx); // get shift value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1379 |
__ lshl(rdx, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1380 |
#endif |
1 | 1381 |
} |
1382 |
||
1383 |
void TemplateTable::lshr() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1384 |
#ifdef _LP64 |
1 | 1385 |
transition(itos, ltos); |
1386 |
__ movl(rcx, rax); // get shift count |
|
1387 |
__ pop_l(rax); // get shift value |
|
1388 |
__ sarq(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1389 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1390 |
transition(itos, ltos); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1391 |
__ mov(rcx, rax); // get shift count |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1392 |
__ pop_l(rax, rdx); // get shift value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1393 |
__ lshr(rdx, rax, true); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1394 |
#endif |
1 | 1395 |
} |
1396 |
||
1397 |
void TemplateTable::lushr() { |
|
1398 |
transition(itos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1399 |
#ifdef _LP64 |
1 | 1400 |
__ movl(rcx, rax); // get shift count |
1401 |
__ pop_l(rax); // get shift value |
|
1402 |
__ shrq(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1403 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1404 |
__ mov(rcx, rax); // get shift count |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1405 |
__ pop_l(rax, rdx); // get shift value |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1406 |
__ lshr(rdx, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1407 |
#endif |
1 | 1408 |
} |
1409 |
||
1410 |
void TemplateTable::fop2(Operation op) { |
|
1411 |
transition(ftos, ftos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1412 |
#ifdef _LP64 |
1 | 1413 |
switch (op) { |
1414 |
case add: |
|
1415 |
__ addss(xmm0, at_rsp()); |
|
5419 | 1416 |
__ addptr(rsp, Interpreter::stackElementSize); |
1 | 1417 |
break; |
1418 |
case sub: |
|
1419 |
__ movflt(xmm1, xmm0); |
|
1420 |
__ pop_f(xmm0); |
|
1421 |
__ subss(xmm0, xmm1); |
|
1422 |
break; |
|
1423 |
case mul: |
|
1424 |
__ mulss(xmm0, at_rsp()); |
|
5419 | 1425 |
__ addptr(rsp, Interpreter::stackElementSize); |
1 | 1426 |
break; |
1427 |
case div: |
|
1428 |
__ movflt(xmm1, xmm0); |
|
1429 |
__ pop_f(xmm0); |
|
1430 |
__ divss(xmm0, xmm1); |
|
1431 |
break; |
|
1432 |
case rem: |
|
1433 |
__ movflt(xmm1, xmm0); |
|
1434 |
__ pop_f(xmm0); |
|
1435 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::frem), 2); |
|
1436 |
break; |
|
1437 |
default: |
|
1438 |
ShouldNotReachHere(); |
|
1439 |
break; |
|
1440 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1441 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1442 |
switch (op) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1443 |
case add: __ fadd_s (at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1444 |
case sub: __ fsubr_s(at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1445 |
case mul: __ fmul_s (at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1446 |
case div: __ fdivr_s(at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1447 |
case rem: __ fld_s (at_rsp()); __ fremr(rax); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1448 |
default : ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1449 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1450 |
__ f2ieee(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1451 |
__ pop(rax); // pop float thing off |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1452 |
#endif |
1 | 1453 |
} |
1454 |
||
1455 |
void TemplateTable::dop2(Operation op) { |
|
1456 |
transition(dtos, dtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1457 |
#ifdef _LP64 |
1 | 1458 |
switch (op) { |
1459 |
case add: |
|
1460 |
__ addsd(xmm0, at_rsp()); |
|
5419 | 1461 |
__ addptr(rsp, 2 * Interpreter::stackElementSize); |
1 | 1462 |
break; |
1463 |
case sub: |
|
1464 |
__ movdbl(xmm1, xmm0); |
|
1465 |
__ pop_d(xmm0); |
|
1466 |
__ subsd(xmm0, xmm1); |
|
1467 |
break; |
|
1468 |
case mul: |
|
1469 |
__ mulsd(xmm0, at_rsp()); |
|
5419 | 1470 |
__ addptr(rsp, 2 * Interpreter::stackElementSize); |
1 | 1471 |
break; |
1472 |
case div: |
|
1473 |
__ movdbl(xmm1, xmm0); |
|
1474 |
__ pop_d(xmm0); |
|
1475 |
__ divsd(xmm0, xmm1); |
|
1476 |
break; |
|
1477 |
case rem: |
|
1478 |
__ movdbl(xmm1, xmm0); |
|
1479 |
__ pop_d(xmm0); |
|
1480 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::drem), 2); |
|
1481 |
break; |
|
1482 |
default: |
|
1483 |
ShouldNotReachHere(); |
|
1484 |
break; |
|
1485 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1486 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1487 |
switch (op) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1488 |
case add: __ fadd_d (at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1489 |
case sub: __ fsubr_d(at_rsp()); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1490 |
case mul: { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1491 |
Label L_strict; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1492 |
Label L_join; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1493 |
const Address access_flags (rcx, Method::access_flags_offset()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1494 |
__ get_method(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1495 |
__ movl(rcx, access_flags); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1496 |
__ testl(rcx, JVM_ACC_STRICT); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1497 |
__ jccb(Assembler::notZero, L_strict); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1498 |
__ fmul_d (at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1499 |
__ jmpb(L_join); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1500 |
__ bind(L_strict); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1501 |
__ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias1())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1502 |
__ fmulp(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1503 |
__ fmul_d (at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1504 |
__ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias2())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1505 |
__ fmulp(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1506 |
__ bind(L_join); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1507 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1508 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1509 |
case div: { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1510 |
Label L_strict; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1511 |
Label L_join; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1512 |
const Address access_flags (rcx, Method::access_flags_offset()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1513 |
__ get_method(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1514 |
__ movl(rcx, access_flags); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1515 |
__ testl(rcx, JVM_ACC_STRICT); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1516 |
__ jccb(Assembler::notZero, L_strict); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1517 |
__ fdivr_d(at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1518 |
__ jmp(L_join); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1519 |
__ bind(L_strict); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1520 |
__ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias1())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1521 |
__ fmul_d (at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1522 |
__ fdivrp(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1523 |
__ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias2())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1524 |
__ fmulp(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1525 |
__ bind(L_join); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1526 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1527 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1528 |
case rem: __ fld_d (at_rsp()); __ fremr(rax); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1529 |
default : ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1530 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1531 |
__ d2ieee(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1532 |
// Pop double precision number from rsp. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1533 |
__ pop(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1534 |
__ pop(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1535 |
#endif |
1 | 1536 |
} |
1537 |
||
1538 |
void TemplateTable::ineg() { |
|
1539 |
transition(itos, itos); |
|
1540 |
__ negl(rax); |
|
1541 |
} |
|
1542 |
||
1543 |
void TemplateTable::lneg() { |
|
1544 |
transition(ltos, ltos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1545 |
LP64_ONLY(__ negq(rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1546 |
NOT_LP64(__ lneg(rdx, rax)); |
1 | 1547 |
} |
1548 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1549 |
#ifdef _LP64 |
1 | 1550 |
// Note: 'double' and 'long long' have 32-bits alignment on x86. |
1551 |
static jlong* double_quadword(jlong *adr, jlong lo, jlong hi) { |
|
1552 |
// Use the expression (adr)&(~0xF) to provide 128-bits aligned address |
|
1553 |
// of 128-bits operands for SSE instructions. |
|
1554 |
jlong *operand = (jlong*)(((intptr_t)adr)&((intptr_t)(~0xF))); |
|
1555 |
// Store the value to a 128-bits operand. |
|
1556 |
operand[0] = lo; |
|
1557 |
operand[1] = hi; |
|
1558 |
return operand; |
|
1559 |
} |
|
1560 |
||
1561 |
// Buffer for 128-bits masks used by SSE instructions. |
|
1562 |
static jlong float_signflip_pool[2*2]; |
|
1563 |
static jlong double_signflip_pool[2*2]; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1564 |
#endif |
1 | 1565 |
|
1566 |
void TemplateTable::fneg() { |
|
1567 |
transition(ftos, ftos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1568 |
#ifdef _LP64 |
1 | 1569 |
static jlong *float_signflip = double_quadword(&float_signflip_pool[1], 0x8000000080000000, 0x8000000080000000); |
1570 |
__ xorps(xmm0, ExternalAddress((address) float_signflip)); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1571 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1572 |
__ fchs(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1573 |
#endif |
1 | 1574 |
} |
1575 |
||
1576 |
void TemplateTable::dneg() { |
|
1577 |
transition(dtos, dtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1578 |
#ifdef _LP64 |
1 | 1579 |
static jlong *double_signflip = double_quadword(&double_signflip_pool[1], 0x8000000000000000, 0x8000000000000000); |
1580 |
__ xorpd(xmm0, ExternalAddress((address) double_signflip)); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1581 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1582 |
__ fchs(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1583 |
#endif |
1 | 1584 |
} |
1585 |
||
1586 |
void TemplateTable::iinc() { |
|
1587 |
transition(vtos, vtos); |
|
1588 |
__ load_signed_byte(rdx, at_bcp(2)); // get constant |
|
1589 |
locals_index(rbx); |
|
1590 |
__ addl(iaddress(rbx), rdx); |
|
1591 |
} |
|
1592 |
||
1593 |
void TemplateTable::wide_iinc() { |
|
1594 |
transition(vtos, vtos); |
|
1595 |
__ movl(rdx, at_bcp(4)); // get constant |
|
1596 |
locals_index_wide(rbx); |
|
1597 |
__ bswapl(rdx); // swap bytes & sign-extend constant |
|
1598 |
__ sarl(rdx, 16); |
|
1599 |
__ addl(iaddress(rbx), rdx); |
|
1600 |
// Note: should probably use only one movl to get both |
|
1601 |
// the index and the constant -> fix this |
|
1602 |
} |
|
1603 |
||
1604 |
void TemplateTable::convert() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1605 |
#ifdef _LP64 |
1 | 1606 |
// Checking |
1607 |
#ifdef ASSERT |
|
1608 |
{ |
|
1609 |
TosState tos_in = ilgl; |
|
1610 |
TosState tos_out = ilgl; |
|
1611 |
switch (bytecode()) { |
|
1612 |
case Bytecodes::_i2l: // fall through |
|
1613 |
case Bytecodes::_i2f: // fall through |
|
1614 |
case Bytecodes::_i2d: // fall through |
|
1615 |
case Bytecodes::_i2b: // fall through |
|
1616 |
case Bytecodes::_i2c: // fall through |
|
1617 |
case Bytecodes::_i2s: tos_in = itos; break; |
|
1618 |
case Bytecodes::_l2i: // fall through |
|
1619 |
case Bytecodes::_l2f: // fall through |
|
1620 |
case Bytecodes::_l2d: tos_in = ltos; break; |
|
1621 |
case Bytecodes::_f2i: // fall through |
|
1622 |
case Bytecodes::_f2l: // fall through |
|
1623 |
case Bytecodes::_f2d: tos_in = ftos; break; |
|
1624 |
case Bytecodes::_d2i: // fall through |
|
1625 |
case Bytecodes::_d2l: // fall through |
|
1626 |
case Bytecodes::_d2f: tos_in = dtos; break; |
|
1627 |
default : ShouldNotReachHere(); |
|
1628 |
} |
|
1629 |
switch (bytecode()) { |
|
1630 |
case Bytecodes::_l2i: // fall through |
|
1631 |
case Bytecodes::_f2i: // fall through |
|
1632 |
case Bytecodes::_d2i: // fall through |
|
1633 |
case Bytecodes::_i2b: // fall through |
|
1634 |
case Bytecodes::_i2c: // fall through |
|
1635 |
case Bytecodes::_i2s: tos_out = itos; break; |
|
1636 |
case Bytecodes::_i2l: // fall through |
|
1637 |
case Bytecodes::_f2l: // fall through |
|
1638 |
case Bytecodes::_d2l: tos_out = ltos; break; |
|
1639 |
case Bytecodes::_i2f: // fall through |
|
1640 |
case Bytecodes::_l2f: // fall through |
|
1641 |
case Bytecodes::_d2f: tos_out = ftos; break; |
|
1642 |
case Bytecodes::_i2d: // fall through |
|
1643 |
case Bytecodes::_l2d: // fall through |
|
1644 |
case Bytecodes::_f2d: tos_out = dtos; break; |
|
1645 |
default : ShouldNotReachHere(); |
|
1646 |
} |
|
1647 |
transition(tos_in, tos_out); |
|
1648 |
} |
|
1649 |
#endif // ASSERT |
|
1650 |
||
1651 |
static const int64_t is_nan = 0x8000000000000000L; |
|
1652 |
||
1653 |
// Conversion |
|
1654 |
switch (bytecode()) { |
|
1655 |
case Bytecodes::_i2l: |
|
1656 |
__ movslq(rax, rax); |
|
1657 |
break; |
|
1658 |
case Bytecodes::_i2f: |
|
1659 |
__ cvtsi2ssl(xmm0, rax); |
|
1660 |
break; |
|
1661 |
case Bytecodes::_i2d: |
|
1662 |
__ cvtsi2sdl(xmm0, rax); |
|
1663 |
break; |
|
1664 |
case Bytecodes::_i2b: |
|
1665 |
__ movsbl(rax, rax); |
|
1666 |
break; |
|
1667 |
case Bytecodes::_i2c: |
|
1668 |
__ movzwl(rax, rax); |
|
1669 |
break; |
|
1670 |
case Bytecodes::_i2s: |
|
1671 |
__ movswl(rax, rax); |
|
1672 |
break; |
|
1673 |
case Bytecodes::_l2i: |
|
1674 |
__ movl(rax, rax); |
|
1675 |
break; |
|
1676 |
case Bytecodes::_l2f: |
|
1677 |
__ cvtsi2ssq(xmm0, rax); |
|
1678 |
break; |
|
1679 |
case Bytecodes::_l2d: |
|
1680 |
__ cvtsi2sdq(xmm0, rax); |
|
1681 |
break; |
|
1682 |
case Bytecodes::_f2i: |
|
1683 |
{ |
|
1684 |
Label L; |
|
1685 |
__ cvttss2sil(rax, xmm0); |
|
1686 |
__ cmpl(rax, 0x80000000); // NaN or overflow/underflow? |
|
1687 |
__ jcc(Assembler::notEqual, L); |
|
1688 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2i), 1); |
|
1689 |
__ bind(L); |
|
1690 |
} |
|
1691 |
break; |
|
1692 |
case Bytecodes::_f2l: |
|
1693 |
{ |
|
1694 |
Label L; |
|
1695 |
__ cvttss2siq(rax, xmm0); |
|
1696 |
// NaN or overflow/underflow? |
|
1697 |
__ cmp64(rax, ExternalAddress((address) &is_nan)); |
|
1698 |
__ jcc(Assembler::notEqual, L); |
|
1699 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2l), 1); |
|
1700 |
__ bind(L); |
|
1701 |
} |
|
1702 |
break; |
|
1703 |
case Bytecodes::_f2d: |
|
1704 |
__ cvtss2sd(xmm0, xmm0); |
|
1705 |
break; |
|
1706 |
case Bytecodes::_d2i: |
|
1707 |
{ |
|
1708 |
Label L; |
|
1709 |
__ cvttsd2sil(rax, xmm0); |
|
1710 |
__ cmpl(rax, 0x80000000); // NaN or overflow/underflow? |
|
1711 |
__ jcc(Assembler::notEqual, L); |
|
1712 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2i), 1); |
|
1713 |
__ bind(L); |
|
1714 |
} |
|
1715 |
break; |
|
1716 |
case Bytecodes::_d2l: |
|
1717 |
{ |
|
1718 |
Label L; |
|
1719 |
__ cvttsd2siq(rax, xmm0); |
|
1720 |
// NaN or overflow/underflow? |
|
1721 |
__ cmp64(rax, ExternalAddress((address) &is_nan)); |
|
1722 |
__ jcc(Assembler::notEqual, L); |
|
1723 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l), 1); |
|
1724 |
__ bind(L); |
|
1725 |
} |
|
1726 |
break; |
|
1727 |
case Bytecodes::_d2f: |
|
1728 |
__ cvtsd2ss(xmm0, xmm0); |
|
1729 |
break; |
|
1730 |
default: |
|
1731 |
ShouldNotReachHere(); |
|
1732 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1733 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1734 |
// Checking |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1735 |
#ifdef ASSERT |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1736 |
{ TosState tos_in = ilgl; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1737 |
TosState tos_out = ilgl; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1738 |
switch (bytecode()) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1739 |
case Bytecodes::_i2l: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1740 |
case Bytecodes::_i2f: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1741 |
case Bytecodes::_i2d: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1742 |
case Bytecodes::_i2b: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1743 |
case Bytecodes::_i2c: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1744 |
case Bytecodes::_i2s: tos_in = itos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1745 |
case Bytecodes::_l2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1746 |
case Bytecodes::_l2f: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1747 |
case Bytecodes::_l2d: tos_in = ltos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1748 |
case Bytecodes::_f2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1749 |
case Bytecodes::_f2l: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1750 |
case Bytecodes::_f2d: tos_in = ftos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1751 |
case Bytecodes::_d2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1752 |
case Bytecodes::_d2l: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1753 |
case Bytecodes::_d2f: tos_in = dtos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1754 |
default : ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1755 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1756 |
switch (bytecode()) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1757 |
case Bytecodes::_l2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1758 |
case Bytecodes::_f2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1759 |
case Bytecodes::_d2i: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1760 |
case Bytecodes::_i2b: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1761 |
case Bytecodes::_i2c: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1762 |
case Bytecodes::_i2s: tos_out = itos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1763 |
case Bytecodes::_i2l: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1764 |
case Bytecodes::_f2l: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1765 |
case Bytecodes::_d2l: tos_out = ltos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1766 |
case Bytecodes::_i2f: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1767 |
case Bytecodes::_l2f: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1768 |
case Bytecodes::_d2f: tos_out = ftos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1769 |
case Bytecodes::_i2d: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1770 |
case Bytecodes::_l2d: // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1771 |
case Bytecodes::_f2d: tos_out = dtos; break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1772 |
default : ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1773 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1774 |
transition(tos_in, tos_out); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1775 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1776 |
#endif // ASSERT |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1777 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1778 |
// Conversion |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1779 |
// (Note: use push(rcx)/pop(rcx) for 1/2-word stack-ptr manipulation) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1780 |
switch (bytecode()) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1781 |
case Bytecodes::_i2l: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1782 |
__ extend_sign(rdx, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1783 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1784 |
case Bytecodes::_i2f: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1785 |
__ push(rax); // store int on tos |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1786 |
__ fild_s(at_rsp()); // load int to ST0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1787 |
__ f2ieee(); // truncate to float size |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1788 |
__ pop(rcx); // adjust rsp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1789 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1790 |
case Bytecodes::_i2d: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1791 |
__ push(rax); // add one slot for d2ieee() |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1792 |
__ push(rax); // store int on tos |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1793 |
__ fild_s(at_rsp()); // load int to ST0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1794 |
__ d2ieee(); // truncate to double size |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1795 |
__ pop(rcx); // adjust rsp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1796 |
__ pop(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1797 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1798 |
case Bytecodes::_i2b: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1799 |
__ shll(rax, 24); // truncate upper 24 bits |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1800 |
__ sarl(rax, 24); // and sign-extend byte |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1801 |
LP64_ONLY(__ movsbl(rax, rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1802 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1803 |
case Bytecodes::_i2c: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1804 |
__ andl(rax, 0xFFFF); // truncate upper 16 bits |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1805 |
LP64_ONLY(__ movzwl(rax, rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1806 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1807 |
case Bytecodes::_i2s: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1808 |
__ shll(rax, 16); // truncate upper 16 bits |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1809 |
__ sarl(rax, 16); // and sign-extend short |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1810 |
LP64_ONLY(__ movswl(rax, rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1811 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1812 |
case Bytecodes::_l2i: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1813 |
/* nothing to do */ |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1814 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1815 |
case Bytecodes::_l2f: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1816 |
__ push(rdx); // store long on tos |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1817 |
__ push(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1818 |
__ fild_d(at_rsp()); // load long to ST0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1819 |
__ f2ieee(); // truncate to float size |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1820 |
__ pop(rcx); // adjust rsp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1821 |
__ pop(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1822 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1823 |
case Bytecodes::_l2d: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1824 |
__ push(rdx); // store long on tos |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1825 |
__ push(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1826 |
__ fild_d(at_rsp()); // load long to ST0 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1827 |
__ d2ieee(); // truncate to double size |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1828 |
__ pop(rcx); // adjust rsp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1829 |
__ pop(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1830 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1831 |
case Bytecodes::_f2i: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1832 |
__ push(rcx); // reserve space for argument |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1833 |
__ fstp_s(at_rsp()); // pass float argument on stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1834 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2i), 1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1835 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1836 |
case Bytecodes::_f2l: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1837 |
__ push(rcx); // reserve space for argument |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1838 |
__ fstp_s(at_rsp()); // pass float argument on stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1839 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::f2l), 1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1840 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1841 |
case Bytecodes::_f2d: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1842 |
/* nothing to do */ |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1843 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1844 |
case Bytecodes::_d2i: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1845 |
__ push(rcx); // reserve space for argument |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1846 |
__ push(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1847 |
__ fstp_d(at_rsp()); // pass double argument on stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1848 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2i), 2); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1849 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1850 |
case Bytecodes::_d2l: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1851 |
__ push(rcx); // reserve space for argument |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1852 |
__ push(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1853 |
__ fstp_d(at_rsp()); // pass double argument on stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1854 |
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l), 2); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1855 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1856 |
case Bytecodes::_d2f: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1857 |
__ push(rcx); // reserve space for f2ieee() |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1858 |
__ f2ieee(); // truncate to float size |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1859 |
__ pop(rcx); // adjust rsp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1860 |
break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1861 |
default : |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1862 |
ShouldNotReachHere(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1863 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1864 |
#endif |
1 | 1865 |
} |
1866 |
||
1867 |
void TemplateTable::lcmp() { |
|
1868 |
transition(ltos, itos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1869 |
#ifdef _LP64 |
1 | 1870 |
Label done; |
1871 |
__ pop_l(rdx); |
|
1872 |
__ cmpq(rdx, rax); |
|
1873 |
__ movl(rax, -1); |
|
1874 |
__ jccb(Assembler::less, done); |
|
1875 |
__ setb(Assembler::notEqual, rax); |
|
1876 |
__ movzbl(rax, rax); |
|
1877 |
__ bind(done); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1878 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1879 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1880 |
// y = rdx:rax |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1881 |
__ pop_l(rbx, rcx); // get x = rcx:rbx |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1882 |
__ lcmp2int(rcx, rbx, rdx, rax);// rcx := cmp(x, y) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1883 |
__ mov(rax, rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1884 |
#endif |
1 | 1885 |
} |
1886 |
||
1887 |
void TemplateTable::float_cmp(bool is_float, int unordered_result) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1888 |
#ifdef _LP64 |
1 | 1889 |
Label done; |
1890 |
if (is_float) { |
|
1891 |
// XXX get rid of pop here, use ... reg, mem32 |
|
1892 |
__ pop_f(xmm1); |
|
1893 |
__ ucomiss(xmm1, xmm0); |
|
1894 |
} else { |
|
1895 |
// XXX get rid of pop here, use ... reg, mem64 |
|
1896 |
__ pop_d(xmm1); |
|
1897 |
__ ucomisd(xmm1, xmm0); |
|
1898 |
} |
|
1899 |
if (unordered_result < 0) { |
|
1900 |
__ movl(rax, -1); |
|
1901 |
__ jccb(Assembler::parity, done); |
|
1902 |
__ jccb(Assembler::below, done); |
|
1903 |
__ setb(Assembler::notEqual, rdx); |
|
1904 |
__ movzbl(rax, rdx); |
|
1905 |
} else { |
|
1906 |
__ movl(rax, 1); |
|
1907 |
__ jccb(Assembler::parity, done); |
|
1908 |
__ jccb(Assembler::above, done); |
|
1909 |
__ movl(rax, 0); |
|
1910 |
__ jccb(Assembler::equal, done); |
|
1911 |
__ decrementl(rax); |
|
1912 |
} |
|
1913 |
__ bind(done); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1914 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1915 |
if (is_float) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1916 |
__ fld_s(at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1917 |
} else { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1918 |
__ fld_d(at_rsp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1919 |
__ pop(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1920 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1921 |
__ pop(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1922 |
__ fcmp2int(rax, unordered_result < 0); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1923 |
#endif |
1 | 1924 |
} |
1925 |
||
1926 |
void TemplateTable::branch(bool is_jsr, bool is_wide) { |
|
1927 |
__ get_method(rcx); // rcx holds method |
|
1928 |
__ profile_taken_branch(rax, rbx); // rax holds updated MDP, rbx |
|
1929 |
// holds bumped taken count |
|
1930 |
||
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1931 |
const ByteSize be_offset = MethodCounters::backedge_counter_offset() + |
1 | 1932 |
InvocationCounter::counter_offset(); |
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1933 |
const ByteSize inv_offset = MethodCounters::invocation_counter_offset() + |
1 | 1934 |
InvocationCounter::counter_offset(); |
1935 |
||
1936 |
// Load up edx with the branch displacement |
|
21515
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
1937 |
if (is_wide) { |
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
1938 |
__ movl(rdx, at_bcp(1)); |
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
1939 |
} else { |
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
1940 |
__ load_signed_short(rdx, at_bcp(1)); |
ec29f0abf481
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
mgerdin
parents:
20702
diff
changeset
|
1941 |
} |
1 | 1942 |
__ bswapl(rdx); |
1943 |
||
1944 |
if (!is_wide) { |
|
1945 |
__ sarl(rdx, 16); |
|
1946 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1947 |
LP64_ONLY(__ movl2ptr(rdx, rdx)); |
1 | 1948 |
|
1949 |
// Handle all the JSR stuff here, then exit. |
|
1950 |
// It's much shorter and cleaner than intermingling with the non-JSR |
|
2131 | 1951 |
// normal-branch stuff occurring below. |
1 | 1952 |
if (is_jsr) { |
1953 |
// Pre-load the next target bytecode into rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1954 |
__ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1, 0)); |
1 | 1955 |
|
1956 |
// compute return address as bci in rax |
|
1066 | 1957 |
__ lea(rax, at_bcp((is_wide ? 5 : 3) - |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1958 |
in_bytes(ConstMethod::codes_offset()))); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1959 |
__ subptr(rax, Address(rcx, Method::const_offset())); |
1 | 1960 |
// Adjust the bcp in r13 by the displacement in rdx |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1961 |
__ addptr(rbcp, rdx); |
1 | 1962 |
// jsr returns atos that is not an oop |
1963 |
__ push_i(rax); |
|
1964 |
__ dispatch_only(vtos); |
|
1965 |
return; |
|
1966 |
} |
|
1967 |
||
1968 |
// Normal (non-jsr) branch handling |
|
1969 |
||
1970 |
// Adjust the bcp in r13 by the displacement in rdx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1971 |
__ addptr(rbcp, rdx); |
1 | 1972 |
|
1973 |
assert(UseLoopCounter || !UseOnStackReplacement, |
|
1974 |
"on-stack-replacement requires loop counters"); |
|
1975 |
Label backedge_counter_overflow; |
|
1976 |
Label profile_method; |
|
1977 |
Label dispatch; |
|
1978 |
if (UseLoopCounter) { |
|
1979 |
// increment backedge counter for backward branches |
|
1980 |
// rax: MDO |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
1981 |
// rbx: MDO bumped taken-count |
1 | 1982 |
// rcx: method |
1983 |
// rdx: target offset |
|
1984 |
// r13: target bcp |
|
1985 |
// r14: locals pointer |
|
1986 |
__ testl(rdx, rdx); // check if forward or backward branch |
|
1987 |
__ jcc(Assembler::positive, dispatch); // count only if backward branch |
|
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1988 |
|
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1989 |
// check if MethodCounters exists |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1990 |
Label has_counters; |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1991 |
__ movptr(rax, Address(rcx, Method::method_counters_offset())); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1992 |
__ testptr(rax, rax); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1993 |
__ jcc(Assembler::notZero, has_counters); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1994 |
__ push(rdx); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1995 |
__ push(rcx); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1996 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::build_method_counters), |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1997 |
rcx); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1998 |
__ pop(rcx); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
1999 |
__ pop(rdx); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2000 |
__ movptr(rax, Address(rcx, Method::method_counters_offset())); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2001 |
__ jcc(Assembler::zero, dispatch); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2002 |
__ bind(has_counters); |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2003 |
|
6453 | 2004 |
if (TieredCompilation) { |
2005 |
Label no_mdo; |
|
2006 |
int increment = InvocationCounter::count_increment; |
|
2007 |
if (ProfileInterpreter) { |
|
2008 |
// Are we profiling? |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2009 |
__ movptr(rbx, Address(rcx, in_bytes(Method::method_data_offset()))); |
6453 | 2010 |
__ testptr(rbx, rbx); |
2011 |
__ jccb(Assembler::zero, no_mdo); |
|
2012 |
// Increment the MDO backedge counter |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2013 |
const Address mdo_backedge_counter(rbx, in_bytes(MethodData::backedge_counter_offset()) + |
6453 | 2014 |
in_bytes(InvocationCounter::counter_offset())); |
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27625
diff
changeset
|
2015 |
const Address mask(rbx, in_bytes(MethodData::backedge_mask_offset())); |
6453 | 2016 |
__ increment_mask_and_jump(mdo_backedge_counter, increment, mask, |
2017 |
rax, false, Assembler::zero, &backedge_counter_overflow); |
|
2018 |
__ jmp(dispatch); |
|
1 | 2019 |
} |
6453 | 2020 |
__ bind(no_mdo); |
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2021 |
// Increment backedge counter in MethodCounters* |
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2022 |
__ movptr(rcx, Address(rcx, Method::method_counters_offset())); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2023 |
const Address mask(rcx, in_bytes(MethodCounters::backedge_mask_offset())); |
6453 | 2024 |
__ increment_mask_and_jump(Address(rcx, be_offset), increment, mask, |
2025 |
rax, false, Assembler::zero, &backedge_counter_overflow); |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27625
diff
changeset
|
2026 |
} else { // not TieredCompilation |
6453 | 2027 |
// increment counter |
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2028 |
__ movptr(rcx, Address(rcx, Method::method_counters_offset())); |
6453 | 2029 |
__ movl(rax, Address(rcx, be_offset)); // load backedge counter |
2030 |
__ incrementl(rax, InvocationCounter::count_increment); // increment counter |
|
2031 |
__ movl(Address(rcx, be_offset), rax); // store counter |
|
2032 |
||
2033 |
__ movl(rax, Address(rcx, inv_offset)); // load invocation counter |
|
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
15482
diff
changeset
|
2034 |
|
6453 | 2035 |
__ andl(rax, InvocationCounter::count_mask_value); // and the status bits |
2036 |
__ addl(rax, Address(rcx, be_offset)); // add both counters |
|
2037 |
||
2038 |
if (ProfileInterpreter) { |
|
2039 |
// Test to see if we should create a method data oop |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27625
diff
changeset
|
2040 |
__ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_profile_limit_offset()))); |
6453 | 2041 |
__ jcc(Assembler::less, dispatch); |
2042 |
||
2043 |
// if no method data exists, go to profile method |
|
2044 |
__ test_method_data_pointer(rax, profile_method); |
|
2045 |
||
2046 |
if (UseOnStackReplacement) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2047 |
// check for overflow against rbx which is the MDO taken count |
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27625
diff
changeset
|
2048 |
__ cmp32(rbx, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); |
6453 | 2049 |
__ jcc(Assembler::below, dispatch); |
2050 |
||
2051 |
// When ProfileInterpreter is on, the backedge_count comes |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2052 |
// from the MethodData*, which value does not get reset on |
6453 | 2053 |
// the call to frequency_counter_overflow(). To avoid |
2054 |
// excessive calls to the overflow routine while the method is |
|
2055 |
// being compiled, add a second test to make sure the overflow |
|
2056 |
// function is called only once every overflow_frequency. |
|
2057 |
const int overflow_frequency = 1024; |
|
2058 |
__ andl(rbx, overflow_frequency - 1); |
|
2059 |
__ jcc(Assembler::zero, backedge_counter_overflow); |
|
2060 |
||
2061 |
} |
|
2062 |
} else { |
|
2063 |
if (UseOnStackReplacement) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2064 |
// check for overflow against rax, which is the sum of the |
6453 | 2065 |
// counters |
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27625
diff
changeset
|
2066 |
__ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); |
6453 | 2067 |
__ jcc(Assembler::aboveEqual, backedge_counter_overflow); |
2068 |
||
2069 |
} |
|
1 | 2070 |
} |
2071 |
} |
|
2072 |
__ bind(dispatch); |
|
2073 |
} |
|
2074 |
||
2075 |
// Pre-load the next target bytecode into rbx |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2076 |
__ load_unsigned_byte(rbx, Address(rbcp, 0)); |
1 | 2077 |
|
2078 |
// continue with the bytecode @ target |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2079 |
// rax: return bci for jsr's, unused otherwise |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2080 |
// rbx: target bytecode |
1 | 2081 |
// r13: target bcp |
2082 |
__ dispatch_only(vtos); |
|
2083 |
||
2084 |
if (UseLoopCounter) { |
|
2085 |
if (ProfileInterpreter) { |
|
2086 |
// Out-of-line code to allocate method data oop. |
|
2087 |
__ bind(profile_method); |
|
7889
02144432d0e1
4930919: race condition in MDO creation at back branch locations
iveresov
parents:
7401
diff
changeset
|
2088 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2089 |
__ load_unsigned_byte(rbx, Address(rbcp, 0)); // restore target bytecode |
7889
02144432d0e1
4930919: race condition in MDO creation at back branch locations
iveresov
parents:
7401
diff
changeset
|
2090 |
__ set_method_data_pointer_for_bcp(); |
1 | 2091 |
__ jmp(dispatch); |
2092 |
} |
|
2093 |
||
2094 |
if (UseOnStackReplacement) { |
|
2095 |
// invocation counter overflow |
|
2096 |
__ bind(backedge_counter_overflow); |
|
1066 | 2097 |
__ negptr(rdx); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2098 |
__ addptr(rdx, rbcp); // branch bcp |
1 | 2099 |
// IcoResult frequency_counter_overflow([JavaThread*], address branch_bcp) |
2100 |
__ call_VM(noreg, |
|
2101 |
CAST_FROM_FN_PTR(address, |
|
2102 |
InterpreterRuntime::frequency_counter_overflow), |
|
2103 |
rdx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2104 |
__ load_unsigned_byte(rbx, Address(rbcp, 0)); // restore target bytecode |
1 | 2105 |
|
2106 |
// rax: osr nmethod (osr ok) or NULL (osr not possible) |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2107 |
// rbx: target bytecode |
1 | 2108 |
// rdx: scratch |
2109 |
// r14: locals pointer |
|
2110 |
// r13: bcp |
|
1066 | 2111 |
__ testptr(rax, rax); // test result |
1 | 2112 |
__ jcc(Assembler::zero, dispatch); // no osr if null |
2113 |
// nmethod may have been invalidated (VM may block upon call_VM return) |
|
26705
fca1785e7084
8048721: -XX:+PrintCompilation prints negative bci for non entrant OSR methods
thartmann
parents:
25715
diff
changeset
|
2114 |
__ cmpb(Address(rax, nmethod::state_offset()), nmethod::in_use); |
fca1785e7084
8048721: -XX:+PrintCompilation prints negative bci for non entrant OSR methods
thartmann
parents:
25715
diff
changeset
|
2115 |
__ jcc(Assembler::notEqual, dispatch); |
1 | 2116 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2117 |
// We have the address of an on stack replacement routine in rax |
1 | 2118 |
// We need to prepare to execute the OSR method. First we must |
2119 |
// migrate the locals and monitors off of the stack. |
|
2120 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2121 |
LP64_ONLY(__ mov(r13, rax)); // save the nmethod |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2122 |
NOT_LP64(__ mov(rbx, rax)); // save the nmethod |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2123 |
NOT_LP64(__ get_thread(rcx)); |
1 | 2124 |
|
2125 |
call_VM(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::OSR_migration_begin)); |
|
2126 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2127 |
// rax is OSR buffer, move it to expected parameter location |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2128 |
LP64_ONLY(__ mov(j_rarg0, rax)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2129 |
NOT_LP64(__ mov(rcx, rax)); |
1 | 2130 |
// We use j_rarg definitions here so that registers don't conflict as parameter |
2131 |
// registers change across platforms as we are in the midst of a calling |
|
2132 |
// sequence to the OSR nmethod and we don't want collision. These are NOT parameters. |
|
2133 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2134 |
const Register retaddr = LP64_ONLY(j_rarg2) NOT_LP64(rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2135 |
const Register sender_sp = LP64_ONLY(j_rarg1) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2136 |
|
1 | 2137 |
|
2138 |
// pop the interpreter frame |
|
1066 | 2139 |
__ movptr(sender_sp, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); // get sender sp |
1 | 2140 |
__ leave(); // remove frame anchor |
1066 | 2141 |
__ pop(retaddr); // get return address |
2142 |
__ mov(rsp, sender_sp); // set sp to sender sp |
|
1 | 2143 |
// Ensure compiled code always sees stack at proper alignment |
1066 | 2144 |
__ andptr(rsp, -(StackAlignmentInBytes)); |
1 | 2145 |
|
2146 |
// unlike x86 we need no specialized return from compiled code |
|
2147 |
// to the interpreter or the call stub. |
|
2148 |
||
2149 |
// push the return address |
|
1066 | 2150 |
__ push(retaddr); |
1 | 2151 |
|
2152 |
// and begin the OSR nmethod |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2153 |
LP64_ONLY(__ jmp(Address(r13, nmethod::osr_entry_point_offset()))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2154 |
NOT_LP64(__ jmp(Address(rbx, nmethod::osr_entry_point_offset()))); |
1 | 2155 |
} |
2156 |
} |
|
2157 |
} |
|
2158 |
||
2159 |
void TemplateTable::if_0cmp(Condition cc) { |
|
2160 |
transition(itos, vtos); |
|
2161 |
// assume branch is more often taken than not (loops use backward branches) |
|
2162 |
Label not_taken; |
|
2163 |
__ testl(rax, rax); |
|
2164 |
__ jcc(j_not(cc), not_taken); |
|
2165 |
branch(false, false); |
|
2166 |
__ bind(not_taken); |
|
2167 |
__ profile_not_taken_branch(rax); |
|
2168 |
} |
|
2169 |
||
2170 |
void TemplateTable::if_icmp(Condition cc) { |
|
2171 |
transition(itos, vtos); |
|
2172 |
// assume branch is more often taken than not (loops use backward branches) |
|
2173 |
Label not_taken; |
|
2174 |
__ pop_i(rdx); |
|
2175 |
__ cmpl(rdx, rax); |
|
2176 |
__ jcc(j_not(cc), not_taken); |
|
2177 |
branch(false, false); |
|
2178 |
__ bind(not_taken); |
|
2179 |
__ profile_not_taken_branch(rax); |
|
2180 |
} |
|
2181 |
||
2182 |
void TemplateTable::if_nullcmp(Condition cc) { |
|
2183 |
transition(atos, vtos); |
|
2184 |
// assume branch is more often taken than not (loops use backward branches) |
|
2185 |
Label not_taken; |
|
1066 | 2186 |
__ testptr(rax, rax); |
1 | 2187 |
__ jcc(j_not(cc), not_taken); |
2188 |
branch(false, false); |
|
2189 |
__ bind(not_taken); |
|
2190 |
__ profile_not_taken_branch(rax); |
|
2191 |
} |
|
2192 |
||
2193 |
void TemplateTable::if_acmp(Condition cc) { |
|
2194 |
transition(atos, vtos); |
|
2195 |
// assume branch is more often taken than not (loops use backward branches) |
|
2196 |
Label not_taken; |
|
2197 |
__ pop_ptr(rdx); |
|
1066 | 2198 |
__ cmpptr(rdx, rax); |
1 | 2199 |
__ jcc(j_not(cc), not_taken); |
2200 |
branch(false, false); |
|
2201 |
__ bind(not_taken); |
|
2202 |
__ profile_not_taken_branch(rax); |
|
2203 |
} |
|
2204 |
||
2205 |
void TemplateTable::ret() { |
|
2206 |
transition(vtos, vtos); |
|
2207 |
locals_index(rbx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2208 |
LP64_ONLY(__ movslq(rbx, iaddress(rbx))); // get return bci, compute return bcp |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2209 |
NOT_LP64(__ movptr(rbx, iaddress(rbx))); |
1 | 2210 |
__ profile_ret(rbx, rcx); |
2211 |
__ get_method(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2212 |
__ movptr(rbcp, Address(rax, Method::const_offset())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2213 |
__ lea(rbcp, Address(rbcp, rbx, Address::times_1, |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2214 |
ConstMethod::codes_offset())); |
1 | 2215 |
__ dispatch_next(vtos); |
2216 |
} |
|
2217 |
||
2218 |
void TemplateTable::wide_ret() { |
|
2219 |
transition(vtos, vtos); |
|
2220 |
locals_index_wide(rbx); |
|
1066 | 2221 |
__ movptr(rbx, aaddress(rbx)); // get return bci, compute return bcp |
1 | 2222 |
__ profile_ret(rbx, rcx); |
2223 |
__ get_method(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2224 |
__ movptr(rbcp, Address(rax, Method::const_offset())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2225 |
__ lea(rbcp, Address(rbcp, rbx, Address::times_1, ConstMethod::codes_offset())); |
1 | 2226 |
__ dispatch_next(vtos); |
2227 |
} |
|
2228 |
||
2229 |
void TemplateTable::tableswitch() { |
|
2230 |
Label default_case, continue_execution; |
|
2231 |
transition(itos, vtos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2232 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2233 |
// align r13/rsi |
1066 | 2234 |
__ lea(rbx, at_bcp(BytesPerInt)); |
2235 |
__ andptr(rbx, -BytesPerInt); |
|
1 | 2236 |
// load lo & hi |
2237 |
__ movl(rcx, Address(rbx, BytesPerInt)); |
|
2238 |
__ movl(rdx, Address(rbx, 2 * BytesPerInt)); |
|
2239 |
__ bswapl(rcx); |
|
2240 |
__ bswapl(rdx); |
|
2241 |
// check against lo & hi |
|
2242 |
__ cmpl(rax, rcx); |
|
2243 |
__ jcc(Assembler::less, default_case); |
|
2244 |
__ cmpl(rax, rdx); |
|
2245 |
__ jcc(Assembler::greater, default_case); |
|
2246 |
// lookup dispatch offset |
|
2247 |
__ subl(rax, rcx); |
|
2248 |
__ movl(rdx, Address(rbx, rax, Address::times_4, 3 * BytesPerInt)); |
|
2249 |
__ profile_switch_case(rax, rbx, rcx); |
|
2250 |
// continue execution |
|
2251 |
__ bind(continue_execution); |
|
2252 |
__ bswapl(rdx); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2253 |
LP64_ONLY(__ movl2ptr(rdx, rdx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2254 |
__ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2255 |
__ addptr(rbcp, rdx); |
1 | 2256 |
__ dispatch_only(vtos); |
2257 |
// handle default |
|
2258 |
__ bind(default_case); |
|
2259 |
__ profile_switch_default(rax); |
|
2260 |
__ movl(rdx, Address(rbx, 0)); |
|
2261 |
__ jmp(continue_execution); |
|
2262 |
} |
|
2263 |
||
2264 |
void TemplateTable::lookupswitch() { |
|
2265 |
transition(itos, itos); |
|
2266 |
__ stop("lookupswitch bytecode should have been rewritten"); |
|
2267 |
} |
|
2268 |
||
2269 |
void TemplateTable::fast_linearswitch() { |
|
2270 |
transition(itos, vtos); |
|
2271 |
Label loop_entry, loop, found, continue_execution; |
|
2272 |
// bswap rax so we can avoid bswapping the table entries |
|
2273 |
__ bswapl(rax); |
|
2274 |
// align r13 |
|
1066 | 2275 |
__ lea(rbx, at_bcp(BytesPerInt)); // btw: should be able to get rid of |
2276 |
// this instruction (change offsets |
|
2277 |
// below) |
|
2278 |
__ andptr(rbx, -BytesPerInt); |
|
1 | 2279 |
// set counter |
2280 |
__ movl(rcx, Address(rbx, BytesPerInt)); |
|
2281 |
__ bswapl(rcx); |
|
2282 |
__ jmpb(loop_entry); |
|
2283 |
// table search |
|
2284 |
__ bind(loop); |
|
2285 |
__ cmpl(rax, Address(rbx, rcx, Address::times_8, 2 * BytesPerInt)); |
|
2286 |
__ jcc(Assembler::equal, found); |
|
2287 |
__ bind(loop_entry); |
|
2288 |
__ decrementl(rcx); |
|
2289 |
__ jcc(Assembler::greaterEqual, loop); |
|
2290 |
// default case |
|
2291 |
__ profile_switch_default(rax); |
|
2292 |
__ movl(rdx, Address(rbx, 0)); |
|
2293 |
__ jmp(continue_execution); |
|
2294 |
// entry found -> get offset |
|
2295 |
__ bind(found); |
|
2296 |
__ movl(rdx, Address(rbx, rcx, Address::times_8, 3 * BytesPerInt)); |
|
2297 |
__ profile_switch_case(rcx, rax, rbx); |
|
2298 |
// continue execution |
|
2299 |
__ bind(continue_execution); |
|
2300 |
__ bswapl(rdx); |
|
1066 | 2301 |
__ movl2ptr(rdx, rdx); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2302 |
__ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2303 |
__ addptr(rbcp, rdx); |
1 | 2304 |
__ dispatch_only(vtos); |
2305 |
} |
|
2306 |
||
2307 |
void TemplateTable::fast_binaryswitch() { |
|
2308 |
transition(itos, vtos); |
|
2309 |
// Implementation using the following core algorithm: |
|
2310 |
// |
|
2311 |
// int binary_search(int key, LookupswitchPair* array, int n) { |
|
2312 |
// // Binary search according to "Methodik des Programmierens" by |
|
2313 |
// // Edsger W. Dijkstra and W.H.J. Feijen, Addison Wesley Germany 1985. |
|
2314 |
// int i = 0; |
|
2315 |
// int j = n; |
|
2316 |
// while (i+1 < j) { |
|
2317 |
// // invariant P: 0 <= i < j <= n and (a[i] <= key < a[j] or Q) |
|
2318 |
// // with Q: for all i: 0 <= i < n: key < a[i] |
|
2319 |
// // where a stands for the array and assuming that the (inexisting) |
|
2320 |
// // element a[n] is infinitely big. |
|
2321 |
// int h = (i + j) >> 1; |
|
2322 |
// // i < h < j |
|
2323 |
// if (key < array[h].fast_match()) { |
|
2324 |
// j = h; |
|
2325 |
// } else { |
|
2326 |
// i = h; |
|
2327 |
// } |
|
2328 |
// } |
|
2329 |
// // R: a[i] <= key < a[i+1] or Q |
|
2330 |
// // (i.e., if key is within array, i is the correct index) |
|
2331 |
// return i; |
|
2332 |
// } |
|
2333 |
||
2334 |
// Register allocation |
|
2335 |
const Register key = rax; // already set (tosca) |
|
2336 |
const Register array = rbx; |
|
2337 |
const Register i = rcx; |
|
2338 |
const Register j = rdx; |
|
2339 |
const Register h = rdi; |
|
2340 |
const Register temp = rsi; |
|
2341 |
||
2342 |
// Find array start |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2343 |
NOT_LP64(__ save_bcp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2344 |
|
1066 | 2345 |
__ lea(array, at_bcp(3 * BytesPerInt)); // btw: should be able to |
2346 |
// get rid of this |
|
2347 |
// instruction (change |
|
2348 |
// offsets below) |
|
2349 |
__ andptr(array, -BytesPerInt); |
|
1 | 2350 |
|
2351 |
// Initialize i & j |
|
2352 |
__ xorl(i, i); // i = 0; |
|
2353 |
__ movl(j, Address(array, -BytesPerInt)); // j = length(array); |
|
2354 |
||
2355 |
// Convert j into native byteordering |
|
2356 |
__ bswapl(j); |
|
2357 |
||
2358 |
// And start |
|
2359 |
Label entry; |
|
2360 |
__ jmp(entry); |
|
2361 |
||
2362 |
// binary search loop |
|
2363 |
{ |
|
2364 |
Label loop; |
|
2365 |
__ bind(loop); |
|
2366 |
// int h = (i + j) >> 1; |
|
2367 |
__ leal(h, Address(i, j, Address::times_1)); // h = i + j; |
|
2368 |
__ sarl(h, 1); // h = (i + j) >> 1; |
|
2369 |
// if (key < array[h].fast_match()) { |
|
2370 |
// j = h; |
|
2371 |
// } else { |
|
2372 |
// i = h; |
|
2373 |
// } |
|
2374 |
// Convert array[h].match to native byte-ordering before compare |
|
2375 |
__ movl(temp, Address(array, h, Address::times_8)); |
|
2376 |
__ bswapl(temp); |
|
2377 |
__ cmpl(key, temp); |
|
2378 |
// j = h if (key < array[h].fast_match()) |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2379 |
__ cmov32(Assembler::less, j, h); |
1 | 2380 |
// i = h if (key >= array[h].fast_match()) |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2381 |
__ cmov32(Assembler::greaterEqual, i, h); |
1 | 2382 |
// while (i+1 < j) |
2383 |
__ bind(entry); |
|
2384 |
__ leal(h, Address(i, 1)); // i+1 |
|
2385 |
__ cmpl(h, j); // i+1 < j |
|
2386 |
__ jcc(Assembler::less, loop); |
|
2387 |
} |
|
2388 |
||
2389 |
// end of binary search, result index is i (must check again!) |
|
2390 |
Label default_case; |
|
2391 |
// Convert array[i].match to native byte-ordering before compare |
|
2392 |
__ movl(temp, Address(array, i, Address::times_8)); |
|
2393 |
__ bswapl(temp); |
|
2394 |
__ cmpl(key, temp); |
|
2395 |
__ jcc(Assembler::notEqual, default_case); |
|
2396 |
||
2397 |
// entry found -> j = offset |
|
2398 |
__ movl(j , Address(array, i, Address::times_8, BytesPerInt)); |
|
2399 |
__ profile_switch_case(i, key, array); |
|
2400 |
__ bswapl(j); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2401 |
LP64_ONLY(__ movslq(j, j)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2402 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2403 |
NOT_LP64(__ restore_bcp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2404 |
NOT_LP64(__ restore_locals()); // restore rdi |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2405 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2406 |
__ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2407 |
__ addptr(rbcp, j); |
1 | 2408 |
__ dispatch_only(vtos); |
2409 |
||
2410 |
// default case -> j = default offset |
|
2411 |
__ bind(default_case); |
|
2412 |
__ profile_switch_default(i); |
|
2413 |
__ movl(j, Address(array, -2 * BytesPerInt)); |
|
2414 |
__ bswapl(j); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2415 |
LP64_ONLY(__ movslq(j, j)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2416 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2417 |
NOT_LP64(__ restore_bcp()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2418 |
NOT_LP64(__ restore_locals()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2419 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2420 |
__ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2421 |
__ addptr(rbcp, j); |
1 | 2422 |
__ dispatch_only(vtos); |
2423 |
} |
|
2424 |
||
2425 |
void TemplateTable::_return(TosState state) { |
|
2426 |
transition(state, state); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2427 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2428 |
Register robj = LP64_ONLY(c_rarg1) NOT_LP64(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2429 |
|
1 | 2430 |
assert(_desc->calls_vm(), |
2431 |
"inconsistent calls_vm information"); // call in remove_activation |
|
2432 |
||
2433 |
if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { |
|
2434 |
assert(state == vtos, "only valid state"); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2435 |
__ movptr(robj, aaddress(0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2436 |
__ load_klass(rdi, robj); |
11430
718fc06da49a
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
10265
diff
changeset
|
2437 |
__ movl(rdi, Address(rdi, Klass::access_flags_offset())); |
1 | 2438 |
__ testl(rdi, JVM_ACC_HAS_FINALIZER); |
2439 |
Label skip_register_finalizer; |
|
2440 |
__ jcc(Assembler::zero, skip_register_finalizer); |
|
2441 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2442 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), robj); |
1 | 2443 |
|
2444 |
__ bind(skip_register_finalizer); |
|
2445 |
} |
|
2446 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2447 |
__ remove_activation(state, rbcp); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2448 |
__ jmp(rbcp); |
1 | 2449 |
} |
2450 |
||
2451 |
// ---------------------------------------------------------------------------- |
|
2452 |
// Volatile variables demand their effects be made known to all CPU's |
|
2453 |
// in order. Store buffers on most chips allow reads & writes to |
|
2454 |
// reorder; the JMM's ReadAfterWrite.java test fails in -Xint mode |
|
2455 |
// without some kind of memory barrier (i.e., it's not sufficient that |
|
2456 |
// the interpreter does not reorder volatile references, the hardware |
|
2457 |
// also must not reorder them). |
|
2458 |
// |
|
2459 |
// According to the new Java Memory Model (JMM): |
|
2460 |
// (1) All volatiles are serialized wrt to each other. ALSO reads & |
|
2461 |
// writes act as aquire & release, so: |
|
2462 |
// (2) A read cannot let unrelated NON-volatile memory refs that |
|
2463 |
// happen after the read float up to before the read. It's OK for |
|
2464 |
// non-volatile memory refs that happen before the volatile read to |
|
2465 |
// float down below it. |
|
2466 |
// (3) Similar a volatile write cannot let unrelated NON-volatile |
|
2467 |
// memory refs that happen BEFORE the write float down to after the |
|
2468 |
// write. It's OK for non-volatile memory refs that happen after the |
|
2469 |
// volatile write to float up before it. |
|
2470 |
// |
|
2471 |
// We only put in barriers around volatile refs (they are expensive), |
|
2472 |
// not _between_ memory refs (that would require us to track the |
|
2473 |
// flavor of the previous memory refs). Requirements (2) and (3) |
|
2474 |
// require some barriers before volatile stores and after volatile |
|
2475 |
// loads. These nearly cover requirement (1) but miss the |
|
2476 |
// volatile-store-volatile-load case. This final case is placed after |
|
2477 |
// volatile-stores although it could just as well go before |
|
2478 |
// volatile-loads. |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2479 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2480 |
void TemplateTable::volatile_barrier(Assembler::Membar_mask_bits order_constraint ) { |
1 | 2481 |
// Helper function to insert a is-volatile test and memory barrier |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2482 |
if(!os::is_MP()) return; // Not needed on single CPU |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2483 |
__ membar(order_constraint); |
1 | 2484 |
} |
2485 |
||
5688 | 2486 |
void TemplateTable::resolve_cache_and_index(int byte_no, |
2487 |
Register Rcache, |
|
2488 |
Register index, |
|
2489 |
size_t index_size) { |
|
1 | 2490 |
const Register temp = rbx; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2491 |
assert_different_registers(Rcache, index, temp); |
5688 | 2492 |
|
1 | 2493 |
Label resolved; |
5688 | 2494 |
assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2495 |
__ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2496 |
__ cmpl(temp, (int) bytecode()); // have we resolved this bytecode? |
4478 | 2497 |
__ jcc(Assembler::equal, resolved); |
1 | 2498 |
|
2499 |
// resolve first time through |
|
2500 |
address entry; |
|
2501 |
switch (bytecode()) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2502 |
case Bytecodes::_getstatic : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2503 |
case Bytecodes::_putstatic : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2504 |
case Bytecodes::_getfield : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2505 |
case Bytecodes::_putfield : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_get_put); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2506 |
case Bytecodes::_invokevirtual : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2507 |
case Bytecodes::_invokespecial : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2508 |
case Bytecodes::_invokestatic : // fall through |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2509 |
case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2510 |
case Bytecodes::_invokehandle : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokehandle); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2511 |
case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2512 |
default: |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2513 |
fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode()))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2514 |
break; |
1 | 2515 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2516 |
__ movl(temp, (int)bytecode()); |
1 | 2517 |
__ call_VM(noreg, entry, temp); |
2518 |
// Update registers with resolved info |
|
5688 | 2519 |
__ get_cache_and_index_at_bcp(Rcache, index, 1, index_size); |
1 | 2520 |
__ bind(resolved); |
2521 |
} |
|
2522 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2523 |
// The cache and index registers must be set before call |
1 | 2524 |
void TemplateTable::load_field_cp_cache_entry(Register obj, |
2525 |
Register cache, |
|
2526 |
Register index, |
|
2527 |
Register off, |
|
2528 |
Register flags, |
|
2529 |
bool is_static = false) { |
|
2530 |
assert_different_registers(cache, index, flags, off); |
|
2531 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2532 |
ByteSize cp_base_offset = ConstantPoolCache::base_offset(); |
1 | 2533 |
// Field offset |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2534 |
__ movptr(off, Address(cache, index, Address::times_ptr, |
1066 | 2535 |
in_bytes(cp_base_offset + |
2536 |
ConstantPoolCacheEntry::f2_offset()))); |
|
1 | 2537 |
// Flags |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2538 |
__ movl(flags, Address(cache, index, Address::times_ptr, |
1 | 2539 |
in_bytes(cp_base_offset + |
2540 |
ConstantPoolCacheEntry::flags_offset()))); |
|
2541 |
||
2542 |
// klass overwrite register |
|
2543 |
if (is_static) { |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2544 |
__ movptr(obj, Address(cache, index, Address::times_ptr, |
1066 | 2545 |
in_bytes(cp_base_offset + |
2546 |
ConstantPoolCacheEntry::f1_offset()))); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2547 |
const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2548 |
__ movptr(obj, Address(obj, mirror_offset)); |
1 | 2549 |
} |
2550 |
} |
|
2551 |
||
2552 |
void TemplateTable::load_invoke_cp_cache_entry(int byte_no, |
|
2553 |
Register method, |
|
2554 |
Register itable_index, |
|
2555 |
Register flags, |
|
2556 |
bool is_invokevirtual, |
|
5688 | 2557 |
bool is_invokevfinal, /*unused*/ |
2558 |
bool is_invokedynamic) { |
|
1 | 2559 |
// setup registers |
2560 |
const Register cache = rcx; |
|
2561 |
const Register index = rdx; |
|
2562 |
assert_different_registers(method, flags); |
|
2563 |
assert_different_registers(method, cache, index); |
|
2564 |
assert_different_registers(itable_index, flags); |
|
2565 |
assert_different_registers(itable_index, cache, index); |
|
2566 |
// determine constant pool cache field offsets |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2567 |
assert(is_invokevirtual == (byte_no == f2_byte), "is_invokevirtual flag redundant"); |
1 | 2568 |
const int method_offset = in_bytes( |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2569 |
ConstantPoolCache::base_offset() + |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2570 |
((byte_no == f2_byte) |
1 | 2571 |
? ConstantPoolCacheEntry::f2_offset() |
2572 |
: ConstantPoolCacheEntry::f1_offset())); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2573 |
const int flags_offset = in_bytes(ConstantPoolCache::base_offset() + |
1 | 2574 |
ConstantPoolCacheEntry::flags_offset()); |
2575 |
// access constant pool cache fields |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2576 |
const int index_offset = in_bytes(ConstantPoolCache::base_offset() + |
1 | 2577 |
ConstantPoolCacheEntry::f2_offset()); |
2578 |
||
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
2579 |
size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2)); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2580 |
resolve_cache_and_index(byte_no, cache, index, index_size); |
5688 | 2581 |
__ movptr(method, Address(cache, index, Address::times_ptr, method_offset)); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2582 |
|
1 | 2583 |
if (itable_index != noreg) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2584 |
// pick up itable or appendix index from f2 also: |
5688 | 2585 |
__ movptr(itable_index, Address(cache, index, Address::times_ptr, index_offset)); |
1 | 2586 |
} |
5688 | 2587 |
__ movl(flags, Address(cache, index, Address::times_ptr, flags_offset)); |
1 | 2588 |
} |
2589 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2590 |
// The registers cache and index expected to be set before call. |
1 | 2591 |
// Correct values of the cache and index registers are preserved. |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2592 |
void TemplateTable::jvmti_post_field_access(Register cache, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2593 |
Register index, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2594 |
bool is_static, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2595 |
bool has_tos) { |
1 | 2596 |
if (JvmtiExport::can_post_field_access()) { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2597 |
// Check to see if a field access watch has been set before we take |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2598 |
// the time to call into the VM. |
1 | 2599 |
Label L1; |
2600 |
assert_different_registers(cache, index, rax); |
|
2601 |
__ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr())); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2602 |
__ testl(rax,rax); |
1 | 2603 |
__ jcc(Assembler::zero, L1); |
2604 |
||
2605 |
// cache entry pointer |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2606 |
__ addptr(cache, in_bytes(ConstantPoolCache::base_offset())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2607 |
__ shll(index, LogBytesPerWord); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2608 |
__ addptr(cache, index); |
1 | 2609 |
if (is_static) { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2610 |
__ xorptr(rax, rax); // NULL object reference |
1 | 2611 |
} else { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2612 |
__ pop(atos); // Get the object |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2613 |
__ verify_oop(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2614 |
__ push(atos); // Restore stack state |
1 | 2615 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2616 |
// rax,: object pointer or NULL |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2617 |
// cache: cache entry pointer |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2618 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access), |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2619 |
rax, cache); |
1 | 2620 |
__ get_cache_and_index_at_bcp(cache, index, 1); |
2621 |
__ bind(L1); |
|
2622 |
} |
|
2623 |
} |
|
2624 |
||
2625 |
void TemplateTable::pop_and_check_object(Register r) { |
|
2626 |
__ pop_ptr(r); |
|
2627 |
__ null_check(r); // for field access must check obj. |
|
2628 |
__ verify_oop(r); |
|
2629 |
} |
|
2630 |
||
2631 |
void TemplateTable::getfield_or_static(int byte_no, bool is_static) { |
|
2632 |
transition(vtos, vtos); |
|
2633 |
||
2634 |
const Register cache = rcx; |
|
2635 |
const Register index = rdx; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2636 |
const Register obj = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
1 | 2637 |
const Register off = rbx; |
2638 |
const Register flags = rax; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2639 |
const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); // uses same reg as obj, so don't mix them |
1 | 2640 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2641 |
resolve_cache_and_index(byte_no, cache, index, sizeof(u2)); |
1 | 2642 |
jvmti_post_field_access(cache, index, is_static, false); |
2643 |
load_field_cp_cache_entry(obj, cache, index, off, flags, is_static); |
|
2644 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2645 |
if (!is_static) pop_and_check_object(obj); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2646 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2647 |
const Address field(obj, off, Address::times_1, 0*wordSize); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2648 |
NOT_LP64(const Address hi(obj, off, Address::times_1, 1*wordSize)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2649 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2650 |
Label Done, notByte, notInt, notShort, notChar, notLong, notFloat, notObj, notDouble; |
1 | 2651 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2652 |
__ shrl(flags, ConstantPoolCacheEntry::tos_state_shift); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2653 |
// Make sure we don't need to mask edx after the above shift |
1 | 2654 |
assert(btos == 0, "change code, btos != 0"); |
2655 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2656 |
__ andl(flags, ConstantPoolCacheEntry::tos_state_mask); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2657 |
|
1 | 2658 |
__ jcc(Assembler::notZero, notByte); |
2659 |
// btos |
|
2660 |
__ load_signed_byte(rax, field); |
|
2661 |
__ push(btos); |
|
2662 |
// Rewrite bytecode to be faster |
|
2663 |
if (!is_static) { |
|
2664 |
patch_bytecode(Bytecodes::_fast_bgetfield, bc, rbx); |
|
2665 |
} |
|
2666 |
__ jmp(Done); |
|
2667 |
||
2668 |
__ bind(notByte); |
|
2669 |
__ cmpl(flags, atos); |
|
2670 |
__ jcc(Assembler::notEqual, notObj); |
|
2671 |
// atos |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
2672 |
__ load_heap_oop(rax, field); |
1 | 2673 |
__ push(atos); |
2674 |
if (!is_static) { |
|
2675 |
patch_bytecode(Bytecodes::_fast_agetfield, bc, rbx); |
|
2676 |
} |
|
2677 |
__ jmp(Done); |
|
2678 |
||
2679 |
__ bind(notObj); |
|
2680 |
__ cmpl(flags, itos); |
|
2681 |
__ jcc(Assembler::notEqual, notInt); |
|
2682 |
// itos |
|
2683 |
__ movl(rax, field); |
|
2684 |
__ push(itos); |
|
2685 |
// Rewrite bytecode to be faster |
|
2686 |
if (!is_static) { |
|
2687 |
patch_bytecode(Bytecodes::_fast_igetfield, bc, rbx); |
|
2688 |
} |
|
2689 |
__ jmp(Done); |
|
2690 |
||
2691 |
__ bind(notInt); |
|
2692 |
__ cmpl(flags, ctos); |
|
2693 |
__ jcc(Assembler::notEqual, notChar); |
|
2694 |
// ctos |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
2695 |
__ load_unsigned_short(rax, field); |
1 | 2696 |
__ push(ctos); |
2697 |
// Rewrite bytecode to be faster |
|
2698 |
if (!is_static) { |
|
2699 |
patch_bytecode(Bytecodes::_fast_cgetfield, bc, rbx); |
|
2700 |
} |
|
2701 |
__ jmp(Done); |
|
2702 |
||
2703 |
__ bind(notChar); |
|
2704 |
__ cmpl(flags, stos); |
|
2705 |
__ jcc(Assembler::notEqual, notShort); |
|
2706 |
// stos |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
2707 |
__ load_signed_short(rax, field); |
1 | 2708 |
__ push(stos); |
2709 |
// Rewrite bytecode to be faster |
|
2710 |
if (!is_static) { |
|
2711 |
patch_bytecode(Bytecodes::_fast_sgetfield, bc, rbx); |
|
2712 |
} |
|
2713 |
__ jmp(Done); |
|
2714 |
||
2715 |
__ bind(notShort); |
|
2716 |
__ cmpl(flags, ltos); |
|
2717 |
__ jcc(Assembler::notEqual, notLong); |
|
2718 |
// ltos |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2719 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2720 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2721 |
// Generate code as if volatile. There just aren't enough registers to |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2722 |
// save that information and this code is faster than the test. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2723 |
__ fild_d(field); // Must load atomically |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2724 |
__ subptr(rsp,2*wordSize); // Make space for store |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2725 |
__ fistp_d(Address(rsp,0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2726 |
__ pop(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2727 |
__ pop(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2728 |
#else |
1 | 2729 |
__ movq(rax, field); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2730 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2731 |
|
1 | 2732 |
__ push(ltos); |
2733 |
// Rewrite bytecode to be faster |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2734 |
LP64_ONLY(if (!is_static) patch_bytecode(Bytecodes::_fast_lgetfield, bc, rbx)); |
1 | 2735 |
__ jmp(Done); |
2736 |
||
2737 |
__ bind(notLong); |
|
2738 |
__ cmpl(flags, ftos); |
|
2739 |
__ jcc(Assembler::notEqual, notFloat); |
|
2740 |
// ftos |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2741 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2742 |
LP64_ONLY(__ movflt(xmm0, field)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2743 |
NOT_LP64(__ fld_s(field)); |
1 | 2744 |
__ push(ftos); |
2745 |
// Rewrite bytecode to be faster |
|
2746 |
if (!is_static) { |
|
2747 |
patch_bytecode(Bytecodes::_fast_fgetfield, bc, rbx); |
|
2748 |
} |
|
2749 |
__ jmp(Done); |
|
2750 |
||
2751 |
__ bind(notFloat); |
|
2752 |
#ifdef ASSERT |
|
2753 |
__ cmpl(flags, dtos); |
|
2754 |
__ jcc(Assembler::notEqual, notDouble); |
|
2755 |
#endif |
|
2756 |
// dtos |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2757 |
LP64_ONLY(__ movdbl(xmm0, field)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2758 |
NOT_LP64(__ fld_d(field)); |
1 | 2759 |
__ push(dtos); |
2760 |
// Rewrite bytecode to be faster |
|
2761 |
if (!is_static) { |
|
2762 |
patch_bytecode(Bytecodes::_fast_dgetfield, bc, rbx); |
|
2763 |
} |
|
2764 |
#ifdef ASSERT |
|
2765 |
__ jmp(Done); |
|
2766 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2767 |
|
1 | 2768 |
__ bind(notDouble); |
2769 |
__ stop("Bad state"); |
|
2770 |
#endif |
|
2771 |
||
2772 |
__ bind(Done); |
|
2773 |
// [jk] not needed currently |
|
2774 |
// volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadLoad | |
|
2775 |
// Assembler::LoadStore)); |
|
2776 |
} |
|
2777 |
||
2778 |
void TemplateTable::getfield(int byte_no) { |
|
2779 |
getfield_or_static(byte_no, false); |
|
2780 |
} |
|
2781 |
||
2782 |
void TemplateTable::getstatic(int byte_no) { |
|
2783 |
getfield_or_static(byte_no, true); |
|
2784 |
} |
|
2785 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2786 |
|
1 | 2787 |
// The registers cache and index expected to be set before call. |
2788 |
// The function may destroy various registers, just not the cache and index registers. |
|
2789 |
void TemplateTable::jvmti_post_field_mod(Register cache, Register index, bool is_static) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2790 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2791 |
const Register robj = LP64_ONLY(c_rarg2) NOT_LP64(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2792 |
const Register RBX = LP64_ONLY(c_rarg1) NOT_LP64(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2793 |
const Register RCX = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2794 |
const Register RDX = LP64_ONLY(rscratch1) NOT_LP64(rdx); |
1 | 2795 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2796 |
ByteSize cp_base_offset = ConstantPoolCache::base_offset(); |
1 | 2797 |
|
2798 |
if (JvmtiExport::can_post_field_modification()) { |
|
2799 |
// Check to see if a field modification watch has been set before |
|
2800 |
// we take the time to call into the VM. |
|
2801 |
Label L1; |
|
2802 |
assert_different_registers(cache, index, rax); |
|
2803 |
__ mov32(rax, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr())); |
|
2804 |
__ testl(rax, rax); |
|
2805 |
__ jcc(Assembler::zero, L1); |
|
2806 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2807 |
__ get_cache_and_index_at_bcp(robj, RDX, 1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2808 |
|
1 | 2809 |
|
2810 |
if (is_static) { |
|
2811 |
// Life is simple. Null out the object pointer. |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2812 |
__ xorl(RBX, RBX); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2813 |
|
1 | 2814 |
} else { |
2815 |
// Life is harder. The stack holds the value on top, followed by |
|
2816 |
// the object. We don't know the size of the value, though; it |
|
2817 |
// could be one or two words depending on its type. As a result, |
|
2818 |
// we must find the type to determine where the object is. |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2819 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2820 |
Label two_word, valsize_known; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2821 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2822 |
__ movl(RCX, Address(robj, RDX, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2823 |
Address::times_ptr, |
1 | 2824 |
in_bytes(cp_base_offset + |
2825 |
ConstantPoolCacheEntry::flags_offset()))); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2826 |
NOT_LP64(__ mov(rbx, rsp)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2827 |
__ shrl(RCX, ConstantPoolCacheEntry::tos_state_shift); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2828 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2829 |
// Make sure we don't need to mask rcx after the above shift |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2830 |
ConstantPoolCacheEntry::verify_tos_state_shift(); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2831 |
#ifdef _LP64 |
1066 | 2832 |
__ movptr(c_rarg1, at_tos_p1()); // initially assume a one word jvalue |
1 | 2833 |
__ cmpl(c_rarg3, ltos); |
1066 | 2834 |
__ cmovptr(Assembler::equal, |
2835 |
c_rarg1, at_tos_p2()); // ltos (two word jvalue) |
|
1 | 2836 |
__ cmpl(c_rarg3, dtos); |
1066 | 2837 |
__ cmovptr(Assembler::equal, |
2838 |
c_rarg1, at_tos_p2()); // dtos (two word jvalue) |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2839 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2840 |
__ cmpl(rcx, ltos); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2841 |
__ jccb(Assembler::equal, two_word); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2842 |
__ cmpl(rcx, dtos); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2843 |
__ jccb(Assembler::equal, two_word); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2844 |
__ addptr(rbx, Interpreter::expr_offset_in_bytes(1)); // one word jvalue (not ltos, dtos) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2845 |
__ jmpb(valsize_known); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2846 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2847 |
__ bind(two_word); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2848 |
__ addptr(rbx, Interpreter::expr_offset_in_bytes(2)); // two words jvalue |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2849 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2850 |
__ bind(valsize_known); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2851 |
// setup object pointer |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2852 |
__ movptr(rbx, Address(rbx, 0)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2853 |
#endif |
1 | 2854 |
} |
2855 |
// cache entry pointer |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2856 |
__ addptr(robj, in_bytes(cp_base_offset)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2857 |
__ shll(RDX, LogBytesPerWord); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2858 |
__ addptr(robj, RDX); |
1 | 2859 |
// object (tos) |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2860 |
__ mov(RCX, rsp); |
1 | 2861 |
// c_rarg1: object pointer set up above (NULL if static) |
2862 |
// c_rarg2: cache entry pointer |
|
2863 |
// c_rarg3: jvalue object on the stack |
|
2864 |
__ call_VM(noreg, |
|
2865 |
CAST_FROM_FN_PTR(address, |
|
2866 |
InterpreterRuntime::post_field_modification), |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2867 |
RBX, robj, RCX); |
1 | 2868 |
__ get_cache_and_index_at_bcp(cache, index, 1); |
2869 |
__ bind(L1); |
|
2870 |
} |
|
2871 |
} |
|
2872 |
||
2873 |
void TemplateTable::putfield_or_static(int byte_no, bool is_static) { |
|
2874 |
transition(vtos, vtos); |
|
2875 |
||
2876 |
const Register cache = rcx; |
|
2877 |
const Register index = rdx; |
|
2878 |
const Register obj = rcx; |
|
2879 |
const Register off = rbx; |
|
2880 |
const Register flags = rax; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2881 |
const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
1 | 2882 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
2883 |
resolve_cache_and_index(byte_no, cache, index, sizeof(u2)); |
1 | 2884 |
jvmti_post_field_mod(cache, index, is_static); |
2885 |
load_field_cp_cache_entry(obj, cache, index, off, flags, is_static); |
|
2886 |
||
2887 |
// [jk] not needed currently |
|
2888 |
// volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadStore | |
|
2889 |
// Assembler::StoreStore)); |
|
2890 |
||
2891 |
Label notVolatile, Done; |
|
2892 |
__ movl(rdx, flags); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2893 |
__ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift); |
1 | 2894 |
__ andl(rdx, 0x1); |
2895 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2896 |
// field addresses |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2897 |
const Address field(obj, off, Address::times_1, 0*wordSize); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2898 |
NOT_LP64( const Address hi(obj, off, Address::times_1, 1*wordSize);) |
1 | 2899 |
|
2900 |
Label notByte, notInt, notShort, notChar, |
|
2901 |
notLong, notFloat, notObj, notDouble; |
|
2902 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2903 |
__ shrl(flags, ConstantPoolCacheEntry::tos_state_shift); |
1 | 2904 |
|
2905 |
assert(btos == 0, "change code, btos != 0"); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
2906 |
__ andl(flags, ConstantPoolCacheEntry::tos_state_mask); |
1 | 2907 |
__ jcc(Assembler::notZero, notByte); |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2908 |
|
1 | 2909 |
// btos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2910 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2911 |
__ pop(btos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2912 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2913 |
__ movb(field, rax); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2914 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2915 |
patch_bytecode(Bytecodes::_fast_bputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2916 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2917 |
__ jmp(Done); |
1 | 2918 |
} |
2919 |
||
2920 |
__ bind(notByte); |
|
2921 |
__ cmpl(flags, atos); |
|
2922 |
__ jcc(Assembler::notEqual, notObj); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2923 |
|
1 | 2924 |
// atos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2925 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2926 |
__ pop(atos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2927 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2928 |
// Store into the field |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2929 |
do_oop_store(_masm, field, rax, _bs->kind(), false); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2930 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2931 |
patch_bytecode(Bytecodes::_fast_aputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2932 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2933 |
__ jmp(Done); |
1 | 2934 |
} |
2935 |
||
2936 |
__ bind(notObj); |
|
2937 |
__ cmpl(flags, itos); |
|
2938 |
__ jcc(Assembler::notEqual, notInt); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2939 |
|
1 | 2940 |
// itos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2941 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2942 |
__ pop(itos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2943 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2944 |
__ movl(field, rax); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2945 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2946 |
patch_bytecode(Bytecodes::_fast_iputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2947 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2948 |
__ jmp(Done); |
1 | 2949 |
} |
2950 |
||
2951 |
__ bind(notInt); |
|
2952 |
__ cmpl(flags, ctos); |
|
2953 |
__ jcc(Assembler::notEqual, notChar); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2954 |
|
1 | 2955 |
// ctos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2956 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2957 |
__ pop(ctos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2958 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2959 |
__ movw(field, rax); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2960 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2961 |
patch_bytecode(Bytecodes::_fast_cputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2962 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2963 |
__ jmp(Done); |
1 | 2964 |
} |
2965 |
||
2966 |
__ bind(notChar); |
|
2967 |
__ cmpl(flags, stos); |
|
2968 |
__ jcc(Assembler::notEqual, notShort); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2969 |
|
1 | 2970 |
// stos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2971 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2972 |
__ pop(stos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2973 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2974 |
__ movw(field, rax); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2975 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2976 |
patch_bytecode(Bytecodes::_fast_sputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2977 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2978 |
__ jmp(Done); |
1 | 2979 |
} |
2980 |
||
2981 |
__ bind(notShort); |
|
2982 |
__ cmpl(flags, ltos); |
|
2983 |
__ jcc(Assembler::notEqual, notLong); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2984 |
|
1 | 2985 |
// ltos |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2986 |
#ifdef _LP64 |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2987 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2988 |
__ pop(ltos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2989 |
if (!is_static) pop_and_check_object(obj); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2990 |
__ movq(field, rax); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2991 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2992 |
patch_bytecode(Bytecodes::_fast_lputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2993 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
2994 |
__ jmp(Done); |
1 | 2995 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2996 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2997 |
{ |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2998 |
Label notVolatileLong; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
2999 |
__ testl(rdx, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3000 |
__ jcc(Assembler::zero, notVolatileLong); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3001 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3002 |
__ pop(ltos); // overwrites rdx, do this after testing volatile. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3003 |
if (!is_static) pop_and_check_object(obj); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3004 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3005 |
// Replace with real volatile test |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3006 |
__ push(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3007 |
__ push(rax); // Must update atomically with FIST |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3008 |
__ fild_d(Address(rsp,0)); // So load into FPU register |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3009 |
__ fistp_d(field); // and put into memory atomically |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3010 |
__ addptr(rsp, 2*wordSize); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3011 |
// volatile_barrier(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3012 |
volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad | |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3013 |
Assembler::StoreStore)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3014 |
// Don't rewrite volatile version |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3015 |
__ jmp(notVolatile); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3016 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3017 |
__ bind(notVolatileLong); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3018 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3019 |
__ pop(ltos); // overwrites rdx |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3020 |
if (!is_static) pop_and_check_object(obj); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3021 |
__ movptr(hi, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3022 |
__ movptr(field, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3023 |
// Don't rewrite to _fast_lputfield for potential volatile case. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3024 |
__ jmp(notVolatile); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3025 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3026 |
#endif // _LP64 |
1 | 3027 |
|
3028 |
__ bind(notLong); |
|
3029 |
__ cmpl(flags, ftos); |
|
3030 |
__ jcc(Assembler::notEqual, notFloat); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3031 |
|
1 | 3032 |
// ftos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3033 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3034 |
__ pop(ftos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3035 |
if (!is_static) pop_and_check_object(obj); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3036 |
NOT_LP64( __ fstp_s(field);) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3037 |
LP64_ONLY( __ movflt(field, xmm0);) |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3038 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3039 |
patch_bytecode(Bytecodes::_fast_fputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3040 |
} |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3041 |
__ jmp(Done); |
1 | 3042 |
} |
3043 |
||
3044 |
__ bind(notFloat); |
|
3045 |
#ifdef ASSERT |
|
3046 |
__ cmpl(flags, dtos); |
|
3047 |
__ jcc(Assembler::notEqual, notDouble); |
|
3048 |
#endif |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3049 |
|
1 | 3050 |
// dtos |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3051 |
{ |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3052 |
__ pop(dtos); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3053 |
if (!is_static) pop_and_check_object(obj); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3054 |
NOT_LP64( __ fstp_d(field);) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3055 |
LP64_ONLY( __ movdbl(field, xmm0);) |
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3056 |
if (!is_static) { |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3057 |
patch_bytecode(Bytecodes::_fast_dputfield, bc, rbx, true, byte_no); |
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3058 |
} |
1 | 3059 |
} |
3060 |
||
3061 |
#ifdef ASSERT |
|
3062 |
__ jmp(Done); |
|
3063 |
||
3064 |
__ bind(notDouble); |
|
3065 |
__ stop("Bad state"); |
|
3066 |
#endif |
|
3067 |
||
3068 |
__ bind(Done); |
|
10265
4c869854aebd
7071653: JSR 292: call site change notification should be pushed not pulled
twisti
parents:
10008
diff
changeset
|
3069 |
|
1 | 3070 |
// Check for volatile store |
3071 |
__ testl(rdx, rdx); |
|
3072 |
__ jcc(Assembler::zero, notVolatile); |
|
3073 |
volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad | |
|
3074 |
Assembler::StoreStore)); |
|
3075 |
__ bind(notVolatile); |
|
3076 |
} |
|
3077 |
||
3078 |
void TemplateTable::putfield(int byte_no) { |
|
3079 |
putfield_or_static(byte_no, false); |
|
3080 |
} |
|
3081 |
||
3082 |
void TemplateTable::putstatic(int byte_no) { |
|
3083 |
putfield_or_static(byte_no, true); |
|
3084 |
} |
|
3085 |
||
3086 |
void TemplateTable::jvmti_post_fast_field_mod() { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3087 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3088 |
const Register scratch = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3089 |
|
1 | 3090 |
if (JvmtiExport::can_post_field_modification()) { |
3091 |
// Check to see if a field modification watch has been set before |
|
3092 |
// we take the time to call into the VM. |
|
3093 |
Label L2; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3094 |
__ mov32(scratch, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3095 |
__ testl(scratch, scratch); |
1 | 3096 |
__ jcc(Assembler::zero, L2); |
3097 |
__ pop_ptr(rbx); // copy the object pointer from tos |
|
3098 |
__ verify_oop(rbx); |
|
3099 |
__ push_ptr(rbx); // put the object pointer back on tos |
|
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3100 |
// Save tos values before call_VM() clobbers them. Since we have |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3101 |
// to do it for every data type, we use the saved values as the |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3102 |
// jvalue object. |
1 | 3103 |
switch (bytecode()) { // load values into the jvalue object |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3104 |
case Bytecodes::_fast_aputfield: __ push_ptr(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3105 |
case Bytecodes::_fast_bputfield: // fall through |
1 | 3106 |
case Bytecodes::_fast_sputfield: // fall through |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3107 |
case Bytecodes::_fast_cputfield: // fall through |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3108 |
case Bytecodes::_fast_iputfield: __ push_i(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3109 |
case Bytecodes::_fast_dputfield: __ push_d(); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3110 |
case Bytecodes::_fast_fputfield: __ push_f(); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3111 |
case Bytecodes::_fast_lputfield: __ push_l(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3112 |
|
1 | 3113 |
default: |
3114 |
ShouldNotReachHere(); |
|
3115 |
} |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3116 |
__ mov(scratch, rsp); // points to jvalue on the stack |
1 | 3117 |
// access constant pool cache entry |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3118 |
LP64_ONLY(__ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3119 |
NOT_LP64(__ get_cache_entry_pointer_at_bcp(rax, rdx, 1)); |
1 | 3120 |
__ verify_oop(rbx); |
3121 |
// rbx: object pointer copied above |
|
3122 |
// c_rarg2: cache entry pointer |
|
3123 |
// c_rarg3: jvalue object on the stack |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3124 |
LP64_ONLY(__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, c_rarg2, c_rarg3)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3125 |
NOT_LP64(__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx)); |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3126 |
|
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3127 |
switch (bytecode()) { // restore tos values |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3128 |
case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3129 |
case Bytecodes::_fast_bputfield: // fall through |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3130 |
case Bytecodes::_fast_sputfield: // fall through |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3131 |
case Bytecodes::_fast_cputfield: // fall through |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3132 |
case Bytecodes::_fast_iputfield: __ pop_i(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3133 |
case Bytecodes::_fast_dputfield: __ pop_d(); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3134 |
case Bytecodes::_fast_fputfield: __ pop_f(); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3135 |
case Bytecodes::_fast_lputfield: __ pop_l(rax); break; |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
11439
diff
changeset
|
3136 |
} |
1 | 3137 |
__ bind(L2); |
3138 |
} |
|
3139 |
} |
|
3140 |
||
3141 |
void TemplateTable::fast_storefield(TosState state) { |
|
3142 |
transition(state, vtos); |
|
3143 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3144 |
ByteSize base = ConstantPoolCache::base_offset(); |
1 | 3145 |
|
3146 |
jvmti_post_fast_field_mod(); |
|
3147 |
||
3148 |
// access constant pool cache |
|
3149 |
__ get_cache_and_index_at_bcp(rcx, rbx, 1); |
|
3150 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3151 |
// test for volatile with rdx but rdx is tos register for lputfield. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3152 |
__ movl(rdx, Address(rcx, rbx, Address::times_ptr, |
1 | 3153 |
in_bytes(base + |
3154 |
ConstantPoolCacheEntry::flags_offset()))); |
|
3155 |
||
3156 |
// replace index with field offset from cache entry |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3157 |
__ movptr(rbx, Address(rcx, rbx, Address::times_ptr, |
1066 | 3158 |
in_bytes(base + ConstantPoolCacheEntry::f2_offset()))); |
1 | 3159 |
|
3160 |
// [jk] not needed currently |
|
3161 |
// volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadStore | |
|
3162 |
// Assembler::StoreStore)); |
|
3163 |
||
3164 |
Label notVolatile; |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3165 |
__ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift); |
1 | 3166 |
__ andl(rdx, 0x1); |
3167 |
||
3168 |
// Get object from stack |
|
3169 |
pop_and_check_object(rcx); |
|
3170 |
||
3171 |
// field address |
|
3172 |
const Address field(rcx, rbx, Address::times_1); |
|
3173 |
||
3174 |
// access field |
|
3175 |
switch (bytecode()) { |
|
3176 |
case Bytecodes::_fast_aputfield: |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
360
diff
changeset
|
3177 |
do_oop_store(_masm, field, rax, _bs->kind(), false); |
1 | 3178 |
break; |
3179 |
case Bytecodes::_fast_lputfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3180 |
#ifdef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3181 |
__ movq(field, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3182 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3183 |
__ stop("should not be rewritten"); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3184 |
#endif |
1 | 3185 |
break; |
3186 |
case Bytecodes::_fast_iputfield: |
|
3187 |
__ movl(field, rax); |
|
3188 |
break; |
|
3189 |
case Bytecodes::_fast_bputfield: |
|
3190 |
__ movb(field, rax); |
|
3191 |
break; |
|
3192 |
case Bytecodes::_fast_sputfield: |
|
3193 |
// fall through |
|
3194 |
case Bytecodes::_fast_cputfield: |
|
3195 |
__ movw(field, rax); |
|
3196 |
break; |
|
3197 |
case Bytecodes::_fast_fputfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3198 |
NOT_LP64( __ fstp_s(field); ) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3199 |
LP64_ONLY( __ movflt(field, xmm0);) |
1 | 3200 |
break; |
3201 |
case Bytecodes::_fast_dputfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3202 |
NOT_LP64( __ fstp_d(field); ) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3203 |
LP64_ONLY( __ movdbl(field, xmm0);) |
1 | 3204 |
break; |
3205 |
default: |
|
3206 |
ShouldNotReachHere(); |
|
3207 |
} |
|
3208 |
||
3209 |
// Check for volatile store |
|
3210 |
__ testl(rdx, rdx); |
|
3211 |
__ jcc(Assembler::zero, notVolatile); |
|
3212 |
volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad | |
|
3213 |
Assembler::StoreStore)); |
|
3214 |
__ bind(notVolatile); |
|
3215 |
} |
|
3216 |
||
3217 |
void TemplateTable::fast_accessfield(TosState state) { |
|
3218 |
transition(atos, state); |
|
3219 |
||
3220 |
// Do the JVMTI work here to avoid disturbing the register state below |
|
3221 |
if (JvmtiExport::can_post_field_access()) { |
|
3222 |
// Check to see if a field access watch has been set before we |
|
3223 |
// take the time to call into the VM. |
|
3224 |
Label L1; |
|
3225 |
__ mov32(rcx, ExternalAddress((address) JvmtiExport::get_field_access_count_addr())); |
|
3226 |
__ testl(rcx, rcx); |
|
3227 |
__ jcc(Assembler::zero, L1); |
|
3228 |
// access constant pool cache entry |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3229 |
LP64_ONLY(__ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3230 |
NOT_LP64(__ get_cache_entry_pointer_at_bcp(rcx, rdx, 1)); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3231 |
__ verify_oop(rax); |
7401
ebde7415b521
6780143: hs203t003 hits SIGSEGV/EXCEPTION_ACCESS_VIOLATION with -XX:+UseCompressedOops
coleenp
parents:
7397
diff
changeset
|
3232 |
__ push_ptr(rax); // save object pointer before call_VM() clobbers it |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3233 |
LP64_ONLY(__ mov(c_rarg1, rax)); |
1 | 3234 |
// c_rarg1: object pointer copied above |
3235 |
// c_rarg2: cache entry pointer |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3236 |
LP64_ONLY(__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access), c_rarg1, c_rarg2)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3237 |
NOT_LP64(__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access), rax, rcx)); |
7401
ebde7415b521
6780143: hs203t003 hits SIGSEGV/EXCEPTION_ACCESS_VIOLATION with -XX:+UseCompressedOops
coleenp
parents:
7397
diff
changeset
|
3238 |
__ pop_ptr(rax); // restore object pointer |
1 | 3239 |
__ bind(L1); |
3240 |
} |
|
3241 |
||
3242 |
// access constant pool cache |
|
3243 |
__ get_cache_and_index_at_bcp(rcx, rbx, 1); |
|
3244 |
// replace index with field offset from cache entry |
|
3245 |
// [jk] not needed currently |
|
3246 |
// if (os::is_MP()) { |
|
3247 |
// __ movl(rdx, Address(rcx, rbx, Address::times_8, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3248 |
// in_bytes(ConstantPoolCache::base_offset() + |
1 | 3249 |
// ConstantPoolCacheEntry::flags_offset()))); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3250 |
// __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift); |
1 | 3251 |
// __ andl(rdx, 0x1); |
3252 |
// } |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3253 |
__ movptr(rbx, Address(rcx, rbx, Address::times_ptr, |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3254 |
in_bytes(ConstantPoolCache::base_offset() + |
1066 | 3255 |
ConstantPoolCacheEntry::f2_offset()))); |
1 | 3256 |
|
3257 |
// rax: object |
|
3258 |
__ verify_oop(rax); |
|
3259 |
__ null_check(rax); |
|
3260 |
Address field(rax, rbx, Address::times_1); |
|
3261 |
||
3262 |
// access field |
|
3263 |
switch (bytecode()) { |
|
3264 |
case Bytecodes::_fast_agetfield: |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3265 |
__ load_heap_oop(rax, field); |
1 | 3266 |
__ verify_oop(rax); |
3267 |
break; |
|
3268 |
case Bytecodes::_fast_lgetfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3269 |
#ifdef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3270 |
__ movq(rax, field); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3271 |
#else |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3272 |
__ stop("should not be rewritten"); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3273 |
#endif |
1 | 3274 |
break; |
3275 |
case Bytecodes::_fast_igetfield: |
|
3276 |
__ movl(rax, field); |
|
3277 |
break; |
|
3278 |
case Bytecodes::_fast_bgetfield: |
|
3279 |
__ movsbl(rax, field); |
|
3280 |
break; |
|
3281 |
case Bytecodes::_fast_sgetfield: |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
3282 |
__ load_signed_short(rax, field); |
1 | 3283 |
break; |
3284 |
case Bytecodes::_fast_cgetfield: |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
2131
diff
changeset
|
3285 |
__ load_unsigned_short(rax, field); |
1 | 3286 |
break; |
3287 |
case Bytecodes::_fast_fgetfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3288 |
LP64_ONLY(__ movflt(xmm0, field)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3289 |
NOT_LP64(__ fld_s(field)); |
1 | 3290 |
break; |
3291 |
case Bytecodes::_fast_dgetfield: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3292 |
LP64_ONLY(__ movdbl(xmm0, field)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3293 |
NOT_LP64(__ fld_d(field)); |
1 | 3294 |
break; |
3295 |
default: |
|
3296 |
ShouldNotReachHere(); |
|
3297 |
} |
|
3298 |
// [jk] not needed currently |
|
3299 |
// if (os::is_MP()) { |
|
3300 |
// Label notVolatile; |
|
3301 |
// __ testl(rdx, rdx); |
|
3302 |
// __ jcc(Assembler::zero, notVolatile); |
|
3303 |
// __ membar(Assembler::LoadLoad); |
|
3304 |
// __ bind(notVolatile); |
|
3305 |
//}; |
|
3306 |
} |
|
3307 |
||
3308 |
void TemplateTable::fast_xaccess(TosState state) { |
|
3309 |
transition(vtos, state); |
|
3310 |
||
3311 |
// get receiver |
|
1066 | 3312 |
__ movptr(rax, aaddress(0)); |
1 | 3313 |
// access constant pool cache |
3314 |
__ get_cache_and_index_at_bcp(rcx, rdx, 2); |
|
1066 | 3315 |
__ movptr(rbx, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3316 |
Address(rcx, rdx, Address::times_ptr, |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3317 |
in_bytes(ConstantPoolCache::base_offset() + |
1066 | 3318 |
ConstantPoolCacheEntry::f2_offset()))); |
1 | 3319 |
// make sure exception is reported in correct bcp range (getfield is |
3320 |
// next instruction) |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3321 |
__ increment(rbcp); |
1 | 3322 |
__ null_check(rax); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3323 |
const Address field = Address(rax, rbx, Address::times_1, 0*wordSize); |
1 | 3324 |
switch (state) { |
3325 |
case itos: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3326 |
__ movl(rax, field); |
1 | 3327 |
break; |
3328 |
case atos: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3329 |
__ load_heap_oop(rax, field); |
1 | 3330 |
__ verify_oop(rax); |
3331 |
break; |
|
3332 |
case ftos: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3333 |
LP64_ONLY(__ movflt(xmm0, field)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3334 |
NOT_LP64(__ fld_s(field)); |
1 | 3335 |
break; |
3336 |
default: |
|
3337 |
ShouldNotReachHere(); |
|
3338 |
} |
|
3339 |
||
3340 |
// [jk] not needed currently |
|
3341 |
// if (os::is_MP()) { |
|
3342 |
// Label notVolatile; |
|
3343 |
// __ movl(rdx, Address(rcx, rdx, Address::times_8, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3344 |
// in_bytes(ConstantPoolCache::base_offset() + |
1 | 3345 |
// ConstantPoolCacheEntry::flags_offset()))); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3346 |
// __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift); |
1 | 3347 |
// __ testl(rdx, 0x1); |
3348 |
// __ jcc(Assembler::zero, notVolatile); |
|
3349 |
// __ membar(Assembler::LoadLoad); |
|
3350 |
// __ bind(notVolatile); |
|
3351 |
// } |
|
3352 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3353 |
__ decrement(rbcp); |
1 | 3354 |
} |
3355 |
||
3356 |
//----------------------------------------------------------------------------- |
|
3357 |
// Calls |
|
3358 |
||
3359 |
void TemplateTable::count_calls(Register method, Register temp) { |
|
3360 |
// implemented elsewhere |
|
3361 |
ShouldNotReachHere(); |
|
3362 |
} |
|
3363 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3364 |
void TemplateTable::prepare_invoke(int byte_no, |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3365 |
Register method, // linked method (or i-klass) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3366 |
Register index, // itable index, MethodType, etc. |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3367 |
Register recv, // if caller wants to see it |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3368 |
Register flags // if caller wants to test it |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3369 |
) { |
1 | 3370 |
// determine flags |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3371 |
const Bytecodes::Code code = bytecode(); |
1 | 3372 |
const bool is_invokeinterface = code == Bytecodes::_invokeinterface; |
4478 | 3373 |
const bool is_invokedynamic = code == Bytecodes::_invokedynamic; |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3374 |
const bool is_invokehandle = code == Bytecodes::_invokehandle; |
1 | 3375 |
const bool is_invokevirtual = code == Bytecodes::_invokevirtual; |
3376 |
const bool is_invokespecial = code == Bytecodes::_invokespecial; |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3377 |
const bool load_receiver = (recv != noreg); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3378 |
const bool save_flags = (flags != noreg); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3379 |
assert(load_receiver == (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic), ""); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3380 |
assert(save_flags == (is_invokeinterface || is_invokevirtual), "need flags for vfinal"); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3381 |
assert(flags == noreg || flags == rdx, ""); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3382 |
assert(recv == noreg || recv == rcx, ""); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3383 |
|
1 | 3384 |
// setup registers & access constant pool cache |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3385 |
if (recv == noreg) recv = rcx; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3386 |
if (flags == noreg) flags = rdx; |
1 | 3387 |
assert_different_registers(method, index, recv, flags); |
3388 |
||
3389 |
// save 'interpreter return address' |
|
3390 |
__ save_bcp(); |
|
3391 |
||
5688 | 3392 |
load_invoke_cp_cache_entry(byte_no, method, index, flags, is_invokevirtual, false, is_invokedynamic); |
1 | 3393 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3394 |
// maybe push appendix to arguments (just before return address) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3395 |
if (is_invokedynamic || is_invokehandle) { |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3396 |
Label L_no_push; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3397 |
__ testl(flags, (1 << ConstantPoolCacheEntry::has_appendix_shift)); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3398 |
__ jcc(Assembler::zero, L_no_push); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3399 |
// Push the appendix as a trailing parameter. |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3400 |
// This must be done before we get the receiver, |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3401 |
// since the parameter_size includes it. |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3402 |
__ push(rbx); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3403 |
__ mov(rbx, index); |
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3404 |
assert(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset == 0, "appendix expected at index+0"); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3405 |
__ load_resolved_reference_at_index(index, rbx); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3406 |
__ pop(rbx); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3407 |
__ push(index); // push appendix (MethodType, CallSite, etc.) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3408 |
__ bind(L_no_push); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3409 |
} |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3410 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3411 |
// load receiver if needed (after appendix is pushed so parameter size is correct) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3412 |
// Note: no return address pushed yet |
1 | 3413 |
if (load_receiver) { |
3414 |
__ movl(recv, flags); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3415 |
__ andl(recv, ConstantPoolCacheEntry::parameter_size_mask); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3416 |
const int no_return_pc_pushed_yet = -1; // argument slot correction before we push return address |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3417 |
const int receiver_is_at_end = -1; // back off one slot to get receiver |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3418 |
Address recv_addr = __ argument_address(recv, no_return_pc_pushed_yet + receiver_is_at_end); |
5055 | 3419 |
__ movptr(recv, recv_addr); |
3420 |
__ verify_oop(recv); |
|
1 | 3421 |
} |
3422 |
||
3423 |
if (save_flags) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3424 |
__ movl(rbcp, flags); |
1 | 3425 |
} |
3426 |
||
3427 |
// compute return type |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3428 |
__ shrl(flags, ConstantPoolCacheEntry::tos_state_shift); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3429 |
// Make sure we don't need to mask flags after the above shift |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3430 |
ConstantPoolCacheEntry::verify_tos_state_shift(); |
1 | 3431 |
// load return address |
3432 |
{ |
|
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
20702
diff
changeset
|
3433 |
const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); |
4478 | 3434 |
ExternalAddress table(table_addr); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3435 |
LP64_ONLY(__ lea(rscratch1, table)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3436 |
LP64_ONLY(__ movptr(flags, Address(rscratch1, flags, Address::times_ptr))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3437 |
NOT_LP64(__ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr)))); |
1 | 3438 |
} |
3439 |
||
3440 |
// push return address |
|
1066 | 3441 |
__ push(flags); |
1 | 3442 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3443 |
// Restore flags value from the constant pool cache, and restore rsi |
1 | 3444 |
// for later null checks. r13 is the bytecode pointer |
3445 |
if (save_flags) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3446 |
__ movl(flags, rbcp); |
1 | 3447 |
__ restore_bcp(); |
3448 |
} |
|
3449 |
} |
|
3450 |
||
3451 |
void TemplateTable::invokevirtual_helper(Register index, |
|
3452 |
Register recv, |
|
3453 |
Register flags) { |
|
6453 | 3454 |
// Uses temporary registers rax, rdx |
3455 |
assert_different_registers(index, recv, rax, rdx); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3456 |
assert(index == rbx, ""); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3457 |
assert(recv == rcx, ""); |
1 | 3458 |
|
3459 |
// Test for an invoke of a final method |
|
3460 |
Label notFinal; |
|
3461 |
__ movl(rax, flags); |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3462 |
__ andl(rax, (1 << ConstantPoolCacheEntry::is_vfinal_shift)); |
1 | 3463 |
__ jcc(Assembler::zero, notFinal); |
3464 |
||
3465 |
const Register method = index; // method must be rbx |
|
3466 |
assert(method == rbx, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3467 |
"Method* must be rbx for interpreter calling convention"); |
1 | 3468 |
|
3469 |
// do the call - the index is actually the method to call |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3470 |
// that is, f2 is a vtable index if !is_vfinal, else f2 is a Method* |
1 | 3471 |
|
3472 |
// It's final, need a null check here! |
|
3473 |
__ null_check(recv); |
|
3474 |
||
3475 |
// profile this call |
|
3476 |
__ profile_final_call(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3477 |
__ profile_arguments_type(rax, method, rbcp, true); |
1 | 3478 |
|
3479 |
__ jump_from_interpreted(method, rax); |
|
3480 |
||
3481 |
__ bind(notFinal); |
|
3482 |
||
3483 |
// get receiver klass |
|
3484 |
__ null_check(recv, oopDesc::klass_offset_in_bytes()); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3485 |
__ load_klass(rax, recv); |
1 | 3486 |
|
3487 |
// profile this call |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3488 |
__ profile_virtual_call(rax, rlocals, rdx); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3489 |
// get target Method* & entry point |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3490 |
__ lookup_virtual_method(rax, index, method); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3491 |
__ profile_arguments_type(rdx, method, rbcp, true); |
1 | 3492 |
__ jump_from_interpreted(method, rdx); |
3493 |
} |
|
3494 |
||
3495 |
void TemplateTable::invokevirtual(int byte_no) { |
|
3496 |
transition(vtos, vtos); |
|
5688 | 3497 |
assert(byte_no == f2_byte, "use this argument"); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3498 |
prepare_invoke(byte_no, |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3499 |
rbx, // method or vtable index |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3500 |
noreg, // unused itable index |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3501 |
rcx, rdx); // recv, flags |
1 | 3502 |
|
3503 |
// rbx: index |
|
3504 |
// rcx: receiver |
|
3505 |
// rdx: flags |
|
3506 |
||
3507 |
invokevirtual_helper(rbx, rcx, rdx); |
|
3508 |
} |
|
3509 |
||
3510 |
void TemplateTable::invokespecial(int byte_no) { |
|
3511 |
transition(vtos, vtos); |
|
5688 | 3512 |
assert(byte_no == f1_byte, "use this argument"); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3513 |
prepare_invoke(byte_no, rbx, noreg, // get f1 Method* |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3514 |
rcx); // get receiver also for null check |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3515 |
__ verify_oop(rcx); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3516 |
__ null_check(rcx); |
1 | 3517 |
// do the call |
3518 |
__ profile_call(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3519 |
__ profile_arguments_type(rax, rbx, rbcp, false); |
1 | 3520 |
__ jump_from_interpreted(rbx, rax); |
3521 |
} |
|
3522 |
||
3523 |
void TemplateTable::invokestatic(int byte_no) { |
|
3524 |
transition(vtos, vtos); |
|
5688 | 3525 |
assert(byte_no == f1_byte, "use this argument"); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3526 |
prepare_invoke(byte_no, rbx); // get f1 Method* |
1 | 3527 |
// do the call |
3528 |
__ profile_call(rax); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3529 |
__ profile_arguments_type(rax, rbx, rbcp, false); |
1 | 3530 |
__ jump_from_interpreted(rbx, rax); |
3531 |
} |
|
3532 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3533 |
|
1 | 3534 |
void TemplateTable::fast_invokevfinal(int byte_no) { |
3535 |
transition(vtos, vtos); |
|
5688 | 3536 |
assert(byte_no == f2_byte, "use this argument"); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3537 |
__ stop("fast_invokevfinal not used on x86"); |
1 | 3538 |
} |
3539 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3540 |
|
1 | 3541 |
void TemplateTable::invokeinterface(int byte_no) { |
3542 |
transition(vtos, vtos); |
|
5688 | 3543 |
assert(byte_no == f1_byte, "use this argument"); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3544 |
prepare_invoke(byte_no, rax, rbx, // get f1 Klass*, f2 itable index |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3545 |
rcx, rdx); // recv, flags |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3546 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3547 |
// rax: interface klass (from f1) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3548 |
// rbx: itable index (from f2) |
1 | 3549 |
// rcx: receiver |
3550 |
// rdx: flags |
|
3551 |
||
3552 |
// Special case of invokeinterface called for virtual method of |
|
3553 |
// java.lang.Object. See cpCacheOop.cpp for details. |
|
3554 |
// This code isn't produced by javac, but could be produced by |
|
3555 |
// another compliant java compiler. |
|
3556 |
Label notMethod; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3557 |
__ movl(rlocals, rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3558 |
__ andl(rlocals, (1 << ConstantPoolCacheEntry::is_forced_virtual_shift)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3559 |
|
1 | 3560 |
__ jcc(Assembler::zero, notMethod); |
3561 |
||
3562 |
invokevirtual_helper(rbx, rcx, rdx); |
|
3563 |
__ bind(notMethod); |
|
3564 |
||
3565 |
// Get receiver klass into rdx - also a null check |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3566 |
__ restore_locals(); // restore r14 |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3567 |
__ null_check(rcx, oopDesc::klass_offset_in_bytes()); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3568 |
__ load_klass(rdx, rcx); |
1 | 3569 |
|
3570 |
// profile this call |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3571 |
__ profile_virtual_call(rdx, rbcp, rlocals); |
1 | 3572 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3573 |
Label no_such_interface, no_such_method; |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3574 |
|
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3575 |
__ lookup_interface_method(// inputs: rec. class, interface, itable index |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3576 |
rdx, rax, rbx, |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3577 |
// outputs: method, scan temp. reg |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3578 |
rbx, rbcp, |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3579 |
no_such_interface); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3580 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3581 |
// rbx: Method* to call |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3582 |
// rcx: receiver |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3583 |
// Check for abstract method error |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3584 |
// Note: This should be done more efficiently via a throw_abstract_method_error |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3585 |
// interpreter entry point and a conditional jump to it in case of a null |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3586 |
// method. |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3587 |
__ testptr(rbx, rbx); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3588 |
__ jcc(Assembler::zero, no_such_method); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3589 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3590 |
__ profile_arguments_type(rdx, rbx, rbcp, true); |
20702
bbe0fcde6e13
8023657: New type profiling points: arguments to call
roland
parents:
17003
diff
changeset
|
3591 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3592 |
// do the call |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3593 |
// rcx: receiver |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3594 |
// rbx,: Method* |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3595 |
__ jump_from_interpreted(rbx, rdx); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3596 |
__ should_not_reach_here(); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3597 |
|
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3598 |
// exception handling code follows... |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3599 |
// note: must restore interpreter registers to canonical |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3600 |
// state for exception handling to work correctly! |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3601 |
|
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3602 |
__ bind(no_such_method); |
1 | 3603 |
// throw exception |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3604 |
__ pop(rbx); // pop return address (pushed by prepare_invoke) |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3605 |
__ restore_bcp(); // rbcp must be correct for exception handler (was destroyed) |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3606 |
__ restore_locals(); // make sure locals pointer is correct as well (was destroyed) |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3607 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3608 |
// the call_VM checks for exception, so we should never return here. |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3609 |
__ should_not_reach_here(); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3610 |
|
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3611 |
__ bind(no_such_interface); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3612 |
// throw exception |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3613 |
__ pop(rbx); // pop return address (pushed by prepare_invoke) |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3614 |
__ restore_bcp(); // rbcp must be correct for exception handler (was destroyed) |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
3615 |
__ restore_locals(); // make sure locals pointer is correct as well (was destroyed) |
1 | 3616 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, |
3617 |
InterpreterRuntime::throw_IncompatibleClassChangeError)); |
|
3618 |
// the call_VM checks for exception, so we should never return here. |
|
3619 |
__ should_not_reach_here(); |
|
3620 |
} |
|
3621 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3622 |
void TemplateTable::invokehandle(int byte_no) { |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3623 |
transition(vtos, vtos); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3624 |
assert(byte_no == f1_byte, "use this argument"); |
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3625 |
const Register rbx_method = rbx; |
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3626 |
const Register rax_mtype = rax; |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3627 |
const Register rcx_recv = rcx; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3628 |
const Register rdx_flags = rdx; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3629 |
|
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3630 |
prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv); |
13743
154102966e74
7196681: NPG: Some JSR 292 tests crash in Windows exception handler
coleenp
parents:
13728
diff
changeset
|
3631 |
__ verify_method_ptr(rbx_method); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3632 |
__ verify_oop(rcx_recv); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3633 |
__ null_check(rcx_recv); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3634 |
|
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3635 |
// rax: MethodType object (from cpool->resolved_references[f1], if necessary) |
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3636 |
// rbx: MH.invokeExact_MT method (from f2) |
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3637 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3638 |
// Note: rax_mtype is already pushed (if necessary) by prepare_invoke |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3639 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3640 |
// FIXME: profile the LambdaForm also |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3641 |
__ profile_final_call(rax); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3642 |
__ profile_arguments_type(rdx, rbx_method, rbcp, true); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3643 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3644 |
__ jump_from_interpreted(rbx_method, rdx); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3645 |
} |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3646 |
|
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2149
diff
changeset
|
3647 |
void TemplateTable::invokedynamic(int byte_no) { |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2149
diff
changeset
|
3648 |
transition(vtos, vtos); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3649 |
assert(byte_no == f1_byte, "use this argument"); |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2149
diff
changeset
|
3650 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3651 |
const Register rbx_method = rbx; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3652 |
const Register rax_callsite = rax; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3653 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3654 |
prepare_invoke(byte_no, rbx_method, rax_callsite); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3655 |
|
13929
8da0dc50a6e4
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
13743
diff
changeset
|
3656 |
// rax: CallSite object (from cpool->resolved_references[f1]) |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3657 |
// rbx: MH.linkToCallSite method (from f2) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3658 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3659 |
// Note: rax_callsite is already pushed by prepare_invoke |
6772 | 3660 |
|
9328
144894b3384b
6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents:
9324
diff
changeset
|
3661 |
// %%% should make a type profile for any invokedynamic that takes a ref argument |
144894b3384b
6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents:
9324
diff
changeset
|
3662 |
// profile this call |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3663 |
__ profile_call(rbcp); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3664 |
__ profile_arguments_type(rdx, rbx_method, rbcp, false); |
9328
144894b3384b
6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents:
9324
diff
changeset
|
3665 |
|
144894b3384b
6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents:
9324
diff
changeset
|
3666 |
__ verify_oop(rax_callsite); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3667 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12366
diff
changeset
|
3668 |
__ jump_from_interpreted(rbx_method, rdx); |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2149
diff
changeset
|
3669 |
} |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2149
diff
changeset
|
3670 |
|
1 | 3671 |
//----------------------------------------------------------------------------- |
3672 |
// Allocation |
|
3673 |
||
3674 |
void TemplateTable::_new() { |
|
3675 |
transition(vtos, atos); |
|
3676 |
__ get_unsigned_2_byte_index_at_bcp(rdx, 1); |
|
3677 |
Label slow_case; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3678 |
Label slow_case_no_pop; |
1 | 3679 |
Label done; |
3680 |
Label initialize_header; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3681 |
Label initialize_object; // including clearing the fields |
1 | 3682 |
Label allocate_shared; |
3683 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3684 |
__ get_cpool_and_tags(rcx, rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3685 |
|
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5882
diff
changeset
|
3686 |
// Make sure the class we're about to instantiate has been resolved. |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3687 |
// This is done before loading InstanceKlass to be consistent with the order |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3688 |
// how Constant Pool is updated (see ConstantPool::klass_at_put) |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3689 |
const int tags_offset = Array<u1>::base_offset_in_bytes(); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3690 |
__ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3691 |
__ jcc(Assembler::notEqual, slow_case_no_pop); |
1 | 3692 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3693 |
// get InstanceKlass |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3694 |
__ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(ConstantPool))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3695 |
__ push(rcx); // save the contexts of klass for initializing the header |
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5882
diff
changeset
|
3696 |
|
1 | 3697 |
// make sure klass is initialized & doesn't have finalizer |
3698 |
// make sure klass is fully initialized |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3699 |
__ cmpb(Address(rcx, InstanceKlass::init_state_offset()), InstanceKlass::fully_initialized); |
1 | 3700 |
__ jcc(Assembler::notEqual, slow_case); |
3701 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3702 |
// get instance_size in InstanceKlass (scaled to a count of bytes) |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3703 |
__ movl(rdx, Address(rcx, Klass::layout_helper_offset())); |
1 | 3704 |
// test to see if it has a finalizer or is malformed in some way |
3705 |
__ testl(rdx, Klass::_lh_instance_slow_path_bit); |
|
3706 |
__ jcc(Assembler::notZero, slow_case); |
|
3707 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3708 |
// |
1 | 3709 |
// Allocate the instance |
3710 |
// 1) Try to allocate in the TLAB |
|
3711 |
// 2) if fail and the object is large allocate in the shared Eden |
|
3712 |
// 3) if the above fails (or is not applicable), go to a slow case |
|
3713 |
// (creates a new TLAB, etc.) |
|
3714 |
||
3715 |
const bool allow_shared_alloc = |
|
27625 | 3716 |
Universe::heap()->supports_inline_contig_alloc(); |
1 | 3717 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3718 |
const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3719 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3720 |
if (UseTLAB || allow_shared_alloc) { |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3721 |
__ get_thread(thread); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3722 |
} |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3723 |
#endif // _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3724 |
|
1 | 3725 |
if (UseTLAB) { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3726 |
__ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset()))); |
1066 | 3727 |
__ lea(rbx, Address(rax, rdx, Address::times_1)); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3728 |
__ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset()))); |
1 | 3729 |
__ jcc(Assembler::above, allow_shared_alloc ? allocate_shared : slow_case); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3730 |
__ movptr(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx); |
1 | 3731 |
if (ZeroTLAB) { |
3732 |
// the fields have been already cleared |
|
3733 |
__ jmp(initialize_header); |
|
3734 |
} else { |
|
3735 |
// initialize both the header and fields |
|
3736 |
__ jmp(initialize_object); |
|
3737 |
} |
|
3738 |
} |
|
3739 |
||
3740 |
// Allocation in the shared Eden, if allowed. |
|
3741 |
// |
|
3742 |
// rdx: instance size in bytes |
|
3743 |
if (allow_shared_alloc) { |
|
3744 |
__ bind(allocate_shared); |
|
3745 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3746 |
ExternalAddress heap_top((address)Universe::heap()->top_addr()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3747 |
ExternalAddress heap_end((address)Universe::heap()->end_addr()); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3748 |
|
1 | 3749 |
Label retry; |
3750 |
__ bind(retry); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3751 |
__ movptr(rax, heap_top); |
1066 | 3752 |
__ lea(rbx, Address(rax, rdx, Address::times_1)); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3753 |
__ cmpptr(rbx, heap_end); |
1 | 3754 |
__ jcc(Assembler::above, slow_case); |
3755 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3756 |
// Compare rax, with the top addr, and if still equal, store the new |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3757 |
// top addr in rbx, at the address of the top addr pointer. Sets ZF if was |
1 | 3758 |
// equal, and clears it otherwise. Use lock prefix for atomicity on MPs. |
3759 |
// |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3760 |
// rax,: object begin |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3761 |
// rbx,: object end |
1 | 3762 |
// rdx: instance size in bytes |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3763 |
__ locked_cmpxchgptr(rbx, heap_top); |
1 | 3764 |
|
3765 |
// if someone beat us on the allocation, try again, otherwise continue |
|
3766 |
__ jcc(Assembler::notEqual, retry); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7401
diff
changeset
|
3767 |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3768 |
__ incr_allocated_bytes(thread, rdx, 0); |
1 | 3769 |
} |
3770 |
||
3771 |
if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) { |
|
3772 |
// The object is initialized before the header. If the object size is |
|
3773 |
// zero, go directly to the header initialization. |
|
3774 |
__ bind(initialize_object); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3775 |
__ decrement(rdx, sizeof(oopDesc)); |
1 | 3776 |
__ jcc(Assembler::zero, initialize_header); |
3777 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3778 |
// Initialize topmost object field, divide rdx by 8, check if odd and |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3779 |
// test if zero. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3780 |
__ xorl(rcx, rcx); // use zero reg to clear memory (shorter code) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3781 |
__ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3782 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3783 |
// rdx must have been multiple of 8 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3784 |
#ifdef ASSERT |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3785 |
// make sure rdx was multiple of 8 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3786 |
Label L; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3787 |
// Ignore partial flag stall after shrl() since it is debug VM |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3788 |
__ jccb(Assembler::carryClear, L); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3789 |
__ stop("object size is not multiple of 2 - adjust this code"); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3790 |
__ bind(L); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3791 |
// rdx must be > 0, no extra check needed here |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3792 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3793 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3794 |
// initialize remaining object fields: rdx was a multiple of 8 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3795 |
{ Label loop; |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3796 |
__ bind(loop); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3797 |
__ movptr(Address(rax, rdx, Address::times_8, sizeof(oopDesc) - 1*oopSize), rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3798 |
NOT_LP64(__ movptr(Address(rax, rdx, Address::times_8, sizeof(oopDesc) - 2*oopSize), rcx)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3799 |
__ decrement(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3800 |
__ jcc(Assembler::notZero, loop); |
1 | 3801 |
} |
3802 |
||
3803 |
// initialize object header only. |
|
3804 |
__ bind(initialize_header); |
|
3805 |
if (UseBiasedLocking) { |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3806 |
__ pop(rcx); // get saved klass back in the register. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3807 |
__ movptr(rbx, Address(rcx, Klass::prototype_header_offset())); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3808 |
__ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), rbx); |
1 | 3809 |
} else { |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3810 |
__ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3811 |
(intptr_t)markOopDesc::prototype()); // header |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3812 |
__ pop(rcx); // get saved klass back in the register. |
1 | 3813 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3814 |
#ifdef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3815 |
__ xorl(rsi, rsi); // use zero reg to clear memory (shorter code) |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3816 |
__ store_klass_gap(rax, rsi); // zero klass gap for compressed oops |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3817 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3818 |
__ store_klass(rax, rcx); // klass |
4889
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3819 |
|
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3820 |
{ |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3821 |
SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0); |
4889
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3822 |
// Trigger dtrace event for fastpath |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3823 |
__ push(atos); |
4889
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3824 |
__ call_VM_leaf( |
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3825 |
CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3826 |
__ pop(atos); |
4889
81b0130673ef
6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
kamg
parents:
4478
diff
changeset
|
3827 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3828 |
|
1 | 3829 |
__ jmp(done); |
3830 |
} |
|
3831 |
||
3832 |
// slow case |
|
3833 |
__ bind(slow_case); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3834 |
__ pop(rcx); // restore stack pointer to what it was when we came in. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3835 |
__ bind(slow_case_no_pop); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3836 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3837 |
Register rarg1 = LP64_ONLY(c_rarg1) NOT_LP64(rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3838 |
Register rarg2 = LP64_ONLY(c_rarg2) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3839 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3840 |
__ get_constant_pool(rarg1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3841 |
__ get_unsigned_2_byte_index_at_bcp(rarg2, 1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3842 |
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), rarg1, rarg2); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3843 |
__ verify_oop(rax); |
1 | 3844 |
|
3845 |
// continue |
|
3846 |
__ bind(done); |
|
3847 |
} |
|
3848 |
||
3849 |
void TemplateTable::newarray() { |
|
3850 |
transition(itos, atos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3851 |
Register rarg1 = LP64_ONLY(c_rarg1) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3852 |
__ load_unsigned_byte(rarg1, at_bcp(1)); |
1 | 3853 |
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::newarray), |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3854 |
rarg1, rax); |
1 | 3855 |
} |
3856 |
||
3857 |
void TemplateTable::anewarray() { |
|
3858 |
transition(itos, atos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3859 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3860 |
Register rarg1 = LP64_ONLY(c_rarg1) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3861 |
Register rarg2 = LP64_ONLY(c_rarg2) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3862 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3863 |
__ get_unsigned_2_byte_index_at_bcp(rarg2, 1); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3864 |
__ get_constant_pool(rarg1); |
1 | 3865 |
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::anewarray), |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3866 |
rarg1, rarg2, rax); |
1 | 3867 |
} |
3868 |
||
3869 |
void TemplateTable::arraylength() { |
|
3870 |
transition(atos, itos); |
|
3871 |
__ null_check(rax, arrayOopDesc::length_offset_in_bytes()); |
|
3872 |
__ movl(rax, Address(rax, arrayOopDesc::length_offset_in_bytes())); |
|
3873 |
} |
|
3874 |
||
3875 |
void TemplateTable::checkcast() { |
|
3876 |
transition(atos, atos); |
|
3877 |
Label done, is_null, ok_is_subtype, quicked, resolved; |
|
1066 | 3878 |
__ testptr(rax, rax); // object is in rax |
1 | 3879 |
__ jcc(Assembler::zero, is_null); |
3880 |
||
3881 |
// Get cpool & tags index |
|
3882 |
__ get_cpool_and_tags(rcx, rdx); // rcx=cpool, rdx=tags array |
|
3883 |
__ get_unsigned_2_byte_index_at_bcp(rbx, 1); // rbx=index |
|
3884 |
// See if bytecode has already been quicked |
|
3885 |
__ cmpb(Address(rdx, rbx, |
|
3886 |
Address::times_1, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3887 |
Array<u1>::base_offset_in_bytes()), |
1 | 3888 |
JVM_CONSTANT_Class); |
3889 |
__ jcc(Assembler::equal, quicked); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3890 |
__ push(atos); // save receiver for result, and for GC |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3891 |
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3892 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3893 |
// vm_result_2 has metadata result |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3894 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3895 |
// borrow rdi from locals |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3896 |
__ get_thread(rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3897 |
__ get_vm_result_2(rax, rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3898 |
__ restore_locals(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3899 |
#else |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3900 |
__ get_vm_result_2(rax, r15_thread); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3901 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3902 |
|
1 | 3903 |
__ pop_ptr(rdx); // restore receiver |
3904 |
__ jmpb(resolved); |
|
3905 |
||
3906 |
// Get superklass in rax and subklass in rbx |
|
3907 |
__ bind(quicked); |
|
1066 | 3908 |
__ mov(rdx, rax); // Save object in rdx; rax needed for subtype check |
3909 |
__ movptr(rax, Address(rcx, rbx, |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3910 |
Address::times_ptr, sizeof(ConstantPool))); |
1 | 3911 |
|
3912 |
__ bind(resolved); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3913 |
__ load_klass(rbx, rdx); |
1 | 3914 |
|
3915 |
// Generate subtype check. Blows rcx, rdi. Object in rdx. |
|
3916 |
// Superklass in rax. Subklass in rbx. |
|
3917 |
__ gen_subtype_check(rbx, ok_is_subtype); |
|
3918 |
||
3919 |
// Come here on failure |
|
3920 |
__ push_ptr(rdx); |
|
3921 |
// object is at TOS |
|
3922 |
__ jump(ExternalAddress(Interpreter::_throw_ClassCastException_entry)); |
|
3923 |
||
3924 |
// Come here on success |
|
3925 |
__ bind(ok_is_subtype); |
|
1066 | 3926 |
__ mov(rax, rdx); // Restore object in rdx |
1 | 3927 |
|
3928 |
// Collect counts on whether this check-cast sees NULLs a lot or not. |
|
3929 |
if (ProfileInterpreter) { |
|
3930 |
__ jmp(done); |
|
3931 |
__ bind(is_null); |
|
3932 |
__ profile_null_seen(rcx); |
|
3933 |
} else { |
|
3934 |
__ bind(is_null); // same as 'done' |
|
3935 |
} |
|
3936 |
__ bind(done); |
|
3937 |
} |
|
3938 |
||
3939 |
void TemplateTable::instanceof() { |
|
3940 |
transition(atos, itos); |
|
3941 |
Label done, is_null, ok_is_subtype, quicked, resolved; |
|
1066 | 3942 |
__ testptr(rax, rax); |
1 | 3943 |
__ jcc(Assembler::zero, is_null); |
3944 |
||
3945 |
// Get cpool & tags index |
|
3946 |
__ get_cpool_and_tags(rcx, rdx); // rcx=cpool, rdx=tags array |
|
3947 |
__ get_unsigned_2_byte_index_at_bcp(rbx, 1); // rbx=index |
|
3948 |
// See if bytecode has already been quicked |
|
3949 |
__ cmpb(Address(rdx, rbx, |
|
3950 |
Address::times_1, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3951 |
Array<u1>::base_offset_in_bytes()), |
1 | 3952 |
JVM_CONSTANT_Class); |
3953 |
__ jcc(Assembler::equal, quicked); |
|
3954 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3955 |
__ push(atos); // save receiver for result, and for GC |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3956 |
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3957 |
// vm_result_2 has metadata result |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3958 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3959 |
#ifndef _LP64 |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3960 |
// borrow rdi from locals |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3961 |
__ get_thread(rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3962 |
__ get_vm_result_2(rax, rdi); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3963 |
__ restore_locals(); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3964 |
#else |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
3965 |
__ get_vm_result_2(rax, r15_thread); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3966 |
#endif |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3967 |
|
1 | 3968 |
__ pop_ptr(rdx); // restore receiver |
7401
ebde7415b521
6780143: hs203t003 hits SIGSEGV/EXCEPTION_ACCESS_VIOLATION with -XX:+UseCompressedOops
coleenp
parents:
7397
diff
changeset
|
3969 |
__ verify_oop(rdx); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3970 |
__ load_klass(rdx, rdx); |
1 | 3971 |
__ jmpb(resolved); |
3972 |
||
3973 |
// Get superklass in rax and subklass in rdx |
|
3974 |
__ bind(quicked); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
3975 |
__ load_klass(rdx, rax); |
1066 | 3976 |
__ movptr(rax, Address(rcx, rbx, |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
3977 |
Address::times_ptr, sizeof(ConstantPool))); |
1 | 3978 |
|
3979 |
__ bind(resolved); |
|
3980 |
||
3981 |
// Generate subtype check. Blows rcx, rdi |
|
3982 |
// Superklass in rax. Subklass in rdx. |
|
3983 |
__ gen_subtype_check(rdx, ok_is_subtype); |
|
3984 |
||
3985 |
// Come here on failure |
|
3986 |
__ xorl(rax, rax); |
|
3987 |
__ jmpb(done); |
|
3988 |
// Come here on success |
|
3989 |
__ bind(ok_is_subtype); |
|
3990 |
__ movl(rax, 1); |
|
3991 |
||
3992 |
// Collect counts on whether this test sees NULLs a lot or not. |
|
3993 |
if (ProfileInterpreter) { |
|
3994 |
__ jmp(done); |
|
3995 |
__ bind(is_null); |
|
3996 |
__ profile_null_seen(rcx); |
|
3997 |
} else { |
|
3998 |
__ bind(is_null); // same as 'done' |
|
3999 |
} |
|
4000 |
__ bind(done); |
|
4001 |
// rax = 0: obj == NULL or obj is not an instanceof the specified klass |
|
4002 |
// rax = 1: obj != NULL and obj is an instanceof the specified klass |
|
4003 |
} |
|
4004 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4005 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4006 |
//---------------------------------------------------------------------------------------------------- |
1 | 4007 |
// Breakpoints |
4008 |
void TemplateTable::_breakpoint() { |
|
4009 |
// Note: We get here even if we are single stepping.. |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4010 |
// jbug insists on setting breakpoints at every bytecode |
1 | 4011 |
// even if we are in single step mode. |
4012 |
||
4013 |
transition(vtos, vtos); |
|
4014 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4015 |
Register rarg = LP64_ONLY(c_rarg1) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4016 |
|
1 | 4017 |
// get the unpatched byte code |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4018 |
__ get_method(rarg); |
1 | 4019 |
__ call_VM(noreg, |
4020 |
CAST_FROM_FN_PTR(address, |
|
4021 |
InterpreterRuntime::get_original_bytecode_at), |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4022 |
rarg, rbcp); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4023 |
__ mov(rbx, rax); // why? |
1 | 4024 |
|
4025 |
// post the breakpoint event |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4026 |
__ get_method(rarg); |
1 | 4027 |
__ call_VM(noreg, |
4028 |
CAST_FROM_FN_PTR(address, InterpreterRuntime::_breakpoint), |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4029 |
rarg, rbcp); |
1 | 4030 |
|
4031 |
// complete the execution of original bytecode |
|
4032 |
__ dispatch_only_normal(vtos); |
|
4033 |
} |
|
4034 |
||
4035 |
//----------------------------------------------------------------------------- |
|
4036 |
// Exceptions |
|
4037 |
||
4038 |
void TemplateTable::athrow() { |
|
4039 |
transition(atos, vtos); |
|
4040 |
__ null_check(rax); |
|
4041 |
__ jump(ExternalAddress(Interpreter::throw_exception_entry())); |
|
4042 |
} |
|
4043 |
||
4044 |
//----------------------------------------------------------------------------- |
|
4045 |
// Synchronization |
|
4046 |
// |
|
4047 |
// Note: monitorenter & exit are symmetric routines; which is reflected |
|
4048 |
// in the assembly code structure as well |
|
4049 |
// |
|
4050 |
// Stack layout: |
|
4051 |
// |
|
4052 |
// [expressions ] <--- rsp = expression stack top |
|
4053 |
// .. |
|
4054 |
// [expressions ] |
|
4055 |
// [monitor entry] <--- monitor block top = expression stack bot |
|
4056 |
// .. |
|
4057 |
// [monitor entry] |
|
4058 |
// [frame data ] <--- monitor block bot |
|
4059 |
// ... |
|
4060 |
// [saved rbp ] <--- rbp |
|
4061 |
void TemplateTable::monitorenter() { |
|
4062 |
transition(atos, vtos); |
|
4063 |
||
4064 |
// check for NULL object |
|
4065 |
__ null_check(rax); |
|
4066 |
||
4067 |
const Address monitor_block_top( |
|
4068 |
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize); |
|
4069 |
const Address monitor_block_bot( |
|
4070 |
rbp, frame::interpreter_frame_initial_sp_offset * wordSize); |
|
4071 |
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; |
|
4072 |
||
4073 |
Label allocated; |
|
4074 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4075 |
Register rtop = LP64_ONLY(c_rarg3) NOT_LP64(rcx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4076 |
Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4077 |
Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4078 |
|
1 | 4079 |
// initialize entry pointer |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4080 |
__ xorl(rmon, rmon); // points to free slot or NULL |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4081 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4082 |
// find a free slot in the monitor block (result in rmon) |
1 | 4083 |
{ |
4084 |
Label entry, loop, exit; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4085 |
__ movptr(rtop, monitor_block_top); // points to current entry, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4086 |
// starting with top-most entry |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4087 |
__ lea(rbot, monitor_block_bot); // points to word before bottom |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4088 |
// of monitor block |
1 | 4089 |
__ jmpb(entry); |
4090 |
||
4091 |
__ bind(loop); |
|
4092 |
// check if current entry is used |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4093 |
__ cmpptr(Address(rtop, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4094 |
// if not used then remember entry in rmon |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4095 |
__ cmovptr(Assembler::equal, rmon, rtop); // cmov => cmovptr |
1 | 4096 |
// check if current entry is for same object |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4097 |
__ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes())); |
1 | 4098 |
// if same object then stop searching |
4099 |
__ jccb(Assembler::equal, exit); |
|
4100 |
// otherwise advance to next entry |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4101 |
__ addptr(rtop, entry_size); |
1 | 4102 |
__ bind(entry); |
4103 |
// check if bottom reached |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4104 |
__ cmpptr(rtop, rbot); |
1 | 4105 |
// if not at bottom then check this entry |
4106 |
__ jcc(Assembler::notEqual, loop); |
|
4107 |
__ bind(exit); |
|
4108 |
} |
|
4109 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4110 |
__ testptr(rmon, rmon); // check if a slot has been found |
1 | 4111 |
__ jcc(Assembler::notZero, allocated); // if found, continue with that one |
4112 |
||
4113 |
// allocate one if there's no free slot |
|
4114 |
{ |
|
4115 |
Label entry, loop; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4116 |
// 1. compute new pointers // rsp: old expression stack top |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4117 |
__ movptr(rmon, monitor_block_bot); // rmon: old expression stack bottom |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4118 |
__ subptr(rsp, entry_size); // move expression stack top |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4119 |
__ subptr(rmon, entry_size); // move expression stack bottom |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4120 |
__ mov(rtop, rsp); // set start value for copy loop |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4121 |
__ movptr(monitor_block_bot, rmon); // set new monitor block bottom |
1 | 4122 |
__ jmp(entry); |
4123 |
// 2. move expression stack contents |
|
4124 |
__ bind(loop); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4125 |
__ movptr(rbot, Address(rtop, entry_size)); // load expression stack |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4126 |
// word from old location |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4127 |
__ movptr(Address(rtop, 0), rbot); // and store it at new location |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4128 |
__ addptr(rtop, wordSize); // advance to next word |
1 | 4129 |
__ bind(entry); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4130 |
__ cmpptr(rtop, rmon); // check if bottom reached |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4131 |
__ jcc(Assembler::notEqual, loop); // if not at bottom then |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4132 |
// copy next word |
1 | 4133 |
} |
4134 |
||
4135 |
// call run-time routine |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4136 |
// rmon: points to monitor entry |
1 | 4137 |
__ bind(allocated); |
4138 |
||
4139 |
// Increment bcp to point to the next bytecode, so exception |
|
4140 |
// handling for async. exceptions work correctly. |
|
4141 |
// The object has already been poped from the stack, so the |
|
4142 |
// expression stack looks correct. |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4143 |
__ increment(rbcp); |
1 | 4144 |
|
4145 |
// store object |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4146 |
__ movptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), rax); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4147 |
__ lock_object(rmon); |
1 | 4148 |
|
4149 |
// check to make sure this monitor doesn't cause stack overflow after locking |
|
4150 |
__ save_bcp(); // in case of exception |
|
4151 |
__ generate_stack_overflow_check(0); |
|
4152 |
||
4153 |
// The bcp has already been incremented. Just need to dispatch to |
|
4154 |
// next instruction. |
|
4155 |
__ dispatch_next(vtos); |
|
4156 |
} |
|
4157 |
||
4158 |
void TemplateTable::monitorexit() { |
|
4159 |
transition(atos, vtos); |
|
4160 |
||
4161 |
// check for NULL object |
|
4162 |
__ null_check(rax); |
|
4163 |
||
4164 |
const Address monitor_block_top( |
|
4165 |
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize); |
|
4166 |
const Address monitor_block_bot( |
|
4167 |
rbp, frame::interpreter_frame_initial_sp_offset * wordSize); |
|
4168 |
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; |
|
4169 |
||
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4170 |
Register rtop = LP64_ONLY(c_rarg1) NOT_LP64(rdx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4171 |
Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4172 |
|
1 | 4173 |
Label found; |
4174 |
||
4175 |
// find matching slot |
|
4176 |
{ |
|
4177 |
Label entry, loop; |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4178 |
__ movptr(rtop, monitor_block_top); // points to current entry, |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4179 |
// starting with top-most entry |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4180 |
__ lea(rbot, monitor_block_bot); // points to word before bottom |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4181 |
// of monitor block |
1 | 4182 |
__ jmpb(entry); |
4183 |
||
4184 |
__ bind(loop); |
|
4185 |
// check if current entry is for same object |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4186 |
__ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes())); |
1 | 4187 |
// if same object then stop searching |
4188 |
__ jcc(Assembler::equal, found); |
|
4189 |
// otherwise advance to next entry |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4190 |
__ addptr(rtop, entry_size); |
1 | 4191 |
__ bind(entry); |
4192 |
// check if bottom reached |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4193 |
__ cmpptr(rtop, rbot); |
1 | 4194 |
// if not at bottom then check this entry |
4195 |
__ jcc(Assembler::notEqual, loop); |
|
4196 |
} |
|
4197 |
||
4198 |
// error handling. Unlocking was not block-structured |
|
4199 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, |
|
4200 |
InterpreterRuntime::throw_illegal_monitor_state_exception)); |
|
4201 |
__ should_not_reach_here(); |
|
4202 |
||
4203 |
// call run-time routine |
|
4204 |
__ bind(found); |
|
4205 |
__ push_ptr(rax); // make sure object is on stack (contract with oopMaps) |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4206 |
__ unlock_object(rtop); |
1 | 4207 |
__ pop_ptr(rax); // discard object |
4208 |
} |
|
4209 |
||
4210 |
// Wide instructions |
|
4211 |
void TemplateTable::wide() { |
|
4212 |
transition(vtos, vtos); |
|
4213 |
__ load_unsigned_byte(rbx, at_bcp(1)); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4214 |
ExternalAddress wtable((address)Interpreter::_wentry_point); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4215 |
__ jump(ArrayAddress(wtable, Address(noreg, rbx, Address::times_ptr))); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4216 |
// Note: the rbcp increment step is part of the individual wide bytecode implementations |
1 | 4217 |
} |
4218 |
||
4219 |
// Multi arrays |
|
4220 |
void TemplateTable::multianewarray() { |
|
4221 |
transition(vtos, atos); |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4222 |
|
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4223 |
Register rarg = LP64_ONLY(c_rarg1) NOT_LP64(rax); |
1 | 4224 |
__ load_unsigned_byte(rax, at_bcp(3)); // get number of dimensions |
4225 |
// last dim is on top of stack; we want address of first one: |
|
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4226 |
// first_addr = last_addr + (ndims - 1) * stackElementSize - 1*wordsize |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4227 |
// the latter wordSize to point to the beginning of the array. |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4228 |
__ lea(rarg, Address(rsp, rax, Interpreter::stackElementScale(), -wordSize)); |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4229 |
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), rarg); |
1 | 4230 |
__ load_unsigned_byte(rbx, at_bcp(3)); |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4231 |
__ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts |
1 | 4232 |
} |
29461
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4233 |
#endif /* !CC_INTERP */ |
3f6358b7c82c
8013393: Merge template interpreter files for x86 _32 and _64.
mockner
parents:
28837
diff
changeset
|
4234 |