[Vm-dev] [VM-dev] Does doesNotUnderstand:/cannotInterprer: jitted?

Clément Bera bera.clement at gmail.com
Mon Nov 21 15:03:03 UTC 2016


Hi again,

I was looking at all the VM call-backs, and it's interesting to see how
they're handled in the VM.

The following call-backs are called only from C code or interpreter code,
hence they're not really optimised: #cannotReturn:. #cannotInterpret:,
#aboutToReturn:through:, #run:with:in:, #unusedBytecode.

The following call-backs are called from machine code through a trampoline
switching to C code, i.e., machine code detects if the trampoline will be
called, going at full performance if it's not called, and slower if the
trampoline is called: #mustBeBoolean, #attemptToAssign:withIndex:,
#conditionalBranchCounterTrippedOn:, #trapTripped.

#doesNotUnderstand: is optimised by the JIT as a PIC case, so it's the most
optimised call-back and likely the most frequent.

I am not sure about #invokeCallbackContext: . Is it a FFI thing ? I
believed it's also called only from C code.


On Mon, Nov 21, 2016 at 10:29 AM, Denis Kudriashov <dionisiydk at gmail.com>
wrote:

>
>
> 2016-11-21 10:21 GMT+01:00 Clément Bera <bera.clement at gmail.com>:
>
>>
>>> 2016-11-21 10:05 GMT+01:00 Clément Bera <bera.clement at gmail.com>:
>>>
>>>> Hi.
>>>>
>>>> #doesNotUnderstand: is added to the PIC. It's a special case handled
>>>> for performance. DNUs are slower than normal sends but the overhead is
>>>> acceptable.
>>>
>>>
>>> But when it is in PIC it is not anymore slower?
>>>
>>
>> Well the DNU requires to create the message argument so it's always
>> slower than normal call.
>>
>
> Ah, yes and it means that DNU always generates garbage.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20161121/efc15974/attachment.html>


More information about the Vm-dev mailing list