Hi Eliot,

Nowadays I'm working on Alien in Pharo 1.1 and I'd like to know how to work in 
Pharo 1.2 running Cog VM, do you have some example using Alien/AlienOpenGL?


Merry Christmas,


Patricio


El 10-11-2010, a las 22:40, Eliot Miranda escribió:

> Hi Ken,
> 
> On Wed, Nov 10, 2010 at 10:20 AM, Ken Treis <[email protected]> wrote:
> What's the status of Alien in the new Cog VM? I was able to load Alien into 
> Pharo 1.1.1 running Cog, and some simple callouts worked (e.g. `CRLibrary 
> libraryVersionString` in CairoGraphics. But every callout with arguments 
> failed in primFFICallResult:.
> 
> Alien works perfectly for me in Pharo 1.1 using JMM's VMs when I load the 
> Pharo 1.1 version from ConfigurationOfAlien, but I admit I haven't tried 
> 1.1.1 in this arrangement.
> 
> Is there something that's changed in Cog's Alien primitive implementation?
> 
> IIRC, the Alien callout code is written assuming stacks grow up (in 
> MethodContext instances) whereas in the Cog Stack and JIT VMs stacks grow 
> down.  So the glue in platforms/Cross/plugins/IA32ABI/dabusiness.h needs 
> rewriting.  Specifically the second loop over the arguments at line 45 needs 
> to mimic the code at line 17.  (I know, insane; why have two different loops 
> in the first place?  counting down towards zero can generate slightly faster 
> code than counting up towards a limit; you need one less register).
> 
> But I'm hoping that the ALien callouts will die the death soon.  I have Alien 
> callbacks integrated with the FFI and of course the ALien data manipulation 
> code works fine.  So if you're eager to have Alien callouts work see whether 
> the above change fixes things, in which case I can integrate the fix.  But if 
> you're not so eager you could wait for me to push out the FFI changes, but 
> that could take a few weeks.
> 
> HTH
> Eliot
> 
> --
> Ken Treis
> Miriam Technologies, Inc.
> 
> 
> 

Reply via email to