1 //
2 // Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 // Copyright 2012, 2015 SAP AG. All rights reserved.
4 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 //
6 // This code is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License version 2 only, as
8 // published by the Free Software Foundation.
9 //
10 // This code is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 // version 2 for more details (a copy is included in the LICENSE file that
14 // accompanied this code).
15 //
16 // You should have received a copy of the GNU General Public License version
17 // 2 along with this work; if not, write to the Free Software Foundation,
18 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 //
20 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 // or visit www.oracle.com if you need additional information or have any
22 // questions.
3545 AddressLiteral empty_ic((address) Universe::non_oop_word());
3546 bool success = __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc, /*fixed_size*/ true);
3547 if (!success) {
3548 ciEnv::current()->record_out_of_memory_failure();
3549 return;
3550 }
3551 // CALL to fixup routine. Fixup routine uses ScopeDesc info
3552 // to determine who we intended to call.
3553 __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
3554 emit_call_with_trampoline_stub(_masm, (address)$meth$$method, relocInfo::none);
3555 assert(((MachCallDynamicJavaNode*)this)->ret_addr_offset() == __ offset() - start_offset,
3556 "Fix constant in ret_addr_offset()");
3557 } else {
3558 assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
3559 // Go thru the vtable. Get receiver klass. Receiver already
3560 // checked for non-null. If we'll go thru a C2I adapter, the
3561 // interpreter expects method in R19_method.
3562
3563 __ load_klass(R11_scratch1, R3);
3564
3565 int entry_offset = InstanceKlass::vtable_start_offset() + _vtable_index * vtableEntry::size();
3566 int v_off = entry_offset * wordSize + vtableEntry::method_offset_in_bytes();
3567 __ li(R19_method, v_off);
3568 __ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/);
3569 // NOTE: for vtable dispatches, the vtable entry will never be
3570 // null. However it may very well end up in handle_wrong_method
3571 // if the method is abstract for the particular class.
3572 __ ld(R11_scratch1, in_bytes(Method::from_compiled_offset()), R19_method);
3573 // Call target. Either compiled code or C2I adapter.
3574 __ mtctr(R11_scratch1);
3575 __ bctrl();
3576 if (((MachCallDynamicJavaNode*)this)->ret_addr_offset() != __ offset() - start_offset) {
3577 tty->print(" %d, %d\n", ((MachCallDynamicJavaNode*)this)->ret_addr_offset(),__ offset() - start_offset);
3578 }
3579 assert(((MachCallDynamicJavaNode*)this)->ret_addr_offset() == __ offset() - start_offset,
3580 "Fix constant in ret_addr_offset()");
3581 }
3582 #endif
3583 Unimplemented(); // ret_addr_offset not yet fixed. Depends on compressed oops (load klass!).
3584 %}
3585
3586 // a runtime call
|
1 //
2 // Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
3 // Copyright 2012, 2015 SAP AG. All rights reserved.
4 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 //
6 // This code is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License version 2 only, as
8 // published by the Free Software Foundation.
9 //
10 // This code is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 // version 2 for more details (a copy is included in the LICENSE file that
14 // accompanied this code).
15 //
16 // You should have received a copy of the GNU General Public License version
17 // 2 along with this work; if not, write to the Free Software Foundation,
18 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 //
20 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 // or visit www.oracle.com if you need additional information or have any
22 // questions.
3545 AddressLiteral empty_ic((address) Universe::non_oop_word());
3546 bool success = __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc, /*fixed_size*/ true);
3547 if (!success) {
3548 ciEnv::current()->record_out_of_memory_failure();
3549 return;
3550 }
3551 // CALL to fixup routine. Fixup routine uses ScopeDesc info
3552 // to determine who we intended to call.
3553 __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
3554 emit_call_with_trampoline_stub(_masm, (address)$meth$$method, relocInfo::none);
3555 assert(((MachCallDynamicJavaNode*)this)->ret_addr_offset() == __ offset() - start_offset,
3556 "Fix constant in ret_addr_offset()");
3557 } else {
3558 assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
3559 // Go thru the vtable. Get receiver klass. Receiver already
3560 // checked for non-null. If we'll go thru a C2I adapter, the
3561 // interpreter expects method in R19_method.
3562
3563 __ load_klass(R11_scratch1, R3);
3564
3565 int entry_offset = in_bytes(InstanceKlass::vtable_start_offset()) + _vtable_index * vtableEntry::size_in_bytes();
3566 int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
3567 __ li(R19_method, v_off);
3568 __ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/);
3569 // NOTE: for vtable dispatches, the vtable entry will never be
3570 // null. However it may very well end up in handle_wrong_method
3571 // if the method is abstract for the particular class.
3572 __ ld(R11_scratch1, in_bytes(Method::from_compiled_offset()), R19_method);
3573 // Call target. Either compiled code or C2I adapter.
3574 __ mtctr(R11_scratch1);
3575 __ bctrl();
3576 if (((MachCallDynamicJavaNode*)this)->ret_addr_offset() != __ offset() - start_offset) {
3577 tty->print(" %d, %d\n", ((MachCallDynamicJavaNode*)this)->ret_addr_offset(),__ offset() - start_offset);
3578 }
3579 assert(((MachCallDynamicJavaNode*)this)->ret_addr_offset() == __ offset() - start_offset,
3580 "Fix constant in ret_addr_offset()");
3581 }
3582 #endif
3583 Unimplemented(); // ret_addr_offset not yet fixed. Depends on compressed oops (load klass!).
3584 %}
3585
3586 // a runtime call
|