<html>
<head>
<meta content="text/html; charset=iso-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Levente<br>
<br>
I think that the first step is not to make sure that you cannot hack
inside literals like mad. But to make sure that in <br>
99.99 % of the case, this assumption can hold. <br>
<br>
Stef<br>
<br>
<div class="moz-cite-prefix">On 27/10/14 15:46, Levente Uzonyi
wrote:<br>
</div>
<blockquote
cite="mid:alpine.DEB.2.02.1410272140240.14361@login03.caesar.elte.hu"
type="cite">
<pre wrap=""> </pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
On Mon, 27 Oct 2014, Eliot Miranda wrote:
<br>
<br>
<blockquote type="cite">I disagree. It's about an incremental
improvement. A per-object </blockquote>
immutability bit used to protect against direct alteration of
literals works. Right now there's nothing to stop one recompiling
a method, and
<br>
per-object immutability doesn't change that. So mutable compiled
methods are tolerable (at least in VW we kept methods mutable).
But having the bit stop direct modification of literals is
goodness, not to
<br>
be avoided because it doesn't prevent more exotic modification via
become.
<br>
<br>
But if you allow mutable CompiledMethods, then Clement's example
can be rewritten as:
<br>
<br>
MyClass >> #foo
<br>
<br>
^#(false) first
<br>
ifFalse: [
<br>
'first call since compilation' logCr.
<br>
thisContext method in: [ :method |
<br>
(method literalAt: (method literals indexOf:
#(false)) put: { true }) ] ]
<br>
ifTrue: [ 'other calls' logCr ]
<br>
<br>
(#becomeForward: could also be used on the literal).
<br>
<br>
How will you avoid implementing the deoptimization of the method
(the slow path) when this is possible?
<br>
<br>
Levente<br>
</blockquote>
<br>
</body>
</html>