llvm binding helloworld

pull/81/head
Dibyendu Majumdar 9 years ago
parent 1b44c934c0
commit 0a13fabfc6

@ -133,14 +133,14 @@ If '``OP_RETURN``' is returning to a Lua function and if the number of return va
If ``luaV_execute()`` was called externally then '``OP_RETURN``' leaves ``L->top`` unchanged - so it will continue to be just past the top of the results list. This is because luaV_execute() does not have a way of informing callers how many values were returned; so the caller can determine the number of results by inspecting ``L->top``.
Example of 'VARARG' followed by 'RETURN'::
Example of '``OP_VARARG``' followed by '``OP_RETURN``'::
function x(...) return ... end
1 [1] VARARG 0 0
2 [1] RETURN 0 0
Now suppose we call ``x(1,2,3)`` then observe the setting of ``L->top`` when '``RETURN``' executes::
Suppose we call ``x(1,2,3)``; then, observe the setting of ``L->top`` when '``OP_RETURN``' executes::
(LOADK A=1 Bx=-2) L->top = 4, ci->top = 4
(LOADK A=2 Bx=-3) L->top = 4, ci->top = 4
@ -149,7 +149,7 @@ Now suppose we call ``x(1,2,3)`` then observe the setting of ``L->top`` when '``
(VARARG A=0 B=0) L->top = 2, ci->top = 2 ; we are in x()
(RETURN A=0 B=0) L->top = 3, ci->top = 2
Observe that '``VARARG``' set ``L->top`` to ``base+3``.
Observe that '``OP_VARARG``' set ``L->top`` to ``base+3``.
But if we call ``x(1)`` instead::
@ -160,4 +160,4 @@ But if we call ``x(1)`` instead::
(VARARG A=0 B=0) L->top = 2, ci->top = 2 ; we are in x()
(RETURN A=0 B=0) L->top = 1, ci->top = 2
Notice that this time '``VARARG``' set ``L->top`` to ``base+1``.
Notice that this time '``OP_VARARG``' set ``L->top`` to ``base+1``.
Loading…
Cancel
Save