<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 19, 2012 at 10:31 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Dec 19, 2012 at 10:27 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">

Hi Igor,<div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5"><div><div>On Wed, Dec 19, 2012 at 4:59 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hello,<br>
<br>
i am lost (again) what , where, and how things should be initialized,<br>
and in what order<br>
in order to generate code for Cog.<br>
<br>
After Esteban merged VMMaker with latest , i ran into issue with<br>
&#39;isPushNilFunction&#39; == nil.<br>
<br>
The problem is that it is class instance variable..</blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<br>
<br>
Since i made own subclass of<br>
<br>
StackToRegisterMappingCogit<br>
<br>
and doing<br>
<br>
&#39;myclass initializeWithOptions: ... &#39;<br>
<br>
it initializes isPushNilFunction variable properly there.<br>
<br>
Now at early stages of code generation a run into error, because<br>
CCodeGenerator walks over superclasses and doing #addClass:<br>
for each..<br>
<br>
it breaks in<br>
StackToRegisterMappingCogit class&gt;&gt;declareCVarsIn: aCodeGen<br>
<br>
                &gt;&gt;      declareC: &#39;sqInt (*isPushNilFunction)(struct _BytecodeDescriptor<br>
*,sqInt,sqInt,sqInt) = &#39;, (aCodeGen cFunctionNameFor:<br>
isPushNilFunction);<br>
<br>
because, of course isPushNilFunction variable has separate value for<br>
this class than in my subclass.</blockquote><div><br></div></div></div></div></div><div><div><div class="h5">OK, I&#39;ll make an accessor. <br></div></div>Ah, the accessors already exist.  All that needs to happen is to send the accessors instead of access the inst vars in StackToRegisterMappingCogit class&gt;&gt;declareCVarsIn: aCodeGen</div>
</div></div></div></blockquote></div></div></div></blockquote><div><br></div><div>and in StackToRegisterMappingCogit class&gt;&gt;requiredMethiodNames </div></div><div><br></div>-- <br>best,<div>Eliot</div><br>
</div></div>