diff options
Diffstat (limited to 'libraries/LuaJIT-1.1.7/jitdoc/luajit_run.html')
-rw-r--r-- | libraries/LuaJIT-1.1.7/jitdoc/luajit_run.html | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/libraries/LuaJIT-1.1.7/jitdoc/luajit_run.html b/libraries/LuaJIT-1.1.7/jitdoc/luajit_run.html new file mode 100644 index 0000000..bc9105b --- /dev/null +++ b/libraries/LuaJIT-1.1.7/jitdoc/luajit_run.html | |||
@@ -0,0 +1,159 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>Running LuaJIT</title> | ||
5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | ||
6 | <meta name="Author" content="Mike Pall"> | ||
7 | <meta name="Copyright" content="Copyright (C) 2005-2011, Mike Pall"> | ||
8 | <meta name="Language" content="en"> | ||
9 | <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen"> | ||
10 | <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print"> | ||
11 | </head> | ||
12 | <body> | ||
13 | <div id="site"> | ||
14 | <a href="http://luajit.org/"><span>Lua<span id="logo">JIT</span></span></a> | ||
15 | </div> | ||
16 | <div id="head"> | ||
17 | <h1>Running LuaJIT</h1> | ||
18 | </div> | ||
19 | <div id="nav"> | ||
20 | <ul><li> | ||
21 | <a href="index.html">Index</a> | ||
22 | </li><li> | ||
23 | <a href="luajit.html">LuaJIT</a> | ||
24 | <ul><li> | ||
25 | <a href="luajit_features.html">Features</a> | ||
26 | </li><li> | ||
27 | <a href="luajit_install.html">Installation</a> | ||
28 | </li><li> | ||
29 | <a class="current" href="luajit_run.html">Running</a> | ||
30 | </li><li> | ||
31 | <a href="luajit_api.html">API Extensions</a> | ||
32 | </li><li> | ||
33 | <a href="luajit_intro.html">Introduction</a> | ||
34 | </li><li> | ||
35 | <a href="luajit_performance.html">Performance</a> | ||
36 | </li><li> | ||
37 | <a href="luajit_debug.html">Debugging</a> | ||
38 | </li><li> | ||
39 | <a href="luajit_changes.html">Changes</a> | ||
40 | </li></ul> | ||
41 | </li><li> | ||
42 | <a href="coco.html">Coco</a> | ||
43 | <ul><li> | ||
44 | <a href="coco_portability.html">Portability</a> | ||
45 | </li><li> | ||
46 | <a href="coco_api.html">API Extensions</a> | ||
47 | </li><li> | ||
48 | <a href="coco_changes.html">Changes</a> | ||
49 | </li></ul> | ||
50 | </li><li> | ||
51 | <a href="dynasm.html">DynASM</a> | ||
52 | <ul><li> | ||
53 | <a href="dynasm_features.html">Features</a> | ||
54 | </li><li> | ||
55 | <a href="dynasm_examples.html">Examples</a> | ||
56 | </li></ul> | ||
57 | </li><li> | ||
58 | <a href="http://luajit.org/download.html">Download <span class="ext">»</span></a> | ||
59 | </li></ul> | ||
60 | </div> | ||
61 | <div id="main"> | ||
62 | <p> | ||
63 | LuaJIT has only a single stand-alone executable, called <tt>luajit</tt>. | ||
64 | It can be used to run simple Lua statements or whole Lua applications | ||
65 | from the command line. It has an interactive mode, too. | ||
66 | </p> | ||
67 | <p> | ||
68 | <em>Note: The optimizer is not activated by default because it resides | ||
69 | in an external module | ||
70 | (see <a href="luajit_install.html">Installing LuaJIT</a>). | ||
71 | It's recommended to always use the optimizer, i.e.:</em> <tt>luajit -O</tt> | ||
72 | </p> | ||
73 | |||
74 | <h2 id="options">Command Line Options</h2> | ||
75 | <p> | ||
76 | The <tt>luajit</tt> stand-alone executable is just a slightly modified | ||
77 | version of the regular <tt>lua</tt> stand-alone executable. | ||
78 | It supports the same basic options, too. Please have a look at the | ||
79 | <a href="../doc/lua.html">Manual Page</a> | ||
80 | for the regular <tt>lua</tt> stand-alone executable. | ||
81 | </p> | ||
82 | <p> | ||
83 | Two additional options control LuaJIT behaviour: | ||
84 | </p> | ||
85 | |||
86 | <h3 id="opt_j"><tt>-j cmd[=value]</tt></h3> | ||
87 | <p> | ||
88 | This option performs a LuaJIT control command. LuaJIT has a small | ||
89 | but extensible set of control commands. It's easy to add your own. | ||
90 | </p> | ||
91 | <p> | ||
92 | The command is first searched for in the <tt>jit.*</tt> library. | ||
93 | If no matching function is found, a module named <tt>jit.<cmd></tt> | ||
94 | is loaded. The module table must provide a <tt>start()</tt> function. | ||
95 | </p> | ||
96 | <p> | ||
97 | For the <tt>-j cmd</tt> form the function is called without an argument. | ||
98 | Otherwise the <tt>value</tt> is passed as the first argument (a string). | ||
99 | </p> | ||
100 | <p> | ||
101 | Here are the built-in LuaJIT control commands: | ||
102 | </p> | ||
103 | <ul> | ||
104 | <li id="j_on"><tt>-j on</tt> — Turns the JIT engine on (default).</li> | ||
105 | <li id="j_off"><tt>-j off</tt> — Turns the JIT engine off.</li> | ||
106 | <li id="j_debug"><tt>-j debug[=level]</tt> — Set debug level. See | ||
107 | <a href="luajit_api.html#jit_debug">jit.debug()</a>.</li> | ||
108 | </ul> | ||
109 | <p> | ||
110 | The following control commands are loaded from add-on modules: | ||
111 | </p> | ||
112 | <ul> | ||
113 | <li id="j_trace"><tt>-j trace[=file]</tt> — Trace the progress of the JIT compiler.</li> | ||
114 | <li id="j_dumphints"><tt>-j dumphints[=file]</tt> — Dump bytecode + hints before compilation.</li> | ||
115 | <li id="j_dump"><tt>-j dump[=file]</tt> — Dump machine code after compilation.</li> | ||
116 | </ul> | ||
117 | |||
118 | <!-- | ||
119 | <h3 id="opt_O"><tt>-O[level|ext]</tt></h3> | ||
120 | --> | ||
121 | <h3 id="opt_O"><tt>-O[level]</tt></h3> | ||
122 | <p> | ||
123 | This option loads and runs the optimizer module <tt>jit.opt</tt>. | ||
124 | The optimizer generates hints for the compiler backend to improve | ||
125 | the performance of the compiled code. The optimizer slows down | ||
126 | compilation slightly, but the end result should make up for it | ||
127 | in almost every case. | ||
128 | </p> | ||
129 | <p> | ||
130 | The <tt>-O</tt> form sets the default optimizer level, which is | ||
131 | currently <tt>2</tt> (this may change in future versions | ||
132 | of LuaJIT). | ||
133 | </p> | ||
134 | <p> | ||
135 | The <tt>-Olevel</tt> form explicitly sets the optimizer level: | ||
136 | </p> | ||
137 | <ul> | ||
138 | <li><tt>-O0</tt> — disable the optimizer but leave it attached.</li> | ||
139 | <li><tt>-O1</tt> — perform standard optimizations (like hints for table lookups).</li> | ||
140 | <li><tt>-O2</tt> — like <tt>-O1</tt> but also loads <tt>jit.opt_inline</tt> to enable result hints and inlining for standard library functions.</li> | ||
141 | </ul> | ||
142 | <!-- | ||
143 | <p> | ||
144 | The <tt>-Oext</tt> form loads optimizer extension modules | ||
145 | from <tt>jit.opt_<ext></tt>. | ||
146 | </p> | ||
147 | --> | ||
148 | <br class="flush"> | ||
149 | </div> | ||
150 | <div id="foot"> | ||
151 | <hr class="hide"> | ||
152 | Copyright © 2005-2011 Mike Pall | ||
153 | <span class="noprint"> | ||
154 | · | ||
155 | <a href="contact.html">Contact</a> | ||
156 | </span> | ||
157 | </div> | ||
158 | </body> | ||
159 | </html> | ||