Skip to content

Commit

Permalink
Store Debug Counter Relocation to the SCC on ARM
Browse files Browse the repository at this point in the history
Signed-off-by: Irwin D'Souza <[email protected]>
  • Loading branch information
Irwin D'Souza committed Jun 28, 2018
1 parent c070460 commit 7efa689
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions runtime/compiler/arm/codegen/J9AheadOfTimeCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,35 @@ uint8_t *J9::ARM::AheadOfTimeCompile::initializeAOTRelocationHeader(TR::Iterated
}
break;

case TR_DebugCounter:
{
TR::DebugCounterBase *counter = (TR::DebugCounterBase *) relocation->getTargetAddress();
if (!counter || !counter->getReloData() || !counter->getName())
comp->failCompilation<TR::CompilationException>("Failed to generate debug counter relo data");

TR::DebugCounterReloData *counterReloData = counter->getReloData();

uintptrj_t offset = (uintptrj_t)fej9->sharedCache()->rememberDebugCounterName(counter->getName());

uint8_t flags = (uint8_t)counterReloData->_seqKind;
TR_ASSERT((flags & RELOCATION_CROSS_PLATFORM_FLAGS_MASK) == 0, "reloFlags bits overlap cross-platform flags bits\n");
*flagsCursor |= (flags & RELOCATION_RELOC_FLAGS_MASK);

*(uintptrj_t *)cursor = (uintptrj_t)counterReloData->_callerIndex;
cursor += SIZEPOINTER;
*(uintptrj_t *)cursor = (uintptrj_t)counterReloData->_bytecodeIndex;
cursor += SIZEPOINTER;
*(uintptrj_t *)cursor = offset;
cursor += SIZEPOINTER;
*(uintptrj_t *)cursor = (uintptrj_t)counterReloData->_delta;
cursor += SIZEPOINTER;
*(uintptrj_t *)cursor = (uintptrj_t)counterReloData->_fidelity;
cursor += SIZEPOINTER;
*(uintptrj_t *)cursor = (uintptrj_t)counterReloData->_staticDelta;
cursor += SIZEPOINTER;
}
break;

}
return cursor;
}
Expand Down Expand Up @@ -717,6 +746,7 @@ uint32_t J9::ARM::AheadOfTimeCompile::_relocationTargetTypeToHeaderSizeMap[TR_Nu
0, // TR_NativeMethodAbsolute = 56,
0, // TR_NativeMethodRelative = 57,
16, // TR_ArbitraryClassAddress = 58,
28 // TR_DebugCounter = 59
};


Expand Down

0 comments on commit 7efa689

Please sign in to comment.