diff --git a/runtime/compiler/env/VMJ9.h b/runtime/compiler/env/VMJ9.h index 90369ea94f2..bc03140eb27 100644 --- a/runtime/compiler/env/VMJ9.h +++ b/runtime/compiler/env/VMJ9.h @@ -495,8 +495,6 @@ class TR_J9VMBase : public TR_FrontEnd virtual TR::TreeTop *lowerTree(TR::Compilation *, TR::Node *, TR::TreeTop *); - virtual bool canRelocateDirectNativeCalls() {return true; } - virtual bool storeOffsetToArgumentsInVirtualIndirectThunks() { return false; } @@ -1408,7 +1406,6 @@ class TR_J9SharedCacheVM : public TR_J9VM // replacing calls to isAOT virtual bool canUseSymbolValidationManager() { return true; } virtual bool supportsCodeCacheSnippets() { return false; } - virtual bool canRelocateDirectNativeCalls() { return false; } virtual bool needClassAndMethodPointerRelocations() { return true; } virtual bool inlinedAllocationsMustBeVerified() { return true; } virtual bool needRelocationsForHelpers() { return true; } diff --git a/runtime/compiler/env/VMJ9Server.hpp b/runtime/compiler/env/VMJ9Server.hpp index ff0d4e806bf..b415a96e1ad 100644 --- a/runtime/compiler/env/VMJ9Server.hpp +++ b/runtime/compiler/env/VMJ9Server.hpp @@ -274,7 +274,6 @@ class TR_J9SharedCacheServerVM: public TR_J9ServerVM // replacing calls to isAOT virtual bool canUseSymbolValidationManager() override { return true; } virtual bool supportsCodeCacheSnippets() override { return false; } - virtual bool canRelocateDirectNativeCalls() override { return false; } virtual bool needClassAndMethodPointerRelocations() override { return true; } virtual bool inlinedAllocationsMustBeVerified() override { return true; } virtual bool needRelocationsForHelpers() override { return true; } diff --git a/runtime/compiler/p/codegen/J9CodeGenerator.cpp b/runtime/compiler/p/codegen/J9CodeGenerator.cpp index 7a347162f62..20c879ff71c 100644 --- a/runtime/compiler/p/codegen/J9CodeGenerator.cpp +++ b/runtime/compiler/p/codegen/J9CodeGenerator.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2021 IBM Corp. and others + * Copyright (c) 2000, 2022 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 @@ -747,7 +747,7 @@ J9::Power::CodeGenerator::deriveCallingLinkage(TR::Node *node, bool isIndirect) static char * disableDirectNativeCall = feGetEnv("TR_DisableDirectNativeCall"); // Clean-up: the fej9 checking seemed unnecessary - if (!isIndirect && callee->isJNI() && fej9->canRelocateDirectNativeCalls() && + if (!isIndirect && callee->isJNI() && (node->isPreparedForDirectJNI() || (disableDirectNativeCall == NULL && callee->getResolvedMethodSymbol()->canDirectNativeCall()))) return self()->getLinkage(TR_J9JNILinkage); diff --git a/runtime/compiler/p/codegen/J9CodeGenerator.hpp b/runtime/compiler/p/codegen/J9CodeGenerator.hpp index 52d021b5b7b..a672b24baf0 100644 --- a/runtime/compiler/p/codegen/J9CodeGenerator.hpp +++ b/runtime/compiler/p/codegen/J9CodeGenerator.hpp @@ -111,6 +111,7 @@ class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator * \brief Determines whether the code generator supports stack allocations */ bool supportsStackAllocations() { return true; } + bool supportsDirectJNICallsForAOT() { return true; } // See J9::CodeGenerator::guaranteesResolvedDirectDispatchForSVM bool guaranteesResolvedDirectDispatchForSVM() { return true; }