diff options
author | dbuck <none@none> | 2017-09-29 14:30:05 -0400 |
---|---|---|
committer | dbuck <none@none> | 2017-09-29 14:30:05 -0400 |
commit | 68091cca866d363f02eb19946245d0d8edcd610a (patch) | |
tree | ece7c3dd0669bc31e9256dc43470cabd65665102 /src/cpu/x86/vm/macroAssembler_x86.cpp | |
parent | 83989c138b7add0da4ded271422bc1a38734e989 (diff) | |
download | jdk8u_hotspot-68091cca866d363f02eb19946245d0d8edcd610a.tar.gz |
8174962: Better interface invocations
Reviewed-by: jrose, coleenp, ahgross, acorn, vlivanov
Diffstat (limited to 'src/cpu/x86/vm/macroAssembler_x86.cpp')
-rw-r--r-- | src/cpu/x86/vm/macroAssembler_x86.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/cpu/x86/vm/macroAssembler_x86.cpp b/src/cpu/x86/vm/macroAssembler_x86.cpp index 9711089a4..9664c6b52 100644 --- a/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -4853,8 +4853,13 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, RegisterOrConstant itable_index, Register method_result, Register scan_temp, - Label& L_no_such_interface) { - assert_different_registers(recv_klass, intf_klass, method_result, scan_temp); + Label& L_no_such_interface, + bool return_method) { + assert_different_registers(recv_klass, intf_klass, scan_temp); + assert_different_registers(method_result, intf_klass, scan_temp); + assert(recv_klass != method_result || !return_method, + "recv_klass can be destroyed when method isn't needed"); + assert(itable_index.is_constant() || itable_index.as_register() == method_result, "caller must use same register for non-constant itable index as for method"); @@ -4876,9 +4881,11 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, round_to(scan_temp, BytesPerLong); } - // Adjust recv_klass by scaled itable_index, so we can free itable_index. - assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); - lea(recv_klass, Address(recv_klass, itable_index, Address::times_ptr, itentry_off)); + if (return_method) { + // Adjust recv_klass by scaled itable_index, so we can free itable_index. + assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); + lea(recv_klass, Address(recv_klass, itable_index, Address::times_ptr, itentry_off)); + } // for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) { // if (scan->interface() == intf) { @@ -4912,9 +4919,11 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, bind(found_method); - // Got a hit. - movl(scan_temp, Address(scan_temp, itableOffsetEntry::offset_offset_in_bytes())); - movptr(method_result, Address(recv_klass, scan_temp, Address::times_1)); + if (return_method) { + // Got a hit. + movl(scan_temp, Address(scan_temp, itableOffsetEntry::offset_offset_in_bytes())); + movptr(method_result, Address(recv_klass, scan_temp, Address::times_1)); + } } |