lua-users home
lua-l archive

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


Fabien <fleutot+lua <at> gmail.com> writes:

> 
> 
> Google progresses with NaCl, its system to safely run native code in the
> browser. Not only can it run the Lua interpreter, but they already did the
> porting:
> 
> http://blog.chromium.org/2010/05/sneak-peek-at-native-client-sdk.htmlNow I
> don't know whether their code checker will accept something as
> black-magic-loaded as LuaJIT, and it wouldn't run on ARM-based phones/tablets
> anyway, but I'd be interested to see progresses on this front...
> 
> -- Fabien.
> 

I don't think something like a JIT would be possible in NaCl. At least in their
original paper one of the major security requirements is that the assembler code
is static and can be analyzed before loading the program. So that pretty much
makes a JIT impossible.

Besides the assembly beeing static they also have quite heavy restrictions on
the allowed instructions, to be able to properly analyze them. For example you
can't use "normal" call/return instructions, you have to follow a certain
pattern. So I'd guess even if they added an API to dynamically load code any JIT
would need to specifically target NaCl to respect the instruction set
restrictions.

[Note that this assumes the state of their original paper, I don't know how much
they advanced the underlying technology by now]