lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Porting GNU Smalltalk to lightning 2


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Porting GNU Smalltalk to lightning 2
Date: Mon, 27 Oct 2014 00:42:27 -0200

2014-10-26 19:17 GMT-02:00 Holger Hans Peter Freyther <address@hidden>:
> On Sun, Oct 26, 2014 at 04:14:15PM -0200, Paulo César Pereira de Andrade 
> wrote:
>
>>   It is awful :(
>
> Yes, specially with R^X.. I see. and I do prefer lightning dealing
> with PROT_EXEC, flushing the cache of the CPU, etc.

  Anyway, I think it is a good idea to provide a call to flush the
cache, when applicable, to match lightning 1

void
jit_flush_code(void *start, void *end);

prototype. In lightning 2, in most backends, it assumes gcc,
and linked to libgcc, and calls "__clear_cache(void*,void*);",
save on a few backends, where the libgcc __clear_cache does
not work.

>>   The easiest approach is to just use an variably sized structure,
>> and use jit_set_data, see "7.2 Alternate code buffer" in
>> http://www.gnu.org/software/lightning/manual/html_node/Customizations.html#Customizations
>> the example there uses mmap, but you may use malloc'ed
>> memory, no problem (and see the comments on how you can
>> even query the likely size of the buffer, and retry unitl it fits...),
>> just that lightning does leave you on your own about cache sync,
>> so, with plain memory from malloc, it likely will only work as is
>> on ix86 or x86_64, and maybe a few others, while some are very
>> "hard" to sync.
>
> right, it is not where I want to go. The invalidation is very
> noticable for interactive workloads (gst-browser compiles a method,
> adds it to the method dictionary and then executes it) so I wonder
> what other options we have. But I think you are right and the hash
> you added is the right way to move forward right now.
>
>
>>   I may work on a new api to ensure the memory is synch'ed
>> tough. I hope to have lightning 2.0.6 released when it can
>> drive GNU Smalltalk :)
>
> I want to give it a try on ARM as well. Hopefully this week.

  I believe it is very likely to "just" work.

  For 64 bit, my patch is a complete hack. Need to write a
proper division code if there isn't an overflow fallback (or an
assertion if it must always exit). Probably just shift right
tag bits, divide, shift left tag bits...

Thanks,
Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]