[Vm-dev] Re: About Freetype plugin and BYTES_PER_WORD
siguctua at gmail.com
Tue Sep 6 08:00:07 UTC 2011
On 6 September 2011 07:18, David T. Lewis <lewis at mail.msen.com> wrote:
> On Thu, Sep 01, 2011 at 10:32:54AM -0400, David T. Lewis wrote:
>> On Thu, Sep 01, 2011 at 04:00:41PM +0200, Igor Stasenko wrote:
>> > I think using
>> > ^self
>> > cCode: 'BYTES_PER_WORD'
>> > inSmalltalk: [self subclassResponsibility "InterpreterSimulator"]
>> > instead of
>> > ^BytesPerWord
>> > is a mistake.
>> It's not a mistake. See the trunk VMMaker, this is part of the
>> fundamental mechanism by which common sources can be generated for
>> 32/64 bit target platforms.
>> > Because i just look at uses of BytesPerWord pool var in sources,
>> > and there are 482 references to it.
>> > And in generated code it produces just 'BytesPerWord' for it, but not
>> > 'BYTES_PER_WORD'
>> The oscog branch does not contain the support for generating common
>> sources for 32/64 bit platforms. Possibly some minimal support
>> could be added to cover the BytesPerWord issue.
> Oops, I meant to say "32/64 bit object memory", not "32/64 bit platform".
>> I am away until Monday and I can't offer any better suggestion
>> right now, but I'll look at it when I return.
> I believe that the attached changes will do the right thing when
> loaded into oscog.
> Explanation: In VMMaker trunk, bytesPerWord and baseHeaderSize
> are handled in the C translation dictionary, which translates
> them to BYTES_PER_WORD and BASE_HEADER_SIZE. In oscog, these
> translations can be changed to generate BytesPerWord and
> BaseHeaderSize, which produces the intended source code for
> oscog in the case of a plugin that uses the "self bytesPerWord"
> Note that the oscog branch could be updated with the changes
> for 32/64 bit object memory common code generation, but this
> is quite a but of work and has no immediate benefit for Cog,
> so I am not inclined to worry about it right now.
> FreetypePlugin should not implement #bytesPerWord. I think
> it's better to handle it in the code generator.
so, as i understood your changes allow one to use
'self bytesPerWord' idiom?
More information about the Vm-dev