Skip to content

Commit

Permalink
Add support for relo records for block freqeuncy and recomp queued flag
Browse files Browse the repository at this point in the history
In OpenJ9 the JProfiling framework is used to create profiled code
which contains references to internal data structures like block
frequencies stored in `TR_BlockFrequencInfo` class, or the flag for
checking if the method is already in recompilation queue.
To support AOT compilation for such code, we need to generate relocation
records for such data structures referenced by the compiled code.
OpenJ9 PR eclipse-openj9/openj9#9591 creates the necessary
structures representing the relocation record for this data.
This commit adds the changes required by the OpenJ9 PR by adding
required enum for new relocation records and providing API for tagging
the symbols appropriately.

Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
  • Loading branch information
ashu-mehra committed Jan 4, 2021
1 parent d19d2ff commit 0729dae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion compiler/codegen/Relocation.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 @@ -481,6 +481,8 @@ const char *TR::ExternalRelocation::_externalRelocationTargetKindNames[TR_NumExt
"TR_MethodCallAddress (99)",
"TR_DiscontiguousSymbolFromManager (100)",
"TR_ResolvedTrampolines (101)",
"TR_BlockFrequency (102)",
"TR_RecompQueuedFlag (103)",
};

uintptr_t TR::ExternalRelocation::_globalValueList[TR_NumGlobalValueItems] =
Expand Down
10 changes: 9 additions & 1 deletion compiler/il/OMRSymbol.hpp
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 @@ -276,6 +276,12 @@ class OMR_EXTENSIBLE Symbol
void setIsDebugCounter() { _flags2.set(DebugCounter); }
bool isDebugCounter() { return _flags2.testAny(DebugCounter); }

void setIsBlockFrequency() { _flags2.set(BlockFrequency); }
bool isBlockFrequency() { return _flags2.testAny(BlockFrequency); }

void setIsRecompQueuedFlag() { _flags2.set(RecompQueuedFlag); }
bool isRecompQueuedFlag() { return _flags2.testAny(RecompQueuedFlag); }

inline bool isNamed();

// flag methods specific to Autos
Expand Down Expand Up @@ -558,6 +564,8 @@ class OMR_EXTENSIBLE Symbol
PendingPush = 0x00000800,
ConstantDynamic = 0x00001000,
NonSpecificConstObject = 0x00002000, // Constant object not specific to a type
BlockFrequency = 0x00004000,
RecompQueuedFlag = 0x00008000,
};

protected:
Expand Down
6 changes: 4 additions & 2 deletions compiler/runtime/Runtime.hpp
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 @@ -327,7 +327,9 @@ typedef enum
TR_MethodCallAddress = 99,
TR_DiscontiguousSymbolFromManager = 100,
TR_ResolvedTrampolines = 101,
TR_NumExternalRelocationKinds = 102,
TR_BlockFrequency = 102,
TR_RecompQueuedFlag = 103,
TR_NumExternalRelocationKinds = 104,
TR_ExternalRelocationTargetKindMask = 0xff,
} TR_ExternalRelocationTargetKind;

Expand Down

0 comments on commit 0729dae

Please sign in to comment.