[Vm-dev] Primitives return what?

Clément Bera bera.clement at gmail.com
Mon Apr 9 04:43:19 UTC 2018


Hi,

I think primitives return 0 on success or an error code if they failed.

It could be that for specific common primitive that's not the case as a
hack for performance, one would need to check the code or Eliot may be able
to answer.

On Mon, Apr 9, 2018, 00:52 Stuart Cassoff <aa72 at bell.net> wrote:

>
> Apologies in advance for not doing enough homework.
>
> From what I can understand so far:
> - Primitive function signatures specify returning an sqInt but the
> returned value is never used.
> - Primitives generally don't themselves return values, they often just
> drop off the end of the function.
> - Most (all?) primitive code is generated by VMMaker.
>
> Compiling results in warnings: "non-void function should return a value".
>
> So I'm wondering if  the code generator could add "return 0;" (return 1;
> ?) where needed,
> or could the functions be generated with a void signature instead of sqInt.
>
> That is, iiuc, if the returned values from primitives are ignored.
> If they are, I think that's a bit of a bummer because that's a wasted
> communications channel.
>
>
> Any clarification appreciated,
>
>
> Stu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180409/61861521/attachment.html>


More information about the Vm-dev mailing list