[Vm-beginners] Calling VM C functions from cogged primitives

Federico Grosso fgrosso85 at gmail.com
Sun Jul 28 21:04:27 UTC 2019


Hi Eliot, I have been working with Leandro on this. We had looked the
implementation of other trampolines and it seems to be working on the
simulator but not on the real VM. Currently the VM is starting, and it
loads the image correctly, but it fails on mouse move with the next error:

Cog JIT internal error. Too many abstract opcodes. Num opcodes heuristic is
too optimistic.

We found that error is only throwed within
StackToRegisterMappingCogit>>#compileAbstractInstructionsFrom:through:

Also, if we run the VM with the asserts we see things like:

opcodeIndex < numAbstractOpcodes 7022
opcodeIndex < numAbstractOpcodes 7041
opcodeIndex < numAbstractOpcodes 7062

Which are related with Cogit>>#gen:operand:operand:operand:

We have tried doing an empty trampoline with only a printf inside and the
printf is being called. The trampoline is:

ceKeepInstanceVariableTypeInformationFor: anAssignedObject in: rcvr at:
instVarIndex
<api>
self cCode: 'printf("hello");'.

Seems like we need to change the way the number of abstract opcodes is
calculated, but we didn't found where to change it. Are we right?
Any idea about it?

Federico

On Tue, Jul 2, 2019 at 1:05 PM lgvidal <lgvidal at gmail.com> wrote:

> Hi Eliot,
>
> Thank you very much for your input. We've been slowly making progress with
> this, currently trying to get a working compiled version of the VM to work
> (been using the simulator so far, apparently not as straightforward as
> running the mvm script).
>
> We will likely pop here again in the future
> Thanks for your help, cheers!
>
>
>
>
> --
> Sent from: http://forum.world.st/Smalltalk-VM-Beginners-f3068605.html
> _______________________________________________
> VM-beginners mailing list
> VM-beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-beginners/attachments/20190728/e96cb1f3/attachment.html>


More information about the VM-beginners mailing list