<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Jaromir,<br>
<br>
On 8/27/2022 7:12 AM, Jaromir Matas via Cuis-dev wrote:
<blockquote
cite="mid:BYAPR03MB40728C14CE8DB35C6DE28CE3EE749@BYAPR03MB4072.namprd03.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-priority:1;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal">Hi Juan,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> There is one problem left.
#isTerminated will always answer false if #suspend primitive
failed and old primitive 88 fallback method is called. I just
pushed to github update #5458 to address this. Please check it
carefully. Maybe you prefer a different solution, I'll be
happy to review and integrate it.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Oops, I forgot to mention the backward
compatibility consideration but you caught it :) (meaning: to
be able to run new images with older VMs, not only older
images with the new VM). Squeak decided to maintain only its
ability to run older images with the new VM - so no change in
#isTerminated in Squeak; however I agree with you that
"fixing" #isTerminated is worth the effort provided the fix is
pretty easy.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I'm enclosing my original suggestion for
#isTerminated; I think the semantics is very similar to your
version (checking whether the remaining context chain has
anything useful left) except one thing: Your version allows a
process with its suspended context's pc = nil to be considered
not terminated. My understanding was: if a process's suspended
context's pc is nil, it implies the process would be
considered terminated. Is this right or would you define
'being terminated' differently?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Check this example:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ctx _ [] asContextWithSender: [] asContext.</p>
<p class="MsoNormal">p _ Process forContext: ctx priority: 40.</p>
<p class="MsoNormal">ctx pc: nil.</p>
<p class="MsoNormal">p isTerminated. "answers false in your
version and true in mine"</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I already noticed a while ago my previous
version of #isTerminated failed to catch pc = nil in a
process's suspended context and evaluate the process as
'terminated'. I wonder now what definition of 'terminated'
state is actually 'the right one'.</p>
</div>
</blockquote>
<br>
I had assumed there would always be sender frames. I believe my code
worked correctly unless there were no sender frames of the frame
with pc=nil. In any case, your version is more robust and nicer
code. I just integrated it. Thanks!<br>
<br>
<blockquote
cite="mid:BYAPR03MB40728C14CE8DB35C6DE28CE3EE749@BYAPR03MB4072.namprd03.prod.outlook.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">Another question: in the example above -
how do you look at the bytecodes of ctx? In Squeak the
Explorer shows the bytecodes right away but in Cuis I have to
open an extra inspector for 'method' and look at
'allBytecodes', right?
</p>
</div>
</blockquote>
<br>
Yes. You are right. The explorer could be improved, to behave like
Squeak's in this case. If you happen to have a couple of hours to
hack this, it would be useful.<br>
<br>
<blockquote
cite="mid:BYAPR03MB40728C14CE8DB35C6DE28CE3EE749@BYAPR03MB4072.namprd03.prod.outlook.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">In Squeak the process p answers true to
#isTerminated even without nilling its pc, which is expected
because each of the two contexts consists only of a single
instruction, a return. But in Cuis I'm not sure how come the
answer is false; I suspect I've got confused by the different
implementation of Context / ContextPart in Squeak/Cuis.
Here's what I mean:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ctx _ [] asContextWithSender: [] asContext.</p>
<p class="MsoNormal">p _ Process forContext: ctx priority: 40.</p>
<p class="MsoNormal">p isTerminated. "answers false in Cuis and
true in Squeak because ctx atEnd differs"</p>
</div>
</blockquote>
<br>
Just tried the example above, and it answers false in Squeak 6.0
alpha 21576 on my Intel Mac. Maybe this has changed recently?
Perhaps it needs fixing in both environments.<br>
<br>
<blockquote
cite="mid:BYAPR03MB40728C14CE8DB35C6DE28CE3EE749@BYAPR03MB4072.namprd03.prod.outlook.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">... while this works the same in both:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ctx _ [1] asContextWithSender: []
asContext.</p>
<p class="MsoNormal">p _ Process forContext: ctx priority: 40.</p>
<p class="MsoNormal">p isTerminated. "answers false in both
Cuis and Squeak because ctx is not atEnd"</p>
</div>
</blockquote>
<br>
Yes it does.<br>
<br>
<blockquote
cite="mid:BYAPR03MB40728C14CE8DB35C6DE28CE3EE749@BYAPR03MB4072.namprd03.prod.outlook.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">Thank you for your advice.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,</p>
<p class="MsoNormal">Jaromir</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNoSpacing"><span lang="CS">--</span></p>
<p class="MsoNoSpacing"><strong><span style="font-family:
"Calibri Light",sans-serif; color: rgb(51, 51,
51); font-weight: normal;">Jaromír Matas</span></strong><span
style="font-family: "Calibri Light",sans-serif;
color: rgb(85, 85, 85);"><o:p></o:p></span></p>
<p class="MsoNoSpacing"><span style="font-family: "Calibri
Light",sans-serif; color: rgb(46, 117, 182);"><a class="moz-txt-link-abbreviated" href="mailto:mail@jaromir.net">mail@jaromir.net</a></span></p>
<p class="MsoNormal"><o:p> </o:p><br>
</p>
</div>
</blockquote>
<br>
Thanks,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>