<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Marcel,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 10:02 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div id="gmail-m_4407136614948481063__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">Hi, all!<div></div><div><br></div><div>Are a method's bytecodes virtually read-only? There is no ModificationForbidden at the moment ...</div></div></blockquote><div><br></div><div>Modification is allowed, and in a StackInterpeeter, will be obeyed immediately,, BUT one cannot simply modify bytecodes and expect things to change.  Because of the JIT one also has to flush any and all ached VM state, in particular generated code, via CompiledCode>>voidCogVMState.  We made heavy use of this facility at Cadence where we modified bytecodes to install line-specific break-points (don't ask ;-) ).  I'm cc'ing Bob to see if you, Bob, can remember where the tests are.  I've looked in MethodMassage and there is only a simply test.  But IIRC we had a full breakpoint test at one stage.</div><br>Now, if there is a different suggestion, that we make methods read-only, I would support that.  Then we could formalize the use of CompiledCode>>voidCogVMState, something like if one attempted to modify a method, there would be an exception that one could proceed through and somehow voidCogVMState would be invoked before resetting the method back to being read-only.<br><br><br>Note that in ViualWorks methods are also not read-only (or weren't in 2007 when we did the immutability work).  I think methods *should* be read-only, but in the Squeak context that means making them writable while their source pointers are updated, etc.</div><div class="gmail_quote"><br>> Best,<br>> Marcel</div><div><br></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div>