Skip to content

Commit

Permalink
Reset trampoline pointers to top of space
Browse files Browse the repository at this point in the history
After flushing the code cache under FSD there is a call to resetTrampolines.
The _trampolineAllocationMark and _trampolineReservationMark need to be reset
to their starting positions but were incorrectly set to the end of the trampoline
space. As a result all active segments at the time of the cache flush are marked
as full (assuming a platform that uses trampolines). This can be seen by taking
a JIT verbose log with option `codecache` which will show

CODECACHE:  CodeCache 00007E759000C660 marked as full in reserveSpaceForTrampoline
  • Loading branch information
JamesKingdon committed Nov 19, 2024
1 parent f7ddf02 commit bee4454
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/compiler/runtime/J9CodeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,10 @@ J9::CodeCache::resetTrampolines()
}

//reset the trampoline marks back to their starting positions
_trampolineAllocationMark = _trampolineBase;
_trampolineReservationMark = _trampolineBase;
// Note that permanent trampolines are allocated from _tempTrampolineBase downwards
// see initialize in OMRCodeCache.cpp
_trampolineAllocationMark = _tempTrampolineBase;
_trampolineReservationMark = _tempTrampolineBase;

OMR::CodeCacheTempTrampolineSyncBlock *syncBlock;
if (!_tempTrampolinesMax)
Expand Down

0 comments on commit bee4454

Please sign in to comment.