runtimeverification / llvm-backend

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

simplify gc code for alwaysgc roots #1083

Closed dwightguth closed 1 month ago

dwightguth commented 1 month ago

When we were trying to fix the GC for kompile -O3 on EVM, we added some logic to deal with the case where a map/list/set was a garbage collection root. Over the course of several iterations, that code evolved, and eventually became rather complex. However, it came to my attention analyzing the code that some of the complexity that was added early on was made redundant by later complexity. So we are actually able to simplify somewhat.

What this PR does is remove the is_block boolean parameter everywhere. This was being done because we were passing a block * for map/list/set pointers that had been promoted from the alwaysgcspace to the youngspace. However, the new derived pointer logic we added can handle derived pointers to embedded map/list/set objects now, so this is no longer necessary.

I may make further simplifications to this logic in the near future; I am considering how it may interact with changes that would make the garbage collector walk the stack. However, this is an intermediate step that I was able to write and test to ensure it didn't break anything, and since it is overall a deletion of code, I wanted to get it in first.

Baltoli commented 1 month ago

Makes sense to me as a subtractive change.