Roberto Ierusalimschy
7c3cb71fa4
Free bit 7 of GC 'marked' field
Tables were using this bit to indicate their array sizes were real
('isrealasize'), but this bit can be useful for tests. Instead, they
can use bit 7 of their 'flag' field for that purpose. (There are only
six fast-access metamethods.) This 'flag' field only exists in tables,
so this use does not affect other types.
4 years ago
Roberto Ierusalimschy
46c3587a6f
Clearer distinction between types and tags
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
5 years ago
Roberto Ierusalimschy
df13f25948
First version of OP_MMBIN opcodes
In arithmetic/bitwise operators, the call to metamethods is made
in a separate opcode following the main one. (The main
opcode skips this next one when the operation succeeds.) This
change reduces slightly the size of the binary and the complexity
of the arithmetic/bitwise opcodes. It also simplfies the treatment
of errors and yeld/resume in these operations, as there are much
fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK,
instead of all variants of all arithmetic/bitwise operators.)
5 years ago
Roberto Ierusalimschy
b80077b8f3
Change in the handling of 'L->top' when calling metamethods
Instead of updating 'L->top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L->top'.)
5 years ago
Roberto Ierusalimschy
23e6bac8a0
Keep correct type for immediate operands in comparisons
When calling metamethods for things like 'a < 3.0', which generates
the opcode OP_LTI, the C register tells that the operand was
converted to an integer, so that it can be corrected to float when
calling a metamethod.
This commit also includes some other stuff:
- file 'onelua.c' added to the project
- opcode OP_PREPVARARG renamed to OP_VARARGPREP
- comparison opcodes rewritten through macros
6 years ago
Roberto Ierusalimschy
5e76a4fd31
New macros for arithmetic/bitwise operations in 'luaV_execute'
The repetitive code of the arithmetic and bitwise operators in
the main iterpreter loop was moved to appropriate macros.
(As a detail, the function 'luaV_div' was renamed 'luaV_idiv',
as it does an "integer division" (floor division).
6 years ago
Roberto Ierusalimschy
bd96330d03
First "complete" implementation of to-be-closed variables
Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
6 years ago
Roberto Ierusalimschy
f99509581e
Removed extra information from RCS keyword strings
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
6 years ago
Roberto Ierusalimschy
b43300c14f
change in 'LUAI_DDEC' to allow variables to be static in 'onelua'
+ change in 'LUAMOD_API' as opening functions do not need to be global
6 years ago
Roberto Ierusalimschy
6f2b8e21c4
added 'const' to 'Proto*' when possible
7 years ago
Roberto Ierusalimschy
fb8fa66136
no more 'luaH_emptyobject' and comparisons of addresses of global variables
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
7 years ago
Roberto Ierusalimschy
892aff2a07
avoid circular inclusion between ltm.h <-> lstate.h
7 years ago
Roberto Ierusalimschy
03c6a05ec8
no more nil-in-table
7 years ago
Roberto Ierusalimschy
b7edf5d2d8
metamethods for 'removekey'/'keyin'
7 years ago
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
7 years ago
Roberto Ierusalimschy
49dae52d08
correct way to check stack space for vararg functions
7 years ago
Roberto Ierusalimschy
b1379936cf
vararg back to '...' (but with another implementation)
new implementation should have zero overhead for non-vararg functions
7 years ago
Roberto Ierusalimschy
318a9a5859
new opcode 'PREPVARARG'
(avoids test for vararg function in all function calls)
7 years ago
Roberto Ierusalimschy
89110986d7
bug in tailcall of vararg functions
(when adjusting missing parameters)
7 years ago
Roberto Ierusalimschy
86431a2f1c
new opcodes BANDK/BORK/BXORK. (They do not use immediate operands
because, too often, masks in bitwise operations are integers larger
than one byte.)
7 years ago
Roberto Ierusalimschy
093c16b67b
new opcodes 'OP_LTI' and 'OP_LEI'
7 years ago
Roberto Ierusalimschy
1b10033583
new function 'luaT_trybiniTM'
to handle tag methods for instructions with immediate integer arguments
7 years ago
Roberto Ierusalimschy
f96497397a
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
7 years ago
Roberto Ierusalimschy
5c8770f896
back to old-style vararg system (with vararg table collecting extra
arguments)
8 years ago
Roberto Ierusalimschy
fb9de1b4d7
detail ('luaT_callbinTM' does not need to be extern)
8 years ago
Roberto Ierusalimschy
7777b412de
When available, use metafield '__name' in error messages
9 years ago
Roberto Ierusalimschy
bdf566a8a3
`name' in comments changed to 'name'
10 years ago
Roberto Ierusalimschy
1a3656e56e
more relaxed rules for __eq metamethod (more similar to other
operators)
11 years ago
Roberto Ierusalimschy
1ea2d20f74
first implementation of '<<', '>>', and '~' (bitwise not)
11 years ago
Roberto Ierusalimschy
c0edab0f6d
first implementation of bitwise operators '&' (band), '|' (bor),
and '~' (bxor)
11 years ago
Roberto Ierusalimschy
a948054a19
new order for binary operations (grouping them by type of result)
11 years ago
Roberto Ierusalimschy
b4be507578
new function 'luaT_trybinTM'
12 years ago
Roberto Ierusalimschy
a2f5c28a80
new operation '//' (integer division)
12 years ago
Roberto Ierusalimschy
9600c60df3
functions 'get_equalTM' and 'call_orderTM' moved to other files
to make 'lvm.c' smaller
12 years ago
Roberto Ierusalimschy
32bf6c9b27
functions 'traceexec', 'callTM', and 'call_binTM' moved to other
files to make 'lvm.c' a little smaller
12 years ago
Roberto Ierusalimschy
8f8665fffa
'ttypenv' -> 'ttnov'
12 years ago
Roberto Ierusalimschy
98816d0ce5
small problems with 'luaone.c'
14 years ago
Roberto Ierusalimschy
7dfa4cd655
first implementation of light C functions
15 years ago
Roberto Ierusalimschy
070d3743a7
"no value" added to array luaT_typenames + occurrences of "userdata"
in that array unified in a single address
15 years ago
Roberto Ierusalimschy
062e809e54
new macros 'LUAI_DDEC'/'LUAI_DDEF' to better control declarations and
definitions of non-static variables
15 years ago
Roberto Ierusalimschy
fe0838cd1c
tables and strings respect __len metamethod
17 years ago
Roberto Ierusalimschy
d987cf1f81
new mark LUAI_DATA for extern data
20 years ago
Roberto Ierusalimschy
f21e9c172f
details
20 years ago
Roberto Ierusalimschy
6cf85dcc90
metatables for all types
20 years ago
Roberto Ierusalimschy
8718fda9b2
added LUAI_FUNC to functions not in the API
20 years ago
Roberto Ierusalimschy
7d57ea70bc
new `mod' (`%') operator
20 years ago
Roberto Ierusalimschy
47fc57a252
`TObject' renamed to `TValue' + other name changes and better assertions
for incremental garbage collection
21 years ago
Roberto Ierusalimschy
af850484a9
default metatable can be NULL
21 years ago
Roberto Ierusalimschy
5c5d9b2703
back to `__mode' metafield to specify weakness
22 years ago
Roberto Ierusalimschy
e8f35fc4ff
unification of __index & __gettable (and __newindex & __settable)
22 years ago