mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Add more docs for bytecode load/save feature.
This commit is contained in:
parent
bcc196eed3
commit
ecab831ebf
@ -166,6 +166,23 @@ positive infinity results in <tt>"inf"</tt> and negative infinity results
|
|||||||
in <tt>"-inf"</tt>.
|
in <tt>"-inf"</tt>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h3 id="string_dump"><tt>string.dump(f [,strip])</tt> generates portable bytecode</h3>
|
||||||
|
<p>
|
||||||
|
An extra argument has been added to <tt>string.dump()</tt>. If set to
|
||||||
|
<tt>true</tt>, 'stripped' bytecode without debug information is
|
||||||
|
generated. This speeds up later bytecode loading and reduces memory
|
||||||
|
usage. See also the
|
||||||
|
<a href="running.html#opt_b"><tt>-b</tt> command line option</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The generated bytecode is portable and can be loaded on any architecture
|
||||||
|
that LuaJIT supports, independent of word size or endianess. However the
|
||||||
|
bytecode compatibility versions must match. Bytecode stays compatible
|
||||||
|
for dot releases (x.y.0 → x.y.1), but may change with major or
|
||||||
|
minor releases (2.0 → 2.1) or between any beta release. Foreign
|
||||||
|
bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3>
|
<h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3>
|
||||||
<p>
|
<p>
|
||||||
LuaJIT uses a Tausworthe PRNG with period 2^223 to implement
|
LuaJIT uses a Tausworthe PRNG with period 2^223 to implement
|
||||||
|
@ -133,6 +133,13 @@ luajit -bl test.lua # List to stdout
|
|||||||
luajit -bl test.lua test.txt # List to test.txt
|
luajit -bl test.lua test.txt # List to test.txt
|
||||||
luajit -ble "print('hello world') end" # List cmdline script
|
luajit -ble "print('hello world') end" # List cmdline script
|
||||||
</pre>
|
</pre>
|
||||||
|
<p>
|
||||||
|
Note: A file in bytecode format is auto-detected and can be loaded like
|
||||||
|
any Lua source file. E.g. directly from the command line or with
|
||||||
|
<tt>loadfile()</tt>, <tt>dofile()</tt> etc. See also
|
||||||
|
<a href="extensions.html#string_dump">string.dump()</a> for information
|
||||||
|
on bytecode portability and compatibility.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3 id="opt_j"><tt>-j cmd[=arg[,arg...]]</tt></h3>
|
<h3 id="opt_j"><tt>-j cmd[=arg[,arg...]]</tt></h3>
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user