projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bcm63xx: add initial support for bcm6368 boards
[openwrt.git]
/
package
/
lua
/
patches
/
300-opcode_performance.patch
diff --git
a/package/lua/patches/300-opcode_performance.patch
b/package/lua/patches/300-opcode_performance.patch
index
dbc89a8
..
e870a25
100644
(file)
--- a/
package/lua/patches/300-opcode_performance.patch
+++ b/
package/lua/patches/300-opcode_performance.patch
@@
-10,15
+10,13
@@
/*
* If 'obj' is a string, it is tried to be interpreted as a number.
/*
* If 'obj' is a string, it is tried to be interpreted as a number.
-@@ -562,12 +565,6
5 @@
+@@ -562,12 +565,6
3 @@ static inline int arith_mode( const TVal
ARITH_OP1_END
#endif
+#ifdef COMPUTED_GOTO
+#define OPCODE_TARGET(op) DO_OP_##op:
ARITH_OP1_END
#endif
+#ifdef COMPUTED_GOTO
+#define OPCODE_TARGET(op) DO_OP_##op:
-+#define CALL_OPCODE(op) \
-+ if ((op < sizeof(opcodes) / sizeof(opcodes[0])) && opcodes[op]) \
-+ goto *opcodes[op];
++#define CALL_OPCODE(op) goto *opcodes[op];
+#define OPCODE_PTR(op) [OP_##op] = &&DO_OP_##op
+#else
+#define OPCODE_TARGET(op) case OP_##op:
+#define OPCODE_PTR(op) [OP_##op] = &&DO_OP_##op
+#else
+#define OPCODE_TARGET(op) case OP_##op:
@@
-76,11
+74,13
@@
reentry: /* entry point */
lua_assert(isLua(L->ci));
pc = L->savedpc;
reentry: /* entry point */
lua_assert(isLua(L->ci));
pc = L->savedpc;
-@@ -593,32 +649,32 @@
+@@ -592,33 +646,33 @@ void luaV_execute (lua_State *L, int nex
+ lua_assert(base == L->base && L->base == L->ci->base);
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
-
switch (GET_OPCODE(i)) {
+
-
switch (GET_OPCODE(i)) {
- case OP_MOVE: {
- case OP_MOVE: {
++ CALL_OPCODE(GET_OPCODE(i)) {
+ OPCODE_TARGET(MOVE) {
setobjs2s(L, ra, RB(i));
continue;
+ OPCODE_TARGET(MOVE) {
setobjs2s(L, ra, RB(i));
continue;
@@
-115,7
+115,7
@@
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
-@@ -626,88 +68
2,88 @@
+@@ -626,88 +68
0,88 @@ void luaV_execute (lua_State *L, int nex
Protect(luaV_gettable(L, &g, rb, ra));
continue;
}
Protect(luaV_gettable(L, &g, rb, ra));
continue;
}
@@
-219,7
+219,7
@@
const TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
const TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
-@@ -727,18 +78
3,18 @@
+@@ -727,18 +78
1,18 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
}
continue;
}
@@
-241,7
+241,7
@@
TValue *rb = RKB(i);
TValue *rc = RKC(i);
Protect(
TValue *rb = RKB(i);
TValue *rc = RKC(i);
Protect(
-@@ -748,7 +80
4,7 @@
+@@ -748,7 +80
2,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
pc++;
continue;
}
@@
-250,7
+250,7
@@
Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
-@@ -756,7 +81
2,7 @@
+@@ -756,7 +81
0,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
pc++;
continue;
}
@@
-259,7
+259,7
@@
Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
-@@ -764,13 +8
20,13 @@
+@@ -764,13 +8
18,13 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
pc++;
continue;
}
@@
-275,7
+275,7
@@
TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb);
TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb);
-@@ -779,7 +83
5,7 @@
+@@ -779,7 +83
3,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
pc++;
continue;
}
@@
-284,7
+284,7
@@
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */
-@@ -800,7 +85
6,7 @@
+@@ -800,7 +85
4,7 @@ void luaV_execute (lua_State *L, int nex
}
}
}
}
}
}
@@
-293,7
+293,7
@@
int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc;
int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc;
-@@ -832,7 +88
8,7 @@
+@@ -832,7 +88
6,7 @@ void luaV_execute (lua_State *L, int nex
}
}
}
}
}
}
@@
-302,7
+302,7
@@
int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base);
int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base);
-@@ -847,7 +90
3,7 @@
+@@ -847,7 +90
1,7 @@ void luaV_execute (lua_State *L, int nex
goto reentry;
}
}
goto reentry;
}
}
@@
-311,7
+311,7
@@
/* If start,step and limit are all integers, we don't need to check
* against overflow in the looping.
*/
/* If start,step and limit are all integers, we don't need to check
* against overflow in the looping.
*/
-@@ -875,7 +9
31,7 @@
+@@ -875,7 +9
29,7 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
}
continue;
}
@@
-320,7
+320,7
@@
const TValue *init = ra;
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
const TValue *init = ra;
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
-@@ -898,7 +95
4,7 @@
+@@ -898,7 +95
2,7 @@ void luaV_execute (lua_State *L, int nex
dojump(L, pc, GETARG_sBx(i));
continue;
}
dojump(L, pc, GETARG_sBx(i));
continue;
}
@@
-329,7
+329,7
@@
StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1);
StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1);
-@@ -914,7 +9
70,7 @@
+@@ -914,7 +9
68,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
pc++;
continue;
}
@@
-338,7
+338,7
@@
int n = GETARG_B(i);
int c = GETARG_C(i);
int last;
int n = GETARG_B(i);
int c = GETARG_C(i);
int last;
-@@ -936,11 +99
2,11 @@
+@@ -936,11 +99
0,11 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
}
continue;
}
@@
-352,7
+352,7
@@
Proto *p;
Closure *ncl;
int nup, j;
Proto *p;
Closure *ncl;
int nup, j;
-@@ -960,7 +101
6,7 @@
+@@ -960,7 +101
4,7 @@ void luaV_execute (lua_State *L, int nex
Protect(luaC_checkGC(L));
continue;
}
Protect(luaC_checkGC(L));
continue;
}
This page took
0.026359 seconds
and
4
git commands to generate.