提交 83aba8fa 编写于 作者: T twisti

7036960: TemplateTable::fast_aldc in templateTable_x86_64.cpp uses movptr instead of load_klass

Reviewed-by: kvn, iveresov
上级 b42bb5de
...@@ -413,7 +413,7 @@ void TemplateTable::fast_aldc(bool wide) { ...@@ -413,7 +413,7 @@ void TemplateTable::fast_aldc(bool wide) {
Label L_done, L_throw_exception; Label L_done, L_throw_exception;
const Register con_klass_temp = rcx; // same as Rcache const Register con_klass_temp = rcx; // same as Rcache
__ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); __ load_klass(con_klass_temp, rax);
__ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); __ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr()));
__ jcc(Assembler::notEqual, L_done); __ jcc(Assembler::notEqual, L_done);
__ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0);
...@@ -423,7 +423,7 @@ void TemplateTable::fast_aldc(bool wide) { ...@@ -423,7 +423,7 @@ void TemplateTable::fast_aldc(bool wide) {
// Load the exception from the system-array which wraps it: // Load the exception from the system-array which wraps it:
__ bind(L_throw_exception); __ bind(L_throw_exception);
__ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); __ load_heap_oop(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
__ jump(ExternalAddress(Interpreter::throw_exception_entry())); __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
__ bind(L_done); __ bind(L_done);
...@@ -937,9 +937,9 @@ void TemplateTable::aastore() { ...@@ -937,9 +937,9 @@ void TemplateTable::aastore() {
__ jcc(Assembler::zero, is_null); __ jcc(Assembler::zero, is_null);
// Move subklass into EBX // Move subklass into EBX
__ movptr(rbx, Address(rax, oopDesc::klass_offset_in_bytes())); __ load_klass(rbx, rax);
// Move superklass into EAX // Move superklass into EAX
__ movptr(rax, Address(rdx, oopDesc::klass_offset_in_bytes())); __ load_klass(rax, rdx);
__ movptr(rax, Address(rax, sizeof(oopDesc) + objArrayKlass::element_klass_offset_in_bytes())); __ movptr(rax, Address(rax, sizeof(oopDesc) + objArrayKlass::element_klass_offset_in_bytes()));
// Compress array+index*wordSize+12 into a single register. Frees ECX. // Compress array+index*wordSize+12 into a single register. Frees ECX.
__ lea(rdx, element_address); __ lea(rdx, element_address);
...@@ -1992,7 +1992,7 @@ void TemplateTable::_return(TosState state) { ...@@ -1992,7 +1992,7 @@ void TemplateTable::_return(TosState state) {
if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { if (_desc->bytecode() == Bytecodes::_return_register_finalizer) {
assert(state == vtos, "only valid state"); assert(state == vtos, "only valid state");
__ movptr(rax, aaddress(0)); __ movptr(rax, aaddress(0));
__ movptr(rdi, Address(rax, oopDesc::klass_offset_in_bytes())); __ load_klass(rdi, rax);
__ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); __ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)));
__ testl(rdi, JVM_ACC_HAS_FINALIZER); __ testl(rdi, JVM_ACC_HAS_FINALIZER);
Label skip_register_finalizer; Label skip_register_finalizer;
...@@ -2939,7 +2939,7 @@ void TemplateTable::invokevirtual_helper(Register index, Register recv, ...@@ -2939,7 +2939,7 @@ void TemplateTable::invokevirtual_helper(Register index, Register recv,
// get receiver klass // get receiver klass
__ null_check(recv, oopDesc::klass_offset_in_bytes()); __ null_check(recv, oopDesc::klass_offset_in_bytes());
// Keep recv in rcx for callee expects it there // Keep recv in rcx for callee expects it there
__ movptr(rax, Address(recv, oopDesc::klass_offset_in_bytes())); __ load_klass(rax, recv);
__ verify_oop(rax); __ verify_oop(rax);
// profile this call // profile this call
...@@ -3019,7 +3019,7 @@ void TemplateTable::invokeinterface(int byte_no) { ...@@ -3019,7 +3019,7 @@ void TemplateTable::invokeinterface(int byte_no) {
// Get receiver klass into rdx - also a null check // Get receiver klass into rdx - also a null check
__ restore_locals(); // restore rdi __ restore_locals(); // restore rdi
__ movptr(rdx, Address(rcx, oopDesc::klass_offset_in_bytes())); __ load_klass(rdx, rcx);
__ verify_oop(rdx); __ verify_oop(rdx);
// profile this call // profile this call
...@@ -3103,7 +3103,7 @@ void TemplateTable::invokedynamic(int byte_no) { ...@@ -3103,7 +3103,7 @@ void TemplateTable::invokedynamic(int byte_no) {
__ profile_call(rsi); __ profile_call(rsi);
} }
__ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx))); __ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx)));
__ null_check(rcx_method_handle); __ null_check(rcx_method_handle);
__ prepare_to_jump_from_interpreted(); __ prepare_to_jump_from_interpreted();
__ jump_to_method_handle_entry(rcx_method_handle, rdx); __ jump_to_method_handle_entry(rcx_method_handle, rdx);
...@@ -3249,7 +3249,7 @@ void TemplateTable::_new() { ...@@ -3249,7 +3249,7 @@ void TemplateTable::_new() {
(int32_t)markOopDesc::prototype()); // header (int32_t)markOopDesc::prototype()); // header
__ pop(rcx); // get saved klass back in the register. __ pop(rcx); // get saved klass back in the register.
} }
__ movptr(Address(rax, oopDesc::klass_offset_in_bytes()), rcx); // klass __ store_klass(rax, rcx); // klass
{ {
SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0); SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0);
...@@ -3324,7 +3324,7 @@ void TemplateTable::checkcast() { ...@@ -3324,7 +3324,7 @@ void TemplateTable::checkcast() {
__ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc)));
__ bind(resolved); __ bind(resolved);
__ movptr(rbx, Address(rdx, oopDesc::klass_offset_in_bytes())); __ load_klass(rbx, rdx);
// Generate subtype check. Blows ECX. Resets EDI. Object in EDX. // Generate subtype check. Blows ECX. Resets EDI. Object in EDX.
// Superklass in EAX. Subklass in EBX. // Superklass in EAX. Subklass in EBX.
...@@ -3367,12 +3367,12 @@ void TemplateTable::instanceof() { ...@@ -3367,12 +3367,12 @@ void TemplateTable::instanceof() {
__ push(atos); __ push(atos);
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) ); call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) );
__ pop_ptr(rdx); __ pop_ptr(rdx);
__ movptr(rdx, Address(rdx, oopDesc::klass_offset_in_bytes())); __ load_klass(rdx, rdx);
__ jmp(resolved); __ jmp(resolved);
// Get superklass in EAX and subklass in EDX // Get superklass in EAX and subklass in EDX
__ bind(quicked); __ bind(quicked);
__ movptr(rdx, Address(rax, oopDesc::klass_offset_in_bytes())); __ load_klass(rdx, rax);
__ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc)));
__ bind(resolved); __ bind(resolved);
......
...@@ -427,7 +427,7 @@ void TemplateTable::fast_aldc(bool wide) { ...@@ -427,7 +427,7 @@ void TemplateTable::fast_aldc(bool wide) {
Label L_done, L_throw_exception; Label L_done, L_throw_exception;
const Register con_klass_temp = rcx; // same as cache const Register con_klass_temp = rcx; // same as cache
const Register array_klass_temp = rdx; // same as index const Register array_klass_temp = rdx; // same as index
__ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); __ load_klass(con_klass_temp, rax);
__ lea(array_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); __ lea(array_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr()));
__ cmpptr(con_klass_temp, Address(array_klass_temp, 0)); __ cmpptr(con_klass_temp, Address(array_klass_temp, 0));
__ jcc(Assembler::notEqual, L_done); __ jcc(Assembler::notEqual, L_done);
...@@ -438,7 +438,7 @@ void TemplateTable::fast_aldc(bool wide) { ...@@ -438,7 +438,7 @@ void TemplateTable::fast_aldc(bool wide) {
// Load the exception from the system-array which wraps it: // Load the exception from the system-array which wraps it:
__ bind(L_throw_exception); __ bind(L_throw_exception);
__ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); __ load_heap_oop(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
__ jump(ExternalAddress(Interpreter::throw_exception_entry())); __ jump(ExternalAddress(Interpreter::throw_exception_entry()));
__ bind(L_done); __ bind(L_done);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册