[Vm-dev] Problem generating cog v3 related to primitiveVMParameter

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Mar 22 10:07:42 UTC 2015


Hi,
I currently get link failure when compiling squeak.cog.v3 for my own VM
brand.

The unresolved symbols are related to Spur (like numSegments).

It seems that the CCodeGenerator correctly eliminated the tests like
    objectMemory hasSpurMemoryManagerAPI ifTrue: [...]

But failed to eliminate this one:
        (arg = 53
         and: [objectMemory hasSpurMemoryManagerAPI]) ifTrue:
            [result := objectMemory integerObjectOf: objectMemory
numSegments].

which is generated as:
        if ((arg == 53)
         && (0)) {
            result = (((numSegments()) << 1) | 1);
        }

So we should either rewrite primitiveVMParameter test like this:
    objectMemory hasSpurMemoryManagerAPI ifTrue: [arg = 53 ifTrue: [...]]

or patch the generator again with more complex pattern analysis...

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150322/3ed0d972/attachment.htm


More information about the Vm-dev mailing list