Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.27.1) Need to consider Portable-AOT cases during code patching #13387

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions runtime/compiler/runtime/Trampoline.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -480,10 +480,13 @@ bool ppcCodePatching(void *method, void *callSite, void *currentPC, void *curren

oldBits = *(int32_t *)((uint8_t *)callSite - encodingStartOffset); // The load of the first IPIC cache slot or rldimi
#if defined(TR_TARGET_64BIT)
if (TR::Compiler->target.cpu.isAtLeast(OMR_PROCESSOR_PPC_P10))

distance = *(int32_t *)((uint8_t *)callSite - encodingStartOffset - 4);
// Testing if it is really a paddi case
if (TR::Compiler->target.cpu.isAtLeast(OMR_PROCESSOR_PPC_P10) &&
(((distance >> 20) & 0x00000FFF) == 0x061))
{
// oldBits is the latter half of paddi
distance = *(int32_t *)((uint8_t *)callSite - encodingStartOffset - 4);
distance = (distance & 0x0003FFFF) << 16; // Getting the top-18-bits and shifted into place
distance |= oldBits & 0x0000FFFF; // Concatenate with the bottom-16-bits
distance = (distance << 30) >> 30; // sign-extend
Expand Down