<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 19, 2012 at 10:27 AM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></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">
Hi Igor,<div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Dec 19, 2012 at 4:59 AM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>></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>
'isPushNilFunction' == 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>
'myclass initializeWithOptions: ... '<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>>declareCVarsIn: aCodeGen<br>
<br>
>> declareC: 'sqInt (*isPushNilFunction)(struct _BytecodeDescriptor<br>
*,sqInt,sqInt,sqInt) = ', (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>OK, I'll make an accessor. <br>Ah, the accessors already exist. All that needs to happen is to send the accessors instead of access the inst vars in StackToRegisterMappingCogit class>>declareCVarsIn: aCodeGen<br>
<br>--<br>best,<br>Eliot</div></div></div></div></blockquote></div>
</div></div>