Commit Graph

4560 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
d356183402 new function 'luaS_hashlongstr' 2015-11-03 13:36:01 -02:00
Roberto Ierusalimschy
e61ee8a036 in 'luaD_call', use two functions instead of one with fixed boolean
argument + stack error handling in 'luaD_call' moved to a separated
function
2015-11-02 16:48:49 -02:00
Roberto Ierusalimschy
ff1289a361 in 'luaD_call', use two functions instead of one with fixed boolean
argument
2015-11-02 16:48:07 -02:00
Roberto Ierusalimschy
cd73f3ccc5 now that we have a counter for CallInfos, use it for a more
accurate value for the memory used by a thread
2015-11-02 14:19:29 -02:00
Roberto Ierusalimschy
8c1fb91802 macro 'incr_top' replaced by function 'luaD_inctop'. (It is not used
in critical time pathes, can save a few bytes without the macro)
2015-11-02 14:09:30 -02:00
Roberto Ierusalimschy
33b366ec32 added counters for total and individual CallInfo entries (to allow
better syncronization between CallInfo size and stack size)
2015-11-02 14:01:41 -02:00
Roberto Ierusalimschy
c5363a1b58 in 'luaD_precall', in vararg functions, complete missing parameters
only after moving them to final place (avoids checking the stack
again)
2015-11-02 12:06:01 -02:00
Roberto Ierusalimschy
332a06bbd1 'luaO_pushvfstring' now uses 'incr_top' to increment top. 2015-11-02 12:02:35 -02:00
Roberto Ierusalimschy
ffd0d1232d using more "conventional" loops in 'luaD_poscall' (probably a little
more efficient?)
2015-11-02 09:48:59 -02:00
Roberto Ierusalimschy
07a2dcacbf flag CIST_REENTRY changed to CIST_FRESH (its negation); fresh invocations
seem to be less frequent than reentries. (So, avoid setting flag on
the frequent case.)
2015-11-02 09:43:17 -02:00
Roberto Ierusalimschy
c874abac98 with 'fast tracks', there is no need to do raw accesses in 'ipairs' 2015-10-29 13:21:04 -02:00
Roberto Ierusalimschy
789e423b32 corrected comparisons of signed (int) with unsigned (size_t) 2015-10-29 13:11:41 -02:00
Roberto Ierusalimschy
96ec8671b1 macro 'buff2num' replaced by its body (it caused more harm than good
to readability)
2015-10-28 16:51:47 -02:00
Roberto Ierusalimschy
cc3a42b190 option 'c' in 'string.pack' accepts any string size (truncating
if larger and padding if smaller)
2015-10-28 15:56:51 -02:00
Roberto Ierusalimschy
6707ce6349 function prepares vararg only if it really uses them (chunks
are always declared vararg but seldom uses them)
2015-10-28 15:28:40 -02:00
Roberto Ierusalimschy
257961c601 OP_SELF can use 'luaV_fastget' specialized for strings, as it
is applied only to string keys
2015-10-28 12:50:09 -02:00
Roberto Ierusalimschy
ae515a346c comments for luaD_precall/luaD_poscall 2015-10-28 10:25:36 -02:00
Roberto Ierusalimschy
3cdf1d676b details (avoid 'case' inside block + avoid using one variable for
two roles)
2015-10-28 10:06:45 -02:00
Roberto Ierusalimschy
82129b9266 use macro 'hasjumps' to test whether expression has jumps... 2015-10-26 12:27:47 -02:00
Roberto Ierusalimschy
8004ab756f hook test in 'luaV_execute' reduced to minimum (rest done in
'luaG_traceexec'; no difference in performance for the non-hook
case, but keeps 'luaV_execute' a little simpler) + 'base' updates
replaced by 'Protect' (which serves this rule)
2015-10-22 12:40:47 -02:00
Roberto Ierusalimschy
ee5ef0f295 hook test in 'luaV_execute' reduced to minimum (rest done in
'luaG_traceexec'
2015-10-22 12:40:47 -02:00
Roberto Ierusalimschy
5bdee4f810 small changes to allow 'precall' to spend time preserving 'func'
only when needed (that is, when stack actually changes)
2015-10-21 16:40:47 -02:00
Roberto Ierusalimschy
48098c42ff generic definitions for float types moved to before variable definitions
(so that specific cases can redefine these generic definitions if
needed)
2015-10-21 16:17:40 -02:00
Roberto Ierusalimschy
3ad55386c4 'condchangemem' also may need to run 'pre'/'pos' 2015-10-21 16:15:15 -02:00
Roberto Ierusalimschy
caf8278710 added comments 2015-10-20 16:00:19 -02:00
Roberto Ierusalimschy
f7670781cf cleaner definition for 'luaC_condGC', using 'pre'/'pos' parameters 2015-10-20 15:56:21 -02:00
Roberto Ierusalimschy
df8b996bcc 'Protect' in table operations is not needed in the fast track
+ removal of a few dead macros
2015-10-20 15:41:35 -02:00
Roberto Ierusalimschy
75d5a8924c macro 'addbuff' was using external variable name, instead of using
its parameter name inside the macro.
2015-10-20 11:11:05 -02:00
Roberto Ierusalimschy
880f82d089 '*' as a number means stack size, so that "return *" returns
all values in the stack.
2015-10-12 13:38:19 -03:00
Roberto Ierusalimschy
1a741157cb avoid (undefined behavior) integer 'overflow' in left shift 2015-10-08 12:55:35 -03:00
Roberto Ierusalimschy
0c78de0d6d avoid calling write function with empty block 2015-10-08 12:53:49 -03:00
Roberto Ierusalimschy
df45f7118b detail (added assertion) 2015-10-08 12:53:31 -03:00
Roberto Ierusalimschy
880df57e52 detail (removed unreacheable 'break') 2015-10-08 12:53:05 -03:00
Roberto Ierusalimschy
8949904783 allow NULL string when length is zero in 'lua_pushlstring' and
'luaL_addlstring'
2015-10-06 13:10:22 -03:00
Roberto Ierusalimschy
9294466234 detail (string cache a bit smaller by default) 2015-10-06 11:29:49 -03:00
Roberto Ierusalimschy
e290bd6760 in 'luaL_traceback', print correct number of levels even when
initial level is not 1.
2015-10-02 12:46:49 -03:00
Roberto Ierusalimschy
dc4232379d detail (ensure subtraction is done unsigned) 2015-10-02 12:39:23 -03:00
Roberto Ierusalimschy
10fffcd80a 'gmatch' keeps its state in a userdata (keeping the same 'MatchState'
across calls)
2015-09-28 15:05:01 -03:00
Roberto Ierusalimschy
8264dbc2bb implemented counter to abort non-linear behavior in pattern matching 2015-09-26 15:45:03 -03:00
Roberto Ierusalimschy
9fae7b6d3f code for string cache generalized for "associative sets" (compiler
will optimize away or inline the extra loops)
2015-09-22 11:18:24 -03:00
Roberto Ierusalimschy
0f1f51be4b 'table.move' tries to copy elements in increasing order
whenever possible
2015-09-17 12:53:50 -03:00
Roberto Ierusalimschy
ee5edb6b68 macros 'getaddrstr' and 'getstr' unified (they do the same thing) 2015-09-17 12:51:05 -03:00
Roberto Ierusalimschy
bda83e22c0 'tablib' does not try to use raw operations when possible: fast
track should make standard operations fast enough to forgo
raw accesses
2015-09-09 12:42:30 -03:00
Roberto Ierusalimschy
364cdbdbdb 'setobj2t' incorporated into 'luaV_fastset' + 'invalidateTMcache'
is not needed in the fast track (as it does not create new
entries) + small bug in 'auxsetstr' (calling barrier with wrong
object) + using 'setobj2t' without side effects in its arguments
2015-09-09 10:45:50 -03:00
Roberto Ierusalimschy
b91bc93fd3 'setobj2t' incorporated into 'luaV_fastset' + 'invalidateTMcache'
is not needed in the fast track (as it does not create new
entries)
2015-09-09 10:44:07 -03:00
Roberto Ierusalimschy
53be1451a8 new definition for macro 'checkliveness' 2015-09-08 13:55:43 -03:00
Roberto Ierusalimschy
eb0be12ceb detail in macro 'checkliveness' + macro 'setobj2t' defined as an
expression (to be used in macro 'luaV_fastset')
2015-09-08 13:54:52 -03:00
Roberto Ierusalimschy
1198d82530 'lua_longassert' defined as an expression (instead of a command) 2015-09-08 13:53:56 -03:00
Roberto Ierusalimschy
6556fcfe5a small janitor work 2015-09-08 12:49:25 -03:00
Roberto Ierusalimschy
41964648ee long strings are created directly in final position when possible
(instead of using an auxiliar buffer to first create the string
and then allocate the final string and copy result there)
2015-09-08 12:41:05 -03:00