8202016: Use obj+offset in interpreter array access

Reviewed-by: adinn
This commit is contained in:
Roman Kennke 2018-05-14 21:56:07 +02:00
parent e02ef02e11
commit 0fd74037aa
2 changed files with 5 additions and 9 deletions

View File

@ -504,18 +504,15 @@ void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache,
void InterpreterMacroAssembler::load_resolved_reference_at_index(
Register result, Register index, Register tmp) {
assert_different_registers(result, index);
// convert from field index to resolved_references() index and from
// word index to byte offset. Since this is a java object, it can be compressed
shll(index, LogBytesPerHeapOop);
get_constant_pool(result);
// load pointer for resolved_references[] objArray
movptr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
movptr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
resolve_oop_handle(result, tmp);
// Add in the index
addptr(result, index);
load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), tmp);
load_heap_oop(result, Address(result, index,
UseCompressedOops ? Address::times_4 : Address::times_ptr,
arrayOopDesc::base_offset_in_bytes(T_OBJECT)), tmp);
}
// load cpool->resolved_klass_at(index)

View File

@ -1112,8 +1112,6 @@ void TemplateTable::aastore() {
__ load_klass(rax, rdx);
__ movptr(rax, Address(rax,
ObjArrayKlass::element_klass_offset()));
// Compress array + index*oopSize + 12 into a single register. Frees rcx.
__ lea(rdx, element_address);
// Generate subtype check. Blows rcx, rdi
// Superklass in rax. Subklass in rbx.
@ -1128,8 +1126,9 @@ void TemplateTable::aastore() {
// Get the value we will store
__ movptr(rax, at_tos());
__ movl(rcx, at_tos_p1()); // index
// Now store using the appropriate barrier
do_oop_store(_masm, Address(rdx, 0), rax, IN_HEAP_ARRAY);
do_oop_store(_masm, element_address, rax, IN_HEAP_ARRAY);
__ jmp(done);
// Have a NULL in rax, rdx=array, ecx=index. Store NULL at ary[idx]