A small change which avoids a C runtime call on the fast path of ForkJoin.par. The purpose of this C call, previously, was just to read and return the spareHeartbeatTokens field of the GCState.
We can avoid the overhead of the C runtime call by generating the appropriate code to read directly from the GCState. To do this, I implemented a new prim called Heartbeat_tokens which is eliminated in the ssa2-to-rssa pass.
I also renamed spareHeartbeats -> spareHeartbeatTokens in the runtime system for consistency.
A small change which avoids a C runtime call on the fast path of
ForkJoin.par
. The purpose of this C call, previously, was just to read and return thespareHeartbeatTokens
field of the GCState.We can avoid the overhead of the C runtime call by generating the appropriate code to read directly from the GCState. To do this, I implemented a new prim called
Heartbeat_tokens
which is eliminated in thessa2-to-rssa
pass.I also renamed
spareHeartbeats
->spareHeartbeatTokens
in the runtime system for consistency.