Skip to content

Commit

Permalink
Merge pull request #4615 from 0xdaryl/nolinkageinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
fjeremic authored May 8, 2020
2 parents 1404a27 + 47ebb3c commit 2b855d4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 84 deletions.
10 changes: 0 additions & 10 deletions compiler/env/FEBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ TR::OptionTable OMR::Options::_feOptions[] =

#include "control/Recompilation.hpp"

void TR_LinkageInfo::setHasBeenRecompiled()
{
}


void TR_LinkageInfo::setHasFailedRecompilation()
{
}



// S390 specific fucntion - FIXME: make this only be a problem when HOST is s390. Also, use a better
// name for this
Expand Down
3 changes: 2 additions & 1 deletion compiler/p/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "control/Options_inlines.hpp"
#include "control/Recompilation.hpp"
#ifdef J9_PROJECT_SPECIFIC
#include "codegen/PrivateLinkage.hpp"
#include "control/RecompilationInfo.hpp"
#endif
#include "env/CompilerEnv.hpp"
Expand Down Expand Up @@ -1791,7 +1792,7 @@ void OMR::Power::CodeGenerator::doBinaryEncoding()
#ifdef J9_PROJECT_SPECIFIC
if (data.recomp!=NULL && data.recomp->couldBeCompiledAgain())
{
TR_LinkageInfo *lkInfo = TR_LinkageInfo::get(self()->getCodeStart());
J9::PrivateLinkage::LinkageInfo *lkInfo = J9::PrivateLinkage::LinkageInfo::get(self()->getCodeStart());
if (data.recomp->useSampling())
lkInfo->setSamplingMethodBody();
else
Expand Down
65 changes: 0 additions & 65 deletions compiler/runtime/Runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,71 +65,6 @@ enum TR_CCPreLoadedCode
TR_numCCPreLoadedCode
};

///////////////////////////////////////////
// TR_LinkageInfo
//
// Non-instantiable Abstract Class
// Cannot have any virtual methods in here
//
///////////////////////////////////////////

class TR_LinkageInfo
{
public:
static TR_LinkageInfo *get(void *startPC) { return (TR_LinkageInfo*)(((uint32_t*)startPC)-1); }

void setCountingMethodBody() { _word |= CountingPrologue; }
void setSamplingMethodBody() { _word |= SamplingPrologue; }
void setHasBeenRecompiled();
void setHasFailedRecompilation();
void setIsBeingRecompiled() { _word |= IsBeingRecompiled; }
void resetIsBeingRecompiled() { _word &= ~IsBeingRecompiled; }

bool isCountingMethodBody() { return (_word & CountingPrologue) != 0; }
bool isSamplingMethodBody() { return (_word & SamplingPrologue) != 0; }
bool isRecompMethodBody() { return (_word & (SamplingPrologue | CountingPrologue)) != 0; }
bool hasBeenRecompiled() { return (_word & HasBeenRecompiled) != 0; }
bool hasFailedRecompilation() { return (_word & HasFailedRecompilation) != 0; }
bool recompilationAttempted() { return hasBeenRecompiled() || hasFailedRecompilation(); }
bool isBeingCompiled() { return (_word & IsBeingRecompiled) != 0; }

inline uint16_t getReservedWord() { return (_word & ReservedMask) >> 16; }
inline void setReservedWord(uint16_t w) { _word |= ((w << 16) & ReservedMask); }

int32_t getJitEntryOffset()
{
#if defined(TR_TARGET_X86) && defined(TR_TARGET_32BIT)
return 0;
#else
return getReservedWord();
#endif
}

enum
{
ReturnInfoMask = 0x0000000F, // bottom 4 bits
// The VM depends on these four bits - word to the wise: don't mess

SamplingPrologue = 0x00000010,
CountingPrologue = 0x00000020,
// NOTE: flags have to be set under the compilation monitor or during compilation process
HasBeenRecompiled = 0x00000040,
HasFailedRecompilation = 0x00000100,
IsBeingRecompiled = 0x00000200,

// RESERVED:
// non-ia32: 0xffff0000 <---- jitEntryOffset
// ia32: 0xffff0000 <---- Recomp/FSD save area

ReservedMask = 0xFFFF0000
};

uint32_t _word;

private:
TR_LinkageInfo() {};
};


/**
* Runtime Helper Table.
Expand Down
10 changes: 3 additions & 7 deletions compiler/x/codegen/X86BinaryEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,18 +1228,14 @@ uint8_t* TR::X86ImmSymInstruction::generateOperand(uint8_t* cursor)

if (comp->isRecursiveMethodTarget(sym))
{
// Compute method's jit entry point
//
uint8_t *start = cg()->getCodeStart();
targetAddress = cg()->getLinkage()->entryPointFromCompiledMethod();

if (comp->target().is64Bit())
{
start += TR_LinkageInfo::get(start)->getReservedWord();
TR_ASSERT_FATAL(comp->target().cpu.isTargetWithinRIPRange((intptr_t)start, nextInstructionAddress),
TR_ASSERT_FATAL(comp->target().cpu.isTargetWithinRIPRange(targetAddress, nextInstructionAddress),
"Method start must be within RIP range");
cg()->fe()->reserveTrampolineIfNecessary(comp, getSymbolReference(), true);
}

targetAddress = (intptr_t)start;
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion compiler/z/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "control/Options_inlines.hpp"
#include "control/Recompilation.hpp"
#ifdef J9_PROJECT_SPECIFIC
#include "codegen/PrivateLinkage.hpp"
#include "control/RecompilationInfo.hpp"
#endif
#include "cs2/hashtab.h"
Expand Down Expand Up @@ -2466,7 +2467,7 @@ OMR::Z::CodeGenerator::doBinaryEncoding()
#ifdef J9_PROJECT_SPECIFIC
if (recomp != NULL && recomp->couldBeCompiledAgain())
{
TR_LinkageInfo * linkageInfo = TR_LinkageInfo::get(self()->getCodeStart());
J9::PrivateLinkage::LinkageInfo * linkageInfo = J9::PrivateLinkage::LinkageInfo::get(self()->getCodeStart());
if (recomp->useSampling())
{
recompFlag = METHOD_SAMPLING_RECOMPILATION;
Expand Down

0 comments on commit 2b855d4

Please sign in to comment.