Skip to content

Commit

Permalink
Merge pull request #14894 from bhavanisn/enableDirectJNI
Browse files Browse the repository at this point in the history
Re-enables JNI-direct for AOT on Power
  • Loading branch information
ymanton authored Apr 19, 2022
2 parents 2fd77d9 + 0c1cb72 commit bb0b566
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions runtime/compiler/env/VMJ9.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }


Expand Down Expand Up @@ -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; }
Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/env/VMJ9Server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/p/codegen/J9CodeGenerator.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions runtime/compiler/p/codegen/J9CodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit bb0b566

Please sign in to comment.