[Vm-dev] [Cog] Cannot generate code anymore

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 19 18:31:00 UTC 2012


On Wed, Dec 19, 2012 at 10:27 AM, Eliot Miranda <eliot.miranda at gmail.com>wrote:

> Hi Igor,
>
>
>
>
> On Wed, Dec 19, 2012 at 4:59 AM, Igor Stasenko <siguctua at gmail.com> wrote:
>
>>
>> Hello,
>>
>> i am lost (again) what , where, and how things should be initialized,
>> and in what order
>> in order to generate code for Cog.
>>
>> After Esteban merged VMMaker with latest , i ran into issue with
>> 'isPushNilFunction' == nil.
>>
>> The problem is that it is class instance variable..
>
>
>>
>> Since i made own subclass of
>>
>> StackToRegisterMappingCogit
>>
>> and doing
>>
>> 'myclass initializeWithOptions: ... '
>>
>> it initializes isPushNilFunction variable properly there.
>>
>> Now at early stages of code generation a run into error, because
>> CCodeGenerator walks over superclasses and doing #addClass:
>> for each..
>>
>> it breaks in
>> StackToRegisterMappingCogit class>>declareCVarsIn: aCodeGen
>>
>>                 >>      declareC: 'sqInt (*isPushNilFunction)(struct
>> _BytecodeDescriptor
>> *,sqInt,sqInt,sqInt) = ', (aCodeGen cFunctionNameFor:
>> isPushNilFunction);
>>
>> because, of course isPushNilFunction variable has separate value for
>> this class than in my subclass.
>
>
> OK, I'll make an accessor.
> 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
>
> --
> best,
> Eliot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20121219/7e33c2e2/attachment.htm


More information about the Vm-dev mailing list