diff options
author | Mike Pall <mike> | 2011-06-14 01:58:19 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-06-14 01:58:19 +0200 |
commit | ecab831ebfca1b08e93bf8dd3c1a7e3b43cf5c97 (patch) | |
tree | 35f7b3208d1a892fd5169c7b67e60472c496eef6 | |
parent | bcc196eed385f6935dedc45a08f7deac2cb062a5 (diff) | |
download | luajit-ecab831ebfca1b08e93bf8dd3c1a7e3b43cf5c97.tar.gz luajit-ecab831ebfca1b08e93bf8dd3c1a7e3b43cf5c97.tar.bz2 luajit-ecab831ebfca1b08e93bf8dd3c1a7e3b43cf5c97.zip |
Add more docs for bytecode load/save feature.
-rw-r--r-- | doc/extensions.html | 17 | ||||
-rw-r--r-- | doc/running.html | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/doc/extensions.html b/doc/extensions.html index 7d12299c..b0e11644 100644 --- a/doc/extensions.html +++ b/doc/extensions.html | |||
@@ -166,6 +166,23 @@ positive infinity results in <tt>"inf"</tt> and negative infinity results | |||
166 | in <tt>"-inf"</tt>. | 166 | in <tt>"-inf"</tt>. |
167 | </p> | 167 | </p> |
168 | 168 | ||
169 | <h3 id="string_dump"><tt>string.dump(f [,strip])</tt> generates portable bytecode</h3> | ||
170 | <p> | ||
171 | An extra argument has been added to <tt>string.dump()</tt>. If set to | ||
172 | <tt>true</tt>, 'stripped' bytecode without debug information is | ||
173 | generated. This speeds up later bytecode loading and reduces memory | ||
174 | usage. See also the | ||
175 | <a href="running.html#opt_b"><tt>-b</tt> command line option</a>. | ||
176 | </p> | ||
177 | <p> | ||
178 | The generated bytecode is portable and can be loaded on any architecture | ||
179 | that LuaJIT supports, independent of word size or endianess. However the | ||
180 | bytecode compatibility versions must match. Bytecode stays compatible | ||
181 | for dot releases (x.y.0 → x.y.1), but may change with major or | ||
182 | minor releases (2.0 → 2.1) or between any beta release. Foreign | ||
183 | bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded. | ||
184 | </p> | ||
185 | |||
169 | <h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3> | 186 | <h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3> |
170 | <p> | 187 | <p> |
171 | LuaJIT uses a Tausworthe PRNG with period 2^223 to implement | 188 | LuaJIT uses a Tausworthe PRNG with period 2^223 to implement |
diff --git a/doc/running.html b/doc/running.html index ecf6bba4..118dab7b 100644 --- a/doc/running.html +++ b/doc/running.html | |||
@@ -133,6 +133,13 @@ luajit -bl test.lua # List to stdout | |||
133 | luajit -bl test.lua test.txt # List to test.txt | 133 | luajit -bl test.lua test.txt # List to test.txt |
134 | luajit -ble "print('hello world') end" # List cmdline script | 134 | luajit -ble "print('hello world') end" # List cmdline script |
135 | </pre> | 135 | </pre> |
136 | <p> | ||
137 | Note: A file in bytecode format is auto-detected and can be loaded like | ||
138 | any Lua source file. E.g. directly from the command line or with | ||
139 | <tt>loadfile()</tt>, <tt>dofile()</tt> etc. See also | ||
140 | <a href="extensions.html#string_dump">string.dump()</a> for information | ||
141 | on bytecode portability and compatibility. | ||
142 | </p> | ||
136 | 143 | ||
137 | <h3 id="opt_j"><tt>-j cmd[=arg[,arg...]]</tt></h3> | 144 | <h3 id="opt_j"><tt>-j cmd[=arg[,arg...]]</tt></h3> |
138 | <p> | 145 | <p> |