[Vm-dev] [NB] NativeBoost meets JIT
Eliot Miranda
eliot.miranda at gmail.com
Fri Sep 21 17:52:49 UTC 2012
On Fri, Sep 21, 2012 at 8:53 AM, Denis Kudriashov <dionisiydk at gmail.com>wrote:
>
> Hello
>
> 2012/9/21 Igor Stasenko <siguctua at gmail.com>
>
>> nbFoo2
>> <primitive: #primitiveNativeCall module: #NativeBoostPlugin
>> error: errorCode>
>>
>> ^ NBNativeCodeGen methodAssembly: [:gen :proxy :asm |
>> asm noStackFrame.
>> asm
>> mov: (42 << 1) + 1 to: asm EAX;
>> ret.
>> ]
>>
>> And this one uses JIT:
>>
>> nbFoo
>> <primitive: 220 error: errorCode>
>>
>> [ errorCode = ErrRunningViaInterpreter ] whileTrue: [ ^ self
>> nbFoo ].
>>
>> ^ NBNativeCodeGen jitMethodAssembly: [:gen :proxy :asm |
>> asm noStackFrame.
>> asm
>> mov: (42 << 1) + 1 to: asm EDX;
>> ret: 4 asUImm.
>> ]
>>
>
> Why assembly code is different for jitted and non jitted versions?
>
The Cog JIT uses its own register-based calling convention and runs on a
segmented (paged) stack. So one can't run or call C code directly from
Smalltalk. Instead, C code involves switching to the C stack and calling
the C function there-on, a lot like a system call.
What I should change in my nativeboost assembly to be able to jit it?
>
> Any way thank's for such impressive work.
>
> Best regards,
> Denis
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120921/15e520b3/attachment.htm
More information about the Vm-dev
mailing list