|
38 | 38 | #include "oops/methodData.hpp" |
39 | 39 | #include "oops/resolvedFieldEntry.hpp" |
40 | 40 | #include "oops/resolvedIndyEntry.hpp" |
| 41 | +#include "oops/resolvedMethodEntry.hpp" |
41 | 42 | #include "prims/jvmtiExport.hpp" |
42 | 43 | #include "prims/jvmtiThreadState.hpp" |
43 | 44 | #include "runtime/basicLock.hpp" |
@@ -201,64 +202,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index, |
201 | 202 | } |
202 | 203 | } |
203 | 204 |
|
204 | | -// Return |
205 | | -// Rindex: index into constant pool |
206 | | -// Rcache: address of cache entry - ConstantPoolCache::base_offset() |
207 | | -// |
208 | | -// A caller must add ConstantPoolCache::base_offset() to Rcache to get |
209 | | -// the true address of the cache entry. |
210 | | -// |
211 | | -void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, |
212 | | - Register index, |
213 | | - int bcp_offset, |
214 | | - size_t index_size) { |
215 | | - assert_different_registers(cache, index); |
216 | | - assert_different_registers(cache, rcpool); |
217 | | - get_cache_index_at_bcp(index, bcp_offset, index_size); |
218 | | - assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); |
219 | | - // convert from field index to ConstantPoolCacheEntry |
220 | | - // aarch64 already has the cache in rcpool so there is no need to |
221 | | - // install it in cache. instead we pre-add the indexed offset to |
222 | | - // rcpool and return it in cache. All clients of this method need to |
223 | | - // be modified accordingly. |
224 | | - add(cache, rcpool, index, Assembler::LSL, 5); |
225 | | -} |
226 | | - |
227 | | - |
228 | | -void InterpreterMacroAssembler::get_cache_and_index_and_bytecode_at_bcp(Register cache, |
229 | | - Register index, |
230 | | - Register bytecode, |
231 | | - int byte_no, |
232 | | - int bcp_offset, |
233 | | - size_t index_size) { |
234 | | - get_cache_and_index_at_bcp(cache, index, bcp_offset, index_size); |
235 | | - // We use a 32-bit load here since the layout of 64-bit words on |
236 | | - // little-endian machines allow us that. |
237 | | - // n.b. unlike x86 cache already includes the index offset |
238 | | - lea(bytecode, Address(cache, |
239 | | - ConstantPoolCache::base_offset() |
240 | | - + ConstantPoolCacheEntry::indices_offset())); |
241 | | - ldarw(bytecode, bytecode); |
242 | | - const int shift_count = (1 + byte_no) * BitsPerByte; |
243 | | - ubfx(bytecode, bytecode, shift_count, BitsPerByte); |
244 | | -} |
245 | | - |
246 | | -void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, |
247 | | - Register tmp, |
248 | | - int bcp_offset, |
249 | | - size_t index_size) { |
250 | | - assert(cache != tmp, "must use different register"); |
251 | | - get_cache_index_at_bcp(tmp, bcp_offset, index_size); |
252 | | - assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); |
253 | | - // convert from field index to ConstantPoolCacheEntry index |
254 | | - // and from word offset to byte offset |
255 | | - assert(exact_log2(in_bytes(ConstantPoolCacheEntry::size_in_bytes())) == 2 + LogBytesPerWord, "else change next line"); |
256 | | - ldr(cache, Address(rfp, frame::interpreter_frame_cache_offset * wordSize)); |
257 | | - // skip past the header |
258 | | - add(cache, cache, in_bytes(ConstantPoolCache::base_offset())); |
259 | | - add(cache, cache, tmp, Assembler::LSL, 2 + LogBytesPerWord); // construct pointer to cache entry |
260 | | -} |
261 | | - |
262 | 205 | void InterpreterMacroAssembler::get_method_counters(Register method, |
263 | 206 | Register mcs, Label& skip) { |
264 | 207 | Label has_counters; |
@@ -295,18 +238,6 @@ void InterpreterMacroAssembler::load_resolved_klass_at_offset( |
295 | 238 | ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes())); |
296 | 239 | } |
297 | 240 |
|
298 | | -void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_no, |
299 | | - Register method, |
300 | | - Register cache) { |
301 | | - const int method_offset = in_bytes( |
302 | | - ConstantPoolCache::base_offset() + |
303 | | - ((byte_no == TemplateTable::f2_byte) |
304 | | - ? ConstantPoolCacheEntry::f2_offset() |
305 | | - : ConstantPoolCacheEntry::f1_offset())); |
306 | | - |
307 | | - ldr(method, Address(cache, method_offset)); // get f1 Method* |
308 | | -} |
309 | | - |
310 | 241 | // Generate a subtype check: branch to ok_is_subtype if sub_klass is a |
311 | 242 | // subtype of super_klass. |
312 | 243 | // |
@@ -1866,3 +1797,15 @@ void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, |
1866 | 1797 | add(cache, cache, Array<ResolvedFieldEntry>::base_offset_in_bytes()); |
1867 | 1798 | lea(cache, Address(cache, index)); |
1868 | 1799 | } |
| 1800 | + |
| 1801 | +void InterpreterMacroAssembler::load_method_entry(Register cache, Register index, int bcp_offset) { |
| 1802 | + // Get index out of bytecode pointer |
| 1803 | + get_cache_index_at_bcp(index, bcp_offset, sizeof(u2)); |
| 1804 | + mov(cache, sizeof(ResolvedMethodEntry)); |
| 1805 | + mul(index, index, cache); // Scale the index to be the entry index * sizeof(ResolvedMethodEntry) |
| 1806 | + |
| 1807 | + // Get address of field entries array |
| 1808 | + ldr(cache, Address(rcpool, ConstantPoolCache::method_entries_offset())); |
| 1809 | + add(cache, cache, Array<ResolvedMethodEntry>::base_offset_in_bytes()); |
| 1810 | + lea(cache, Address(cache, index)); |
| 1811 | +} |
0 commit comments