Skip to content
Permalink
Browse files

8236992: AArch64: remove redundant load_klass in itable stub

Reviewed-by: aph, adinn
  • Loading branch information
nick-arm committed Jan 17, 2020
1 parent 567465c commit 18d73cb8e5cd8b9fe3dca798c0978a63afc3bf0d
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
@@ -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,19 +191,17 @@ 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);

const ptrdiff_t typecheckSize = __ pc() - start_pc;
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;

0 comments on commit 18d73cb

Please sign in to comment.
You can’t perform that action at this time.