aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2021-01-02 21:17:01 +0100
committerMike Pall <mike>2021-01-02 21:17:01 +0100
commitee855749a188d3d13bba9a0e58f430e138e641ae (patch)
tree429ef17b62a88682f920d95a6dec28cd4f7f7789
parent56c04accf975bff2519c34721dccbbdb7b8e6963 (diff)
downloadluajit-ee855749a188d3d13bba9a0e58f430e138e641ae.tar.gz
luajit-ee855749a188d3d13bba9a0e58f430e138e641ae.tar.bz2
luajit-ee855749a188d3d13bba9a0e58f430e138e641ae.zip
Documentation cleanup.
-rw-r--r--doc/faq.html61
-rw-r--r--doc/install.html33
-rw-r--r--doc/luajit.html2
-rw-r--r--doc/status.html15
4 files changed, 49 insertions, 62 deletions
diff --git a/doc/faq.html b/doc/faq.html
index a7144670..843480fc 100644
--- a/doc/faq.html
+++ b/doc/faq.html
@@ -78,16 +78,14 @@ has information about diverse topics.</li>
78<dl id="tech"> 78<dl id="tech">
79<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt> 79<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>
80<dd> 80<dd>
81I'm planning to write more documentation about the internals of LuaJIT. 81Please use the following Google Scholar searches to find relevant papers:<br>
82In the meantime, please use the following Google Scholar searches
83to find relevant papers:<br>
84Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br> 82Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br>
85Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br> 83Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br>
86Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br> 84Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br>
87Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br> 85Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br>
88Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br> 86Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br>
89Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br> 87Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br>
90And, you know, reading the source is of course the only way to enlightenment. :-) 88And, you know, reading the source is of course the only way to enlightenment.
91</dd> 89</dd>
92</dl> 90</dl>
93 91
@@ -126,12 +124,11 @@ Please check the Delphi docs for the Set8087CW method.
126<dl id="ctrlc"> 124<dl id="ctrlc">
127<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt> 125<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>
128<dd>The interrupt signal handler sets a Lua debug hook. But this is 126<dd>The interrupt signal handler sets a Lua debug hook. But this is
129currently ignored by compiled code (this will eventually be fixed). If 127ignored by compiled code. If your program is running in a tight loop
130your program is running in a tight loop and never falls back to the 128and never falls back to the interpreter, the debug hook never runs and
131interpreter, the debug hook never runs and can't throw the 129can't throw the "interrupted!" error.<br>
132"interrupted!" error.<br> In the meantime you have to press Ctrl-C 130You have to press Ctrl-C twice to get stop your program. That's similar
133twice to get stop your program. That's similar to when it's stuck 131to when it's stuck running inside a C function under the Lua interpreter.</dd>
134running inside a C function under the Lua interpreter.</dd>
135</dl> 132</dl>
136 133
137<dl id="sandbox"> 134<dl id="sandbox">
@@ -145,28 +142,18 @@ it's very hard to get this right even for the Lua core libraries. Of course,
145you'll need to inspect any extension library, too. And there are libraries 142you'll need to inspect any extension library, too. And there are libraries
146that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br> 143that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br>
147 144
148Relatedly, <b>loading untrusted bytecode is not safe!</b> It's trivial 145More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">&raquo;</span>&nbsp;Wikipedia</a>.<br><br>
149to crash the Lua or LuaJIT VM with maliciously crafted bytecode. This is
150well known and there's no bytecode verification on purpose, so please
151don't report a bug about it. Check the <tt>mode</tt> parameter for the
152<tt>load*()</tt> functions to disable loading of bytecode.<br>
153 146
154In general, the only promising approach is to sandbox Lua code at the 147Relatedly, <b>loading untrusted bytecode is not safe!</b><br>
155process level and not the VM level.<br>
156 148
157More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">&raquo;</span>&nbsp;Wikipedia</a>. 149It's trivial to crash the Lua or LuaJIT VM with maliciously crafted bytecode.
158</dd> 150This is well known and there's no bytecode verification on purpose, so please
159</dl> 151don't report a bug about it. Check the <tt>mode</tt> parameter for the
152<tt>load*()</tt> functions to disable loading of bytecode.<br><br>
160 153
161<dl id="patches"> 154<b>In general, the only promising approach is to sandbox Lua code at the
162<dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt> 155process level and not the VM level.</b>
163<dd>Because it's a completely redesigned VM and has very little code 156</dd>
164in common with Lua anymore. Also, if the patch introduces changes to
165the Lua semantics, these would need to be reflected everywhere in the
166VM, from the interpreter up to all stages of the compiler.<br> Please
167use only standard Lua language constructs. For many common needs you
168can use source transformations or use wrapper or proxy functions.
169The compiler will happily optimize away such indirections.</dd>
170</dl> 157</dl>
171 158
172<dl id="arch"> 159<dl id="arch">
@@ -176,17 +163,11 @@ machine code. This means the code generator must be ported to each
176architecture. And the fast interpreter is written in assembler and 163architecture. And the fast interpreter is written in assembler and
177must be ported, too. This is quite an undertaking.<br> 164must be ported, too. This is quite an undertaking.<br>
178The <a href="install.html">install documentation</a> shows the supported 165The <a href="install.html">install documentation</a> shows the supported
179architectures. Other architectures will follow based on sufficient user 166architectures.<br>
180demand and/or sponsoring.</dd> 167Other architectures may follow based on sufficient user demand and
181</dl> 168market-relevance of the architecture. Sponsoring is required to develop
182 169the port itself, to integrate it and to continuously maintain it in the
183<dl id="when"> 170actively developed branches.</dd>
184<dt>Q: When will feature X be added? When will the next version be released?</dt>
185<dd>When it's ready.<br>
186C'mon, it's open source &mdash; I'm doing it on my own time and you're
187getting it for free. You can either contribute a patch or sponsor
188the development of certain features, if they are important to you.
189</dd>
190</dl> 171</dl>
191<br class="flush"> 172<br class="flush">
192</div> 173</div>
diff --git a/doc/install.html b/doc/install.html
index 85ca9913..6110450c 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -101,8 +101,8 @@ operating systems, CPUs and compilers:
101<td class="compatcpu">CPU / OS</td> 101<td class="compatcpu">CPU / OS</td>
102<td class="compatos"><a href="#posix">Linux</a> or<br><a href="#android">Android</a></td> 102<td class="compatos"><a href="#posix">Linux</a> or<br><a href="#android">Android</a></td>
103<td class="compatos"><a href="#posix">*BSD, Other</a></td> 103<td class="compatos"><a href="#posix">*BSD, Other</a></td>
104<td class="compatos"><a href="#posix">OSX 10.4+</a> or<br><a href="#ios">iOS 3.0+</a></td> 104<td class="compatos"><a href="#posix">macOS 10.4+</a> or<br><a href="#ios">iOS 3.0+</a></td>
105<td class="compatos"><a href="#windows">Windows<br>XP/Vista/7</a></td> 105<td class="compatos"><a href="#windows">Windows XP<br>or later</a></td>
106</tr> 106</tr>
107<tr class="odd separate"> 107<tr class="odd separate">
108<td class="compatcpu">x86 (32 bit)</td> 108<td class="compatcpu">x86 (32 bit)</td>
@@ -168,7 +168,7 @@ Please read the instructions given in these files, before changing
168any settings. 168any settings.
169</p> 169</p>
170 170
171<h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2> 171<h2 id="posix">POSIX Systems (Linux, macOS, *BSD etc.)</h2>
172<h3>Prerequisites</h3> 172<h3>Prerequisites</h3>
173<p> 173<p>
174Depending on your distribution, you may need to install a package for 174Depending on your distribution, you may need to install a package for
@@ -176,8 +176,9 @@ GCC, the development headers and/or a complete SDK. E.g. on a current
176Debian/Ubuntu, install <tt>libc6-dev</tt> with the package manager. 176Debian/Ubuntu, install <tt>libc6-dev</tt> with the package manager.
177</p> 177</p>
178<p> 178<p>
179Download the current source package of LuaJIT (pick the .tar.gz), 179The recommended way to fetch the latest version is to do a pull from
180if you haven't already done so. Move it to a directory of your choice, 180the git repository. Alternatively download the latest source package of
181LuaJIT (pick the .tar.gz). Move it to a directory of your choice,
181open a terminal window and change to this directory. Now unpack the archive 182open a terminal window and change to this directory. Now unpack the archive
182and change to the newly created directory: 183and change to the newly created directory:
183</p> 184</p>
@@ -207,7 +208,7 @@ You can add an extra prefix to the search paths by appending the
207make PREFIX=/home/myself/lj2 208make PREFIX=/home/myself/lj2
208</pre> 209</pre>
209<p> 210<p>
210Note for OSX: you must set the <tt>MACOSX_DEPLOYMENT_TARGET</tt> 211Note for macOS: you must set the <tt>MACOSX_DEPLOYMENT_TARGET</tt>
211environment variable to a value supported by your toolchain. 212environment variable to a value supported by your toolchain.
212</p> 213</p>
213<h3>Installing LuaJIT</h3> 214<h3>Installing LuaJIT</h3>
@@ -241,8 +242,9 @@ GCC plus the required development headers.
241Or install Microsoft's Visual Studio (MSVC). 242Or install Microsoft's Visual Studio (MSVC).
242</p> 243</p>
243<p> 244<p>
244Next, download the source package and unpack it using an archive manager 245Next, pull from the git repository or download the source package and
245(e.g. the Windows Explorer) to a directory of your choice. 246unpack it using an archive manager (e.g. the Windows Explorer) to
247a directory of your choice.
246</p> 248</p>
247<h3>Building with MSVC</h3> 249<h3>Building with MSVC</h3>
248<p> 250<p>
@@ -260,8 +262,8 @@ Then follow the installation instructions below.
260<h3>Building with MinGW or Cygwin</h3> 262<h3>Building with MinGW or Cygwin</h3>
261<p> 263<p>
262Open a command prompt window and make sure the MinGW or Cygwin programs 264Open a command prompt window and make sure the MinGW or Cygwin programs
263are in your path. Then <tt>cd</tt> to the directory where 265are in your path. Then <tt>cd</tt> to the directory of the git repository
264you've unpacked the sources and run this command for MinGW: 266or where you've unpacked the sources. Then run this command for MinGW:
265</p> 267</p>
266<pre class="code"> 268<pre class="code">
267mingw32-make 269mingw32-make
@@ -302,7 +304,7 @@ x64 OS, you need to install the multilib development package (e.g.
302<p> 304<p>
303You need to specify <tt>TARGET_SYS</tt> whenever the host OS and the 305You need to specify <tt>TARGET_SYS</tt> whenever the host OS and the
304target OS differ, or you'll get assembler or linker errors. E.g. if 306target OS differ, or you'll get assembler or linker errors. E.g. if
305you're compiling on a Windows or OSX host for embedded Linux or Android, 307you're compiling on a Windows or macOS host for embedded Linux or Android,
306you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a 308you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a
307minimal target OS, you may need to disable the built-in allocator in 309minimal target OS, you may need to disable the built-in allocator in
308<tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. Don't forget to 310<tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. Don't forget to
@@ -461,15 +463,14 @@ intend to load Lua/C modules at runtime.
461</li></ul> 463</li></ul>
462</li> 464</li>
463<li> 465<li>
464If you're building a 64 bit application on OSX which links directly or 466<i>Important: this relates to LuaJIT 2.0 only &mdash; use LuaJIT 2.1 to
467avoid these complications.</i><br>
468If you're building a 64 bit application on macOS which links directly or
465indirectly against LuaJIT, you need to link your main executable 469indirectly against LuaJIT, you need to link your main executable
466with these flags: 470with these flags:
467<pre class="code"> 471<pre class="code">
468-pagezero_size 10000 -image_base 100000000 472-pagezero_size 10000 -image_base 100000000
469</pre> 473</pre>
470Also, it's recommended to <tt>rebase</tt> all (self-compiled) shared libraries
471which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua).
472See: <tt>man rebase</tt>
473</li> 474</li>
474</ul> 475</ul>
475<p>Additional hints for initializing LuaJIT using the C API functions:</p> 476<p>Additional hints for initializing LuaJIT using the C API functions:</p>
@@ -479,7 +480,7 @@ See: <tt>man rebase</tt>
479for embedding Lua or LuaJIT into your application.</li> 480for embedding Lua or LuaJIT into your application.</li>
480<li>Make sure you use <tt>luaL_newstate</tt>. Avoid using 481<li>Make sure you use <tt>luaL_newstate</tt>. Avoid using
481<tt>lua_newstate</tt>, since this uses the (slower) default memory 482<tt>lua_newstate</tt>, since this uses the (slower) default memory
482allocator from your system (no support for this on x64).</li> 483allocator from your system (no support for this on 64&nbsp;bit architectures).</li>
483<li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style 484<li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style
484of calling <tt>luaopen_base</tt> etc. directly.</li> 485of calling <tt>luaopen_base</tt> etc. directly.</li>
485<li>To change or extend the list of standard libraries to load, copy 486<li>To change or extend the list of standard libraries to load, copy
diff --git a/doc/luajit.html b/doc/luajit.html
index f99aa022..d5b1c1e6 100644
--- a/doc/luajit.html
+++ b/doc/luajit.html
@@ -152,7 +152,7 @@ LuaJIT is Copyright &copy; 2005-2020 Mike Pall, released under the
152 152
153<h2>Compatibility</h2> 153<h2>Compatibility</h2>
154<table class="feature os os1"> 154<table class="feature os os1">
155<tr><td>Windows</td><td>Linux</td><td>BSD</td><td>OSX</td><td>POSIX</td></tr> 155<tr><td>Windows</td><td>Linux</td><td>BSD</td><td>macOS</td><td>POSIX</td></tr>
156</table> 156</table>
157<table class="feature os os2"> 157<table class="feature os os2">
158<tr><td><span style="font-size:90%;">Embedded</span></td><td>Android</td><td>iOS</td></tr> 158<tr><td><span style="font-size:90%;">Embedded</span></td><td>Android</td><td>iOS</td></tr>
diff --git a/doc/status.html b/doc/status.html
index 0d357613..d28d7eb5 100644
--- a/doc/status.html
+++ b/doc/status.html
@@ -56,9 +56,15 @@ ul li { padding-bottom: 0.3em; }
56</div> 56</div>
57<div id="main"> 57<div id="main">
58<p> 58<p>
59<span style="color: #0000c0;">LuaJIT&nbsp;2.0</span> is the current 59This documentation is for LuaJIT 2.0.5. Please check the <tt>doc</tt>
60<span style="color: #0000c0;">stable branch</span>. This branch is in 60directory in each git branch for the version-specific documentation.
61feature-freeze &mdash; new features will only be added to LuaJIT&nbsp;2.1. 61</p>
62<p>
63The currently developed branches are LuaJIT&nbsp;2.1 and LuaJIT&nbsp;2.0.
64</p>
65<p>
66LuaJIT&nbsp;2.0 is in feature-freeze &mdash; new features will only
67be added to LuaJIT&nbsp;2.1.
62</p> 68</p>
63 69
64<h2>Current Status</h2> 70<h2>Current Status</h2>
@@ -86,8 +92,7 @@ in LuaJIT (no per-coroutine hooks, no tail call counting).
86Currently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not 92Currently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not
87handled correctly. The error may fall through an on-trace 93handled correctly. The error may fall through an on-trace
88<tt>pcall</tt> or it may be passed on to the function set with 94<tt>pcall</tt> or it may be passed on to the function set with
89<tt>lua_atpanic</tt> on x64. This issue will be fixed with the new 95<tt>lua_atpanic</tt> on x64.
90garbage collector.
91</li> 96</li>
92</ul> 97</ul>
93<br class="flush"> 98<br class="flush">