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 <kmahmou1@binghamto= n.edu> wrote on 11/23/2020 01:25:16 AM:<br>> <br>> In method genTh= readSwitchTest, Line Number: 4190<br>> Line:4197<br>> --> asm.emit= CMP=5FRegDisp=5FImm(THREAD=5FREGISTER,<br>> Entrypoints.takeYieldpointFi= eld.getOffset(), 0);<br>> <br>> // Take yieldpoint if yieldpoint flag= is non-zero (either 1 or -1)<br>> fr1 =3D asm.forwardJcc(EQ);<br>> y= ieldOffset =3D Entrypoints.yieldpointFromPrologueMethod.getOffset();<br>>= ; <br>> My question is :<br>> fr1 =3D asm.forwardJcc(EQ) --> The c= ondition works if "takeYieldpoint=3D=3D0".<br>> 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. 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.</font></tt>= <br><br><tt><font size=3D"2">--dave</font></tt><br><br><br><tt><font size= =3D"2"><br>> <br>> With no Adaptive Optimization System enabled, the = yieldpoint will be<br>> invoked every time. However, this is not a big d= eal, since it<br>> virtually does nothing when the Adaptive System is di= sabled.<br>> <br>> I am asking this question to understand things jus= t a little bit deeper.<br>> So, it should be:<br>> asm.emitCMP=5FRegD= isp=5FImm(THREAD=5FREGISTER,<br>> Entrypoints.takeYieldpointField.getOff= set(), 1);<br>> <br>> <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==--