<br><br><div class="gmail_quote">On Wed, Sep 29, 2010 at 2:25 PM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div>Anyway, I tried it with <br>
<br>| o p |<br>
o := MyClass new.<div><br>o foo: 123.<br>p := ClassProxy new.<br></div>p become: MyClass.<br>MyClass flushCache.<br>
ClassProxy flushCache.<br>o == nil.<br>Transcript show: o class name; cr.<br>o foo.<br><br>but same results.<br><br>Now, something interesting is that &quot;Transcript show: o class name; cr.&quot;   prints &quot;MyClass&quot;. Is this correct?  <br>


<br></div></div></blockquote></div><div><br>Grrrrr no, sorry, that&#39;s not true...can you believe there was a &quot;    Transcript cr; show: self name. &quot;  in the fileout code ? heheheh<br><br>Now I changed the proxy to extends Class (to see if it works) and at least it doesn&#39;t crash.<br>

<br>&quot;Transcript show: o class name; cr. &quot; prints &quot;a subclass of Object&quot;  and after the evaluation of the code, I get the error:<br><br>MessageNotUnderstood: a subclass of Object&gt;&gt;foo<br><br>mmmmm<br>

<br>I will continue investigating.... <br></div></div></blockquote><div><br><br>Something interesting is that after evaluating that code, and recieving the error, MyClass which was:<br><br>Object subclass: #MyClass<br>    instanceVariableNames: &#39;foo&#39;<br>
    classVariableNames: &#39;&#39;<br>    poolDictionaries: &#39;&#39;<br>    category: &#39;Proxies&#39;<br><br>now it is:<br><br>Object subclass: &#39;a subclass of Object&#39;<br>    instanceVariableNames: &#39;&#39;<br>
    classVariableNames: &#39;&#39;<br>    poolDictionaries: &#39;&#39;<br>    category: &#39;nil&#39;<br> <br><br>weird....<br><br>thanks!<br><br>mariano<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote"><div> </div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="gmail_quote"><div>2. you became from a class with N inst vars to one with N+M inst vars and the methods of the new class accessed inst vars &gt; N which are off the end of your instance, causing the VM to read invalid oops and boom.</div>



<div><br></div></div></blockquote><div><br>My case is even more complicated. I want to become from a CLASS to an INSTANCE. I mean, I want to become the class MyClass with AN INSTANCE of  PROXY CLASS. Then the proxy class uses te DNU to bring the other back.<br>


<br>Now I was thinking that maybe the proxy class should not extend from ProtoObject but from Behavior or similar?  But I want smaller objects...I don&#39;t want to spend instances in &quot;uperclass methodDict format&#39;&quot;  since the only thing I have to do is with DNU bring back other object. <br>


<br>Finally, I have a question. I tried to look at the #become but I didn&#39;t get it... When I do a become from a class to an object for example, if there were (normal) pointers (slots in other objects) to that class, then they are updated and point to the other object. However, what happens with the instances of that class?  is the class pointer in their object header consider like a normal pointer? are those piointers updated also by the #become?    Maybe they are not and this is why  &quot;Transcript show: o class name; cr.&quot;   prints &quot;MyClass&quot;   ?<br>


<br>Sorry for the newbie question...I am learning all this...<br><br>Cheers<br><br>Mariano<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div class="gmail_quote"><div></div><div>So a) always flush the method lookup cache and b) /never/ cause the VM to read past an object by changing the class underneath an object such that the class accesses more inst vars than the instance has.</div>

<div>

<div><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>how can I solve it ?<br><br>Thanks in advance<br>
<br>Mariano<br>
<br></blockquote></div></div><br>
<br></blockquote></div><br>
</blockquote></div></div><br>
</blockquote></div><br>