Skip to content

Commit 55b1695

Browse files
author
Mike Pall
committed
RELEASE LuaJIT-2.0.0-beta1
0 parents  commit 55b1695

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+42143
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.[oa]
2+
*.so
3+
*.obj
4+
*.lib
5+
*.exp
6+
*.dll
7+
*.exe
8+
*.manifest
9+
*.dmp
10+
*.swp
11+
.tags

Makefile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
##############################################################################
2+
# LuaJIT top level Makefile for installation. Requires GNU Make.
3+
#
4+
# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
5+
# Note: src/Makefile has many more configurable options.
6+
#
7+
# ##### This Makefile is NOT useful for installation on Windows! #####
8+
# For MSVC, please follow the instructions given in src/msvcbuild.bat.
9+
# For MinGW and Cygwin, cd to src and run make with the Makefile there.
10+
# NYI: add wininstall.bat
11+
#
12+
# Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h
13+
##############################################################################
14+
15+
BASEVER= 2.0.0
16+
VERSION= 2.0.0-beta1
17+
18+
##############################################################################
19+
#
20+
# Change the installation path as needed and modify src/luaconf.h accordingly.
21+
# Note: PREFIX must be an absolute path!
22+
#
23+
PREFIX= /usr/local
24+
##############################################################################
25+
26+
INSTALL_BIN= $(PREFIX)/bin
27+
INSTALL_NAME= luajit-$(VERSION)
28+
INSTALL_T= $(INSTALL_BIN)/$(INSTALL_NAME)
29+
INSTALL_TSYM= $(INSTALL_BIN)/luajit
30+
INSTALL_INC= $(PREFIX)/include/luajit-$(BASEVER)
31+
INSTALL_JITLIB= $(PREFIX)/share/luajit-$(VERSION)/jit
32+
33+
MKDIR= mkdir -p
34+
SYMLINK= ln -f -s
35+
INSTALL_X= install -m 0755
36+
INSTALL_F= install -m 0644
37+
38+
FILES_T= luajit
39+
FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
40+
FILES_JITLIB= bc.lua v.lua dump.lua dis_x86.lua dis_x64.lua vmdef.lua
41+
42+
##############################################################################
43+
44+
INSTALL_DEP= src/luajit
45+
46+
all $(INSTALL_DEP):
47+
@echo "==== Building LuaJIT $(VERSION) ===="
48+
$(MAKE) -C src
49+
@echo "==== Successfully built LuaJIT $(VERSION) ===="
50+
51+
install: $(INSTALL_DEP)
52+
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
53+
$(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_JITLIB)
54+
cd src && $(INSTALL_X) $(FILES_T) $(INSTALL_T)
55+
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
56+
cd lib && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
57+
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
58+
@echo ""
59+
@echo "Note: the beta releases deliberately do NOT install a symlink for luajit"
60+
@echo "You can do this now by running this command (with sudo):"
61+
@echo ""
62+
@echo " $(SYMLINK) $(INSTALL_NAME) $(INSTALL_TSYM)"
63+
@echo ""
64+
65+
##############################################################################
66+
67+
amalg:
68+
@echo "Building LuaJIT $(VERSION)"
69+
$(MAKE) -C src amalg
70+
71+
clean:
72+
$(MAKE) -C src clean
73+
74+
cleaner:
75+
$(MAKE) -C src cleaner
76+
77+
distclean:
78+
$(MAKE) -C src distclean
79+
80+
SUB_TARGETS= amalg clean cleaner distclean
81+
82+
.PHONY: all install $(SUB_TARGETS)
83+
84+
##############################################################################

README

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
README for LuaJIT 2.0.0-beta1
2+
-----------------------------
3+
4+
LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.
5+
6+
Project Homepage: http://luajit.org/
7+
8+
LuaJIT is Copyright (C) 2005-2009 Mike Pall.
9+
LuaJIT is free software, released under the MIT/X license.
10+
See full Copyright Notice in src/luajit.h
11+
12+
Documentation for LuaJIT is available in HTML format.
13+
Please point your favorite browser to:
14+
15+
doc/luajit.html
16+

doc/api.html

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2+
<html>
3+
<head>
4+
<title>API Extensions</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-2009, 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>API Extensions</h1>
18+
</div>
19+
<div id="nav">
20+
<ul><li>
21+
<a href="luajit.html">LuaJIT</a>
22+
<ul><li>
23+
<a href="install.html">Installation</a>
24+
</li><li>
25+
<a href="running.html">Running</a>
26+
</li><li>
27+
<a class="current" href="api.html">API Extensions</a>
28+
</li></ul>
29+
</li><li>
30+
<a href="status.html">Status</a>
31+
<ul><li>
32+
<a href="changes.html">Changes</a>
33+
</li></ul>
34+
</li><li>
35+
<a href="faq.html">FAQ</a>
36+
</li><li>
37+
<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
38+
</li></ul>
39+
</div>
40+
<div id="main">
41+
<p>
42+
LuaJIT is fully upwards-compatible with Lua 5.1. It supports all
43+
<a href="http://www.lua.org/manual/5.1/manual.html#5"><span class="ext">&raquo;</span>&nbsp;standard Lua
44+
library functions</a> and the full set of
45+
<a href="http://www.lua.org/manual/5.1/manual.html#3"><span class="ext">&raquo;</span>&nbsp;Lua/C API
46+
functions</a>.
47+
</p>
48+
<p>
49+
LuaJIT is also fully ABI-compatible to Lua 5.1 at the linker/dynamic
50+
loader level. This means you can compile a C&nbsp;module against the
51+
standard Lua headers and load the same shared library from either Lua
52+
or LuaJIT.
53+
</p>
54+
55+
<h2 id="bit"><tt>bit.*</tt> &mdash; Bitwise Operations</h2>
56+
<p>
57+
LuaJIT supports all bitwise operations as defined by
58+
<a href="http://bitop.luajit.org"><span class="ext">&raquo;</span>&nbsp;Lua BitOp</a>:
59+
</p>
60+
<pre class="code">
61+
bit.tobit bit.tohex bit.bnot bit.band bit.bor bit.bxor
62+
bit.lshift bit.rshift bit.arshift bit.rol bit.ror bit.bswap
63+
</pre>
64+
<p>
65+
This module is a LuaJIT built-in &mdash; you don't need to download or
66+
install Lua BitOp. The Lua BitOp site has full documentation for all
67+
<a href="http://bitop.luajit.org/api.html"><span class="ext">&raquo;</span>&nbsp;Lua BitOp API functions</a>.
68+
</p>
69+
<p>
70+
Please make sure to <tt>require</tt> the module before using any of
71+
its functions:
72+
</p>
73+
<pre class="code">
74+
local bit = require("bit")
75+
</pre>
76+
<p>
77+
An already installed Lua BitOp module is ignored by LuaJIT.
78+
This way you can use bit operations from both Lua and LuaJIT on a
79+
shared installation.
80+
</p>
81+
82+
<h2 id="jit"><tt>jit.*</tt> &mdash; JIT compiler control</h2>
83+
<p>
84+
The functions in this built-in module control the behavior
85+
of the JIT compiler engine.
86+
</p>
87+
88+
<h3 id="jit_onoff"><tt>jit.on()<br>
89+
jit.off()</tt></h3>
90+
<p>
91+
Turns the whole JIT compiler on (default) or off.
92+
</p>
93+
<p>
94+
These functions are typically used with the command line options
95+
<tt>-j on</tt> or <tt>-j off</tt>.
96+
</p>
97+
98+
<h3 id="jit_flush"><tt>jit.flush()</tt></h3>
99+
<p>
100+
Flushes the whole cache of compiled code.
101+
</p>
102+
103+
<h3 id="jit_flush_tr"><tt>jit.flush(tr)</tt></h3>
104+
<p>
105+
Flushes the code for the specified root trace and all of its
106+
side traces from the cache.
107+
</p>
108+
109+
<h3 id="jit_onoff_func"><tt>jit.on(func|true [,true|false])<br>
110+
jit.off(func|true [,true|false])<br>
111+
jit.flush(func|true [,true|false])</tt></h3>
112+
<p>
113+
<tt>jit.on</tt> enables JIT compilation for a Lua function (this is
114+
the default).
115+
</p>
116+
<p>
117+
<tt>jit.off</tt> disables JIT compilation for a Lua function and
118+
flushes any already compiled code from the code cache.
119+
</p>
120+
<p>
121+
<tt>jit.flush</tt> flushes the code, but doesn't affect the
122+
enable/disable status.
123+
</p>
124+
<p>
125+
The current function, i.e. the Lua function calling this library
126+
function, can also be specified by passing <tt>true</tt> as the first
127+
argument.
128+
</p>
129+
<p>
130+
If the second argument is <tt>true</tt>, JIT compilation is also
131+
enabled, disabled or flushed recursively for all subfunctions of a
132+
function. With <tt>false</tt> only the subfunctions are affected.
133+
</p>
134+
<p>
135+
The <tt>jit.on</tt> and <tt>jit.off</tt> functions only set a flag
136+
which is checked when the function is about to be compiled. They do
137+
not trigger immediate compilation.
138+
</p>
139+
<p>
140+
Typical usage is <tt>jit.off(true, true)</tt> in the main chunk
141+
of a module to turn off JIT compilation for the whole module for
142+
debugging purposes.
143+
</p>
144+
145+
<h3 id="jit_version"><tt>jit.version</tt></h3>
146+
<p>
147+
Contains the LuaJIT version string.
148+
</p>
149+
150+
<h3 id="jit_version_num"><tt>jit.version_num</tt></h3>
151+
<p>
152+
Contains the version number of the LuaJIT core. Version xx.yy.zz
153+
is represented by the decimal number xxyyzz.
154+
</p>
155+
156+
<h3 id="jit_arch"><tt>jit.arch</tt></h3>
157+
<p>
158+
Contains the target architecture name (CPU and optional ABI).
159+
</p>
160+
161+
<h2 id="jit_opt"><tt>jit.opt.*</tt> &mdash; JIT compiler optimization control</h2>
162+
<p>
163+
This module provides the backend for the <tt>-O</tt> command line
164+
option.
165+
</p>
166+
<p>
167+
You can also use it programmatically, e.g.:
168+
</p>
169+
<pre class="code">
170+
jit.opt.start(2) -- same as -O2
171+
jit.opt.start("-dce")
172+
jit.opt.start("hotloop=10", "hotexit=2")
173+
</pre>
174+
<p>
175+
Unlike in LuaJIT 1.x, the module is built-in and
176+
<b>optimization is turned on by default!</b>
177+
It's no longer necessary to run <tt>require("jit.opt").start()</tt>,
178+
which was one of the ways to enable optimization.
179+
</p>
180+
181+
<h2 id="jit_util"><tt>jit.util.*</tt> &mdash; JIT compiler introspection</h2>
182+
<p>
183+
This module holds functions to introspect the bytecode, generated
184+
traces, the IR and the generated machine code. The functionality
185+
provided by this module is still in flux and therefore undocumented.
186+
</p>
187+
<p>
188+
The debug modules <tt>-jbc</tt>, <tt>-jv</tt> and <tt>-jdump</tt> make
189+
extensive use of these functions. Please check out their source code,
190+
if you want to know more.
191+
</p>
192+
<br class="flush">
193+
</div>
194+
<div id="foot">
195+
<hr class="hide">
196+
Copyright &copy; 2005-2009 Mike Pall
197+
<span class="noprint">
198+
&middot;
199+
<a href="contact.html">Contact</a>
200+
</span>
201+
</div>
202+
</body>
203+
</html>

0 commit comments

Comments
 (0)