[rvm-research] Quick Question about genThreadSwitchTest code Intention

Khaled Z Mahmoud <[email protected]> Mon, 23 Nov 2020 01:25:16 -0500
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <CAER=_eUGi_7MDiqFmRv0HpdYDysQm3TRBS5fkQJJGZiV53qrdg@mail.gmail.com>
Hi,

In method genThreadSwitchTest, Line Number: 4190
Line:4197
--> asm.emitCMP_RegDisp_Imm(THREAD_REGISTER,
Entrypoints.takeYieldpointField.getOffset(), 0);

// Take yieldpoint if yieldpoint flag is non-zero (either 1 or -1)
fr1 = asm.forwardJcc(EQ);
yieldOffset = Entrypoints.yieldpointFromPrologueMethod.getOffset();

My question is :
fr1 = asm.forwardJcc(EQ) --> The condition works if "takeYieldpoint==0".
So either, the comment is wrong, or the intention of the code is wrong.

With no Adaptive Optimization System enabled, the yieldpoint will be
invoked every time. However, this is not a big deal, since it
virtually does nothing when the Adaptive System is disabled.

I am asking this question to understand things just a little bit deeper.
So, it should be:
asm.emitCMP_RegDisp_Imm(THREAD_REGISTER,
Entrypoints.takeYieldpointField.getOffset(), 1);


-- 
Regards,
Khaled Mahmoud