<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/lua-github.git/lopcodes.c, branch v5.4-beta</title>
<subtitle>github.com: lua/lua.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/'/>
<entry>
<title>Removed arithmetic opcodes with immediate operand</title>
<updated>2019-09-10T16:20:03+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-09-10T16:20:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=91dad09f65984048ae43c8894d18acb785c7092b'/>
<id>91dad09f65984048ae43c8894d18acb785c7092b</id>
<content type='text'>
The difference in performance between immediate operands and K operands
does not seem to justify all those extra opcodes. We only keep OP_ADDI,
due to its ubiquity and because the difference is a little more relevant.
(Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The difference in performance between immediate operands and K operands
does not seem to justify all those extra opcodes. We only keep OP_ADDI,
due to its ubiquity and because the difference is a little more relevant.
(Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Added macro 'testMMMode'</title>
<updated>2019-09-06T17:14:11+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-09-06T17:14:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=4518e5df24600cacdb3bab75d640348d28e8b769'/>
<id>4518e5df24600cacdb3bab75d640348d28e8b769</id>
<content type='text'>
Macro 'testMMMode' checks whether opcode is an MM opcode.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Macro 'testMMMode' checks whether opcode is an MM opcode.
</pre>
</div>
</content>
</entry>
<entry>
<title>First version of OP_MMBIN opcodes</title>
<updated>2019-08-27T16:59:39+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-08-27T16:59:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=df13f259487459f3a28d31d76c890aa6c2d061e0'/>
<id>df13f259487459f3a28d31d76c890aa6c2d061e0</id>
<content type='text'>
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.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Change in the handling of 'L-&gt;top' when calling metamethods</title>
<updated>2019-07-26T17:59:39+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-07-26T17:59:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=b80077b8f3e27a94c6afa895b41a9f8b52c42e61'/>
<id>b80077b8f3e27a94c6afa895b41a9f8b52c42e61</id>
<content type='text'>
Instead of updating 'L-&gt;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-&gt;top'.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of updating 'L-&gt;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-&gt;top'.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Keep correct type for immediate operands in comparisons</title>
<updated>2019-03-22T16:37:17+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-03-22T16:37:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff'/>
<id>23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff</id>
<content type='text'>
When calling metamethods for things like 'a &lt; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When calling metamethods for things like 'a &lt; 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
</pre>
</div>
</content>
</entry>
<entry>
<title>New semantics for the integer 'for' loop</title>
<updated>2019-03-19T13:53:18+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-03-19T13:53:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0'/>
<id>9b37a4695ebf50b37b5b4fb279ae948f23b5b6a0</id>
<content type='text'>
The numerical 'for' loop over integers now uses a precomputed counter
to control its number of iteractions. This change eliminates several
weird cases caused by overflows (wrap-around) in the control variable.
(It also ensures that every integer loop halts.)

Also, the special opcodes for the usual case of step==1 were removed.
(The new code is already somewhat complex for the usual case,
but efficient.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The numerical 'for' loop over integers now uses a precomputed counter
to control its number of iteractions. This change eliminates several
weird cases caused by overflows (wrap-around) in the control variable.
(It also ensures that every integer loop halts.)

Also, the special opcodes for the usual case of step==1 were removed.
(The new code is already somewhat complex for the usual case,
but efficient.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Added opcodes for arithmetic with K operands</title>
<updated>2018-11-23T14:23:45+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2018-11-23T14:23:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=84e32ad2ebd6bd160c1320456743a5b1d8f233e9'/>
<id>84e32ad2ebd6bd160c1320456743a5b1d8f233e9</id>
<content type='text'>
Added opcodes for all seven arithmetic operators with K operands
(that is, operands that are numbers in the array of constants of
the function). They cover the cases of constant float operands
(e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g.,
'x % 10000').
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added opcodes for all seven arithmetic operators with K operands
(that is, operands that are numbers in the array of constants of
the function). They cover the cases of constant float operands
(e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g.,
'x % 10000').
</pre>
</div>
</content>
</entry>
<entry>
<title>More uniformity in code generation for 'for' loops</title>
<updated>2018-10-26T13:38:50+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2018-10-26T13:38:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=6e9b719694bffb8de711f182d405ec37d32ae0b1'/>
<id>6e9b719694bffb8de711f182d405ec37d32ae0b1</id>
<content type='text'>
Added new instruction 'OP_TFORPREP' to prepare a generic for loop.
Currently it is equivalent to a jump (but with a format 'iABx',
similar to other for-loop preparing instructions), but soon it will
be the place to create upvalues for closing loop states.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added new instruction 'OP_TFORPREP' to prepare a generic for loop.
Currently it is equivalent to a jump (but with a format 'iABx',
similar to other for-loop preparing instructions), but soon it will
be the place to create upvalues for closing loop states.
</pre>
</div>
</content>
</entry>
<entry>
<title>Towards "to closed" local variables</title>
<updated>2018-10-08T13:42:07+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2018-10-08T13:42:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=4cd1f4aac01184765818e0cebf02da454ccf6590'/>
<id>4cd1f4aac01184765818e0cebf02da454ccf6590</id>
<content type='text'>
Start of the implementation of "scoped variables" or "to be closed"
variables, local variables whose '__close' (or themselves) are called
when they go out of scope. This commit implements the syntax, the
opcode, and the creation of the corresponding upvalue, but it still
does not call the finalizations when the variable goes out of scope
(the most important part).

Currently, the syntax is 'local scoped name = exp', but that will
probably change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Start of the implementation of "scoped variables" or "to be closed"
variables, local variables whose '__close' (or themselves) are called
when they go out of scope. This commit implements the syntax, the
opcode, and the creation of the corresponding upvalue, but it still
does not call the finalizations when the variable goes out of scope
(the most important part).

Currently, the syntax is 'local scoped name = exp', but that will
probably change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Removed extra information from RCS keyword strings</title>
<updated>2018-08-23T17:26:12+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2018-08-23T17:26:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=f99509581ee73c1c2dbddb3398e87c098771d31f'/>
<id>f99509581ee73c1c2dbddb3398e87c098771d31f</id>
<content type='text'>
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
</pre>
</div>
</content>
</entry>
</feed>
