runtimeverification / llvm-backend

KORE to llvm translation
BSD 3-Clause "New" or "Revised" License
34 stars 22 forks source link

add kore_clear function that clears alwaysgcspace on every step #1089

Closed dwightguth closed 3 months ago

dwightguth commented 4 months ago

This is one of a sequence of PRs designed to make progress towards generating stack maps so that we can trigger the GC during allocation rather than in between rewrite steps only. The first few PRs will be preliminaries that add small features that will be used by future PRs.

This PR separates koreCollect's logic for collecting the gc'd heap from its logic for resetting the alwaysgcspace arena. We separate the logic for resetting the alwaysgcspace arena into a new method, kore_clear. This function is no longer called by the garbage collector, but it is called after every rewrite step. This is a slight increase in overhead since we are clearing it more frequently, but the flip side is that it should have better locality which may improve the processor's dcache, since we are clearing it much more frequently. The clear itself is a very fast operation, only involving a few simple pointer operations.