[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT - When using FFI, trace aborts due to "symbol not in cache"
- From: Mike Pall <mikelu-1105@...>
- Date: Sun, 1 May 2011 17:09:55 +0200
Benjamin Segovia wrote:
> Also, I just saw that "pairs" seems to abort the trace also but in
> this case, the error message given by the trace dump is pretty clear
> "NYI: FastFunc pairs".
pairs() (or rather next()) is going to be slow, no matter what I do.
Use a linear array and a plain 'for' loop for iterating over the
> "symbol not in cache" remains however a bit obscure :)
C library symbols are resolved and stored in a cache after their
first use. This happens only once, so it's usually the interpreter
which adds the symbol to the cache. The JIT compiler doesn't
handle this case, as it would not be profitable to do so. But the
compiler should kick in much later for the same code path and by
then the symbol ought to be in the cache already.
This error indicates the JIT compiler hit some code the
interpreter hasn't run yet. This is rare and may be a coincidence.
The JIT compiler will retry and compile it on the next recording
attempt for that path (but then it hits the abort for pairs()).