lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Yes, just after sending the message I looked at 'luac -l' output of simple scripts, and I'll be able to inject suitable VM's in places (will happen at the token processing layer), to get things working. One or two weeks, and there'll be a "constraints patch" that is able to check out:

	- function calling parameters
	- function return values
	- assignments to local variables

Not able to do the following (do you think it would even be useful?):

	- assignments to table sub-indices (= modifications to a table)
- assignments to global variables (basically the same case, since it's a _G table)

The approach is good in that it keeps all patching on the parser/ coder side, and runtime area is untouched. Later, there is a chance to optimize with a new VM code if needed.

-asko


Vyacheslav Egorov kirjoitti 14.10.2006 kello 4.26:

Asko Kauppi wrote:
- make a new VM instruction    -> maybe, kinda daring/hussle
What about generating some `old' code in function prolog/epilog? It is the easiest solution I can imagine.

function f(v:int):int
 -- body
 return i
end

turns to

function f(v)
 assert.int(v)
 -- body
 assert.int(i)
 return i
end

The same for assigment

local v:int = p

local v = assert.int(p)

--
e.v.e