Re: [rvm-research] Quick Question about genThreadSwitchTest code Intention

"David P Grove" <[email protected]> Wed, 25 Nov 2020 15:44:52 -0500
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <OF79EFE39C.1EBCB85D-ON8525862B.00718F85-8525862B.0071F8D5@notes.na.collabserv.com>
--===============1146154675125674241==
Content-type: multipart/alternative; 
	Boundary="0__=0ABB0CB8DFE209158f9e8a93df938690918c0ABB0CB8DFE20915"
Content-Disposition: inline


--0__=0ABB0CB8DFE209158f9e8a93df938690918c0ABB0CB8DFE20915
Content-Transfer-Encoding: quoted-printable
Content-type: text/plain; charset=US-ASCII




Khaled Z Mahmoud <[email protected]> wrote on 11/23/2020 01:25:16 AM:
>
> In method genThreadSwitchTest, Line Number: 4190
> Line:4197
> --> asm.emitCMP=5FRegDisp=5FImm(THREAD=5FREGISTER,
> Entrypoints.takeYieldpointField.getOffset(), 0);
>
> // Take yieldpoint if yieldpoint flag is non-zero (either 1 or -1)
> fr1 =3D asm.forwardJcc(EQ);
> yieldOffset =3D Entrypoints.yieldpointFromPrologueMethod.getOffset();
>
> My question is :
> fr1 =3D asm.forwardJcc(EQ) --> The condition works if "takeYieldpoint=3D=
=3D0".
> So either, the comment is wrong, or the intention of the code is wrong.

Hi,

	The comment is correct.  The code is generating a branch around a
call to the yieldpointFromPrologueMethod.  Therefore, the test is inverted.
Test succeeds, jump over the call (no yieldpoint). Test fails, don't jump,
fall through and execute the call to yieldpoint method.

--dave



>
> 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=5FRegDisp=5FImm(THREAD=5FREGISTER,
> Entrypoints.takeYieldpointField.getOffset(), 1);
>
>

--0__=0ABB0CB8DFE209158f9e8a93df938690918c0ABB0CB8DFE20915
Content-Transfer-Encoding: quoted-printable
Content-type: text/html; charset=US-ASCII
Content-Disposition: inline

<html><body><p><tt><font size=3D"2">Khaled Z Mahmoud &lt;kmahmou1@binghamto=
n.edu&gt; wrote on 11/23/2020 01:25:16 AM:<br>&gt; <br>&gt; In method genTh=
readSwitchTest, Line Number: 4190<br>&gt; Line:4197<br>&gt; --&gt; asm.emit=
CMP=5FRegDisp=5FImm(THREAD=5FREGISTER,<br>&gt; Entrypoints.takeYieldpointFi=
eld.getOffset(), 0);<br>&gt; <br>&gt; // Take yieldpoint if yieldpoint flag=
 is non-zero (either 1 or -1)<br>&gt; fr1 =3D asm.forwardJcc(EQ);<br>&gt; y=
ieldOffset =3D Entrypoints.yieldpointFromPrologueMethod.getOffset();<br>&gt=
; <br>&gt; My question is :<br>&gt; fr1 =3D asm.forwardJcc(EQ) --&gt; The c=
ondition works if &quot;takeYieldpoint=3D=3D0&quot;.<br>&gt; So either, the=
 comment is wrong, or the intention of the code is wrong.</font></tt><br><b=
r><tt><font size=3D"2">Hi,</font></tt><br><br><tt><font size=3D"2">        =
The comment is correct. &nbsp;The code is generating a branch around a call=
 to the yieldpointFromPrologueMethod. &nbsp;Therefore, the test is inverted=
. &nbsp;Test succeeds, jump over the call (no yieldpoint). Test fails, don'=
t jump, fall through and execute the call to yieldpoint method.</font></tt>=
<br><br><tt><font size=3D"2">--dave</font></tt><br><br><br><tt><font size=
=3D"2"><br>&gt; <br>&gt; With no Adaptive Optimization System enabled, the =
yieldpoint will be<br>&gt; invoked every time. However, this is not a big d=
eal, since it<br>&gt; virtually does nothing when the Adaptive System is di=
sabled.<br>&gt; <br>&gt; I am asking this question to understand things jus=
t a little bit deeper.<br>&gt; So, it should be:<br>&gt; asm.emitCMP=5FRegD=
isp=5FImm(THREAD=5FREGISTER,<br>&gt; Entrypoints.takeYieldpointField.getOff=
set(), 1);<br>&gt; <br>&gt; <br></font></tt><BR>
</body></html>

--0__=0ABB0CB8DFE209158f9e8a93df938690918c0ABB0CB8DFE20915--



--===============1146154675125674241==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1146154675125674241==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

--===============1146154675125674241==--