8236992: AArch64: remove redundant load_klass in itable stub

Reviewed-by: aph, adinn
This commit is contained in:
Nick Gasson 2020-01-17 09:30:52 +08:00
parent 567465c62c
commit 18d73cb8e5

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -170,11 +170,13 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
// rscratch2: CompiledICHolder
// j_rarg0: Receiver
// Most registers are in use; we'll use r16, rmethod, r10, r11
// This stub is called from compiled code which has no callee-saved registers,
// so all registers except arguments are free at this point.
const Register recv_klass_reg = r10;
const Register holder_klass_reg = r16; // declaring interface klass (DECC)
const Register resolved_klass_reg = rmethod; // resolved interface klass (REFC)
const Register temp_reg = r11;
const Register temp_reg2 = r15;
const Register icholder_reg = rscratch2;
Label L_no_such_interface;
@ -189,11 +191,10 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
__ load_klass(recv_klass_reg, j_rarg0);
// Receiver subtype check against REFC.
// Destroys recv_klass_reg value.
__ lookup_interface_method(// inputs: rec. class, interface
recv_klass_reg, resolved_klass_reg, noreg,
// outputs: scan temp. reg1, scan temp. reg2
recv_klass_reg, temp_reg,
temp_reg2, temp_reg,
L_no_such_interface,
/*return_method=*/false);
@ -201,7 +202,6 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
start_pc = __ pc();
// Get selected method from declaring class and itable index
__ load_klass(recv_klass_reg, j_rarg0); // restore recv_klass_reg
__ lookup_interface_method(// inputs: rec. class, interface, itable index
recv_klass_reg, holder_klass_reg, itable_index,
// outputs: method, scan temp. reg
@ -211,7 +211,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
const ptrdiff_t lookupSize = __ pc() - start_pc;
// Reduce "estimate" such that "padding" does not drop below 8.
const ptrdiff_t estimate = 152;
const ptrdiff_t estimate = 124;
const ptrdiff_t codesize = typecheckSize + lookupSize;
slop_delta = (int)(estimate - codesize);
slop_bytes += slop_delta;