diff options
| author | Mike Pall <mike> | 2010-09-02 17:16:56 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2010-09-02 17:16:56 +0200 |
| commit | f708d31bcc63d1d6f20cb1b1a2dc6ebf69ef41a3 (patch) | |
| tree | daf76dc454312b0404f0a937be05b52669b88a0e | |
| parent | 44fb3ebc64fd43c2c2a5ed2070a5470ef2765b68 (diff) | |
| download | luajit-f708d31bcc63d1d6f20cb1b1a2dc6ebf69ef41a3.tar.gz luajit-f708d31bcc63d1d6f20cb1b1a2dc6ebf69ef41a3.tar.bz2 luajit-f708d31bcc63d1d6f20cb1b1a2dc6ebf69ef41a3.zip | |
Explicitly indicate tailcall from fast function fallback.
| -rw-r--r-- | src/buildvm_x64.h | 618 | ||||
| -rw-r--r-- | src/buildvm_x64win.h | 620 | ||||
| -rw-r--r-- | src/buildvm_x86.dasc | 29 | ||||
| -rw-r--r-- | src/buildvm_x86.h | 662 | ||||
| -rw-r--r-- | src/lib_base.c | 2 | ||||
| -rw-r--r-- | src/lj_lib.h | 1 |
6 files changed, 967 insertions, 965 deletions
diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h index 91da5f6b..f2816d14 100644 --- a/src/buildvm_x64.h +++ b/src/buildvm_x64.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #define DASM_SECTION_CODE_OP 0 | 12 | #define DASM_SECTION_CODE_OP 0 |
| 13 | #define DASM_SECTION_CODE_SUB 1 | 13 | #define DASM_SECTION_CODE_SUB 1 |
| 14 | #define DASM_MAXSECTION 2 | 14 | #define DASM_MAXSECTION 2 |
| 15 | static const unsigned char build_actionlist[14099] = { | 15 | static const unsigned char build_actionlist[14100] = { |
| 16 | 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141, | 16 | 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141, |
| 17 | 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4, | 17 | 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4, |
| 18 | 252,247,195,237,15,132,244,13,248,14,129,252,243,239,252,247,195,237,15,133, | 18 | 252,247,195,237,15,132,244,13,248,14,129,252,243,239,252,247,195,237,15,133, |
| @@ -345,12 +345,12 @@ static const unsigned char build_actionlist[14099] = { | |||
| 345 | 244,125,248,117,184,237,252,233,244,55,248,119,184,237,248,55,139,108,36, | 345 | 244,125,248,117,184,237,252,233,244,55,248,119,184,237,248,55,139,108,36, |
| 346 | 24,139,90,252,252,137,92,36,28,137,149,233,141,68,194,252,248,141,136,233, | 346 | 24,139,90,252,252,137,92,36,28,137,149,233,141,68,194,252,248,141,136,233, |
| 347 | 137,133,233,139,66,252,248,59,141,233,15,135,244,251,137,252,239,252,255, | 347 | 137,133,233,139,66,252,248,59,141,233,15,135,244,251,137,252,239,252,255, |
| 348 | 144,233,139,149,233,133,192,15,133,244,69,248,1,255,139,133,233,41,208,193, | 348 | 144,233,139,149,233,133,192,15,143,244,69,248,1,255,139,141,233,41,209,193, |
| 349 | 232,3,131,192,1,139,106,252,248,57,90,252,252,15,133,244,248,139,157,233, | 349 | 252,233,3,133,192,141,65,1,139,106,252,248,15,133,244,248,139,157,233,139, |
| 350 | 139,11,15,182,252,233,15,182,205,131,195,4,65,252,255,36,252,238,248,2,137, | 350 | 11,15,182,252,233,15,182,205,131,195,4,65,252,255,36,252,238,248,2,137,209, |
| 351 | 209,252,247,195,237,15,133,244,249,15,182,107,252,253,72,252,247,213,141, | 351 | 252,247,195,237,15,133,244,249,15,182,107,252,253,72,252,247,213,141,20,252, |
| 352 | 20,252,234,252,233,244,27,248,3,137,221,131,229,252,248,41,252,234,252,233, | 352 | 234,252,233,244,27,248,3,137,221,131,229,252,248,41,252,234,252,233,244,27, |
| 353 | 244,27,248,5,190,237,137,252,239,232,251,1,0,139,149,233,252,233,244,1,248, | 353 | 248,5,190,237,137,252,239,232,251,1,0,139,149,233,49,192,252,233,244,1,248, |
| 354 | 66,93,72,137,108,36,8,139,108,36,24,137,92,36,28,137,149,233,255,141,68,194, | 354 | 66,93,72,137,108,36,8,139,108,36,24,137,92,36,28,137,149,233,255,141,68,194, |
| 355 | 252,248,137,252,239,137,133,233,232,251,1,19,139,149,233,139,133,233,41,208, | 355 | 252,248,137,252,239,137,133,233,232,251,1,19,139,149,233,139,133,233,41,208, |
| 356 | 193,232,3,131,192,1,72,139,108,36,8,85,195,248,136,255,65,15,182,134,233, | 356 | 193,232,3,131,192,1,72,139,108,36,8,85,195,248,136,255,65,15,182,134,233, |
| @@ -1344,88 +1344,88 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) | |||
| 1344 | } | 1344 | } |
| 1345 | dasm_put(Dst, 6799, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); | 1345 | dasm_put(Dst, 6799, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); |
| 1346 | dasm_put(Dst, 6877, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); | 1346 | dasm_put(Dst, 6877, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); |
| 1347 | dasm_put(Dst, 7003, Dt1(->top), Dt1(->base), Dt1(->top)); | 1347 | dasm_put(Dst, 7004, Dt1(->top), Dt1(->base), Dt1(->top)); |
| 1348 | #if LJ_HASJIT | 1348 | #if LJ_HASJIT |
| 1349 | dasm_put(Dst, 7042, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); | 1349 | dasm_put(Dst, 7043, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); |
| 1350 | #endif | 1350 | #endif |
| 1351 | dasm_put(Dst, 7075, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); | 1351 | dasm_put(Dst, 7076, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); |
| 1352 | dasm_put(Dst, 7129, Dt1(->base), Dt1(->base), GG_DISP2STATIC); | 1352 | dasm_put(Dst, 7130, Dt1(->base), Dt1(->base), GG_DISP2STATIC); |
| 1353 | #if LJ_HASJIT | 1353 | #if LJ_HASJIT |
| 1354 | dasm_put(Dst, 7196, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); | 1354 | dasm_put(Dst, 7197, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); |
| 1355 | #endif | 1355 | #endif |
| 1356 | dasm_put(Dst, 7243); | 1356 | dasm_put(Dst, 7244); |
| 1357 | #if LJ_HASJIT | 1357 | #if LJ_HASJIT |
| 1358 | dasm_put(Dst, 7070); | 1358 | dasm_put(Dst, 7071); |
| 1359 | #endif | 1359 | #endif |
| 1360 | dasm_put(Dst, 7250); | 1360 | dasm_put(Dst, 7251); |
| 1361 | #if LJ_HASJIT | 1361 | #if LJ_HASJIT |
| 1362 | dasm_put(Dst, 7253); | 1362 | dasm_put(Dst, 7254); |
| 1363 | #endif | 1363 | #endif |
| 1364 | dasm_put(Dst, 7263, Dt1(->base), Dt1(->top)); | 1364 | dasm_put(Dst, 7264, Dt1(->base), Dt1(->top)); |
| 1365 | #if LJ_HASJIT | 1365 | #if LJ_HASJIT |
| 1366 | dasm_put(Dst, 7296); | 1366 | dasm_put(Dst, 7297); |
| 1367 | #endif | 1367 | #endif |
| 1368 | dasm_put(Dst, 7301, Dt1(->base), Dt1(->top)); | 1368 | dasm_put(Dst, 7302, Dt1(->base), Dt1(->top)); |
| 1369 | #if LJ_HASJIT | 1369 | #if LJ_HASJIT |
| 1370 | dasm_put(Dst, 7332, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 16*8, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); | 1370 | dasm_put(Dst, 7333, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 16*8, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); |
| 1371 | #endif | 1371 | #endif |
| 1372 | dasm_put(Dst, 7571); | 1372 | dasm_put(Dst, 7572); |
| 1373 | #if LJ_HASJIT | 1373 | #if LJ_HASJIT |
| 1374 | dasm_put(Dst, 7574, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); | 1374 | dasm_put(Dst, 7575, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); |
| 1375 | #endif | 1375 | #endif |
| 1376 | dasm_put(Dst, 7674); | 1376 | dasm_put(Dst, 7675); |
| 1377 | if (!sse) { | 1377 | if (!sse) { |
| 1378 | dasm_put(Dst, 7677); | 1378 | dasm_put(Dst, 7678); |
| 1379 | } | 1379 | } |
| 1380 | dasm_put(Dst, 7722, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1380 | dasm_put(Dst, 7723, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1381 | if (!sse) { | 1381 | if (!sse) { |
| 1382 | dasm_put(Dst, 7808); | 1382 | dasm_put(Dst, 7809); |
| 1383 | } | 1383 | } |
| 1384 | dasm_put(Dst, 7853, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); | 1384 | dasm_put(Dst, 7854, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); |
| 1385 | if (!sse) { | 1385 | if (!sse) { |
| 1386 | dasm_put(Dst, 7939); | 1386 | dasm_put(Dst, 7940); |
| 1387 | } | 1387 | } |
| 1388 | dasm_put(Dst, 7978, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1388 | dasm_put(Dst, 7979, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1389 | if (sse) { | 1389 | if (sse) { |
| 1390 | dasm_put(Dst, 8067, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1390 | dasm_put(Dst, 8068, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1391 | } else { | 1391 | } else { |
| 1392 | dasm_put(Dst, 8181); | 1392 | dasm_put(Dst, 8182); |
| 1393 | } | 1393 | } |
| 1394 | dasm_put(Dst, 8228); | 1394 | dasm_put(Dst, 8229); |
| 1395 | if (!sse) { | 1395 | if (!sse) { |
| 1396 | } else { | 1396 | } else { |
| 1397 | dasm_put(Dst, 8305); | 1397 | dasm_put(Dst, 8306); |
| 1398 | } | 1398 | } |
| 1399 | dasm_put(Dst, 8308); | 1399 | dasm_put(Dst, 8309); |
| 1400 | dasm_put(Dst, 8393, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1400 | dasm_put(Dst, 8394, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1401 | dasm_put(Dst, 8494, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); | 1401 | dasm_put(Dst, 8495, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); |
| 1402 | dasm_put(Dst, 8668); | 1402 | dasm_put(Dst, 8669); |
| 1403 | #if LJ_HASJIT | 1403 | #if LJ_HASJIT |
| 1404 | if (sse) { | 1404 | if (sse) { |
| 1405 | dasm_put(Dst, 8709); | 1405 | dasm_put(Dst, 8710); |
| 1406 | dasm_put(Dst, 8779); | 1406 | dasm_put(Dst, 8780); |
| 1407 | dasm_put(Dst, 8851); | 1407 | dasm_put(Dst, 8852); |
| 1408 | } else { | 1408 | } else { |
| 1409 | dasm_put(Dst, 8903); | 1409 | dasm_put(Dst, 8904); |
| 1410 | dasm_put(Dst, 8995); | 1410 | dasm_put(Dst, 8996); |
| 1411 | } | 1411 | } |
| 1412 | dasm_put(Dst, 9041); | 1412 | dasm_put(Dst, 9042); |
| 1413 | #endif | 1413 | #endif |
| 1414 | dasm_put(Dst, 9045); | 1414 | dasm_put(Dst, 9046); |
| 1415 | if (sse) { | 1415 | if (sse) { |
| 1416 | dasm_put(Dst, 9048, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); | 1416 | dasm_put(Dst, 9049, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); |
| 1417 | dasm_put(Dst, 9133, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); | 1417 | dasm_put(Dst, 9134, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); |
| 1418 | } else { | 1418 | } else { |
| 1419 | dasm_put(Dst, 9261); | 1419 | dasm_put(Dst, 9262); |
| 1420 | dasm_put(Dst, 9344); | 1420 | dasm_put(Dst, 9345); |
| 1421 | if (cmov) { | 1421 | if (cmov) { |
| 1422 | dasm_put(Dst, 9399); | 1422 | dasm_put(Dst, 9400); |
| 1423 | } else { | 1423 | } else { |
| 1424 | dasm_put(Dst, 9418); | 1424 | dasm_put(Dst, 9419); |
| 1425 | } | 1425 | } |
| 1426 | dasm_put(Dst, 9041); | 1426 | dasm_put(Dst, 9042); |
| 1427 | } | 1427 | } |
| 1428 | dasm_put(Dst, 9459); | 1428 | dasm_put(Dst, 9460); |
| 1429 | } | 1429 | } |
| 1430 | 1430 | ||
| 1431 | /* Generate the code for a single instruction. */ | 1431 | /* Generate the code for a single instruction. */ |
| @@ -1441,595 +1441,595 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 1441 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ | 1441 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ |
| 1442 | 1442 | ||
| 1443 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: | 1443 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: |
| 1444 | dasm_put(Dst, 9481, LJ_TISNUM, LJ_TISNUM); | 1444 | dasm_put(Dst, 9482, LJ_TISNUM, LJ_TISNUM); |
| 1445 | if (sse) { | 1445 | if (sse) { |
| 1446 | dasm_put(Dst, 9502); | 1446 | dasm_put(Dst, 9503); |
| 1447 | } else { | 1447 | } else { |
| 1448 | dasm_put(Dst, 9517); | 1448 | dasm_put(Dst, 9518); |
| 1449 | if (cmov) { | 1449 | if (cmov) { |
| 1450 | dasm_put(Dst, 9527); | 1450 | dasm_put(Dst, 9528); |
| 1451 | } else { | 1451 | } else { |
| 1452 | dasm_put(Dst, 9533); | 1452 | dasm_put(Dst, 9534); |
| 1453 | } | 1453 | } |
| 1454 | } | 1454 | } |
| 1455 | switch (op) { | 1455 | switch (op) { |
| 1456 | case BC_ISLT: | 1456 | case BC_ISLT: |
| 1457 | dasm_put(Dst, 9540); | 1457 | dasm_put(Dst, 9541); |
| 1458 | break; | 1458 | break; |
| 1459 | case BC_ISGE: | 1459 | case BC_ISGE: |
| 1460 | dasm_put(Dst, 9339); | 1460 | dasm_put(Dst, 9340); |
| 1461 | break; | 1461 | break; |
| 1462 | case BC_ISLE: | 1462 | case BC_ISLE: |
| 1463 | dasm_put(Dst, 5947); | 1463 | dasm_put(Dst, 5947); |
| 1464 | break; | 1464 | break; |
| 1465 | case BC_ISGT: | 1465 | case BC_ISGT: |
| 1466 | dasm_put(Dst, 9545); | 1466 | dasm_put(Dst, 9546); |
| 1467 | break; | 1467 | break; |
| 1468 | default: break; /* Shut up GCC. */ | 1468 | default: break; /* Shut up GCC. */ |
| 1469 | } | 1469 | } |
| 1470 | dasm_put(Dst, 9550, -BCBIAS_J*4); | 1470 | dasm_put(Dst, 9551, -BCBIAS_J*4); |
| 1471 | break; | 1471 | break; |
| 1472 | 1472 | ||
| 1473 | case BC_ISEQV: case BC_ISNEV: | 1473 | case BC_ISEQV: case BC_ISNEV: |
| 1474 | vk = op == BC_ISEQV; | 1474 | vk = op == BC_ISEQV; |
| 1475 | dasm_put(Dst, 9585, LJ_TISNUM, LJ_TISNUM); | 1475 | dasm_put(Dst, 9586, LJ_TISNUM, LJ_TISNUM); |
| 1476 | if (sse) { | 1476 | if (sse) { |
| 1477 | dasm_put(Dst, 9611); | 1477 | dasm_put(Dst, 9612); |
| 1478 | } else { | 1478 | } else { |
| 1479 | dasm_put(Dst, 9623); | 1479 | dasm_put(Dst, 9624); |
| 1480 | if (cmov) { | 1480 | if (cmov) { |
| 1481 | dasm_put(Dst, 9527); | 1481 | dasm_put(Dst, 9528); |
| 1482 | } else { | 1482 | } else { |
| 1483 | dasm_put(Dst, 9533); | 1483 | dasm_put(Dst, 9534); |
| 1484 | } | 1484 | } |
| 1485 | } | 1485 | } |
| 1486 | iseqne_fp: | 1486 | iseqne_fp: |
| 1487 | if (vk) { | 1487 | if (vk) { |
| 1488 | dasm_put(Dst, 9630); | 1488 | dasm_put(Dst, 9631); |
| 1489 | } else { | 1489 | } else { |
| 1490 | dasm_put(Dst, 9639); | 1490 | dasm_put(Dst, 9640); |
| 1491 | } | 1491 | } |
| 1492 | iseqne_end: | 1492 | iseqne_end: |
| 1493 | if (vk) { | 1493 | if (vk) { |
| 1494 | dasm_put(Dst, 9648, -BCBIAS_J*4); | 1494 | dasm_put(Dst, 9649, -BCBIAS_J*4); |
| 1495 | } else { | 1495 | } else { |
| 1496 | dasm_put(Dst, 9663, -BCBIAS_J*4); | 1496 | dasm_put(Dst, 9664, -BCBIAS_J*4); |
| 1497 | } | 1497 | } |
| 1498 | dasm_put(Dst, 9564); | 1498 | dasm_put(Dst, 9565); |
| 1499 | if (op == BC_ISEQV || op == BC_ISNEV) { | 1499 | if (op == BC_ISEQV || op == BC_ISNEV) { |
| 1500 | dasm_put(Dst, 9678, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); | 1500 | dasm_put(Dst, 9679, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); |
| 1501 | if (vk) { | 1501 | if (vk) { |
| 1502 | dasm_put(Dst, 9736); | 1502 | dasm_put(Dst, 9737); |
| 1503 | } else { | 1503 | } else { |
| 1504 | dasm_put(Dst, 9740); | 1504 | dasm_put(Dst, 9741); |
| 1505 | } | 1505 | } |
| 1506 | dasm_put(Dst, 9746); | 1506 | dasm_put(Dst, 9747); |
| 1507 | } | 1507 | } |
| 1508 | break; | 1508 | break; |
| 1509 | case BC_ISEQS: case BC_ISNES: | 1509 | case BC_ISEQS: case BC_ISNES: |
| 1510 | vk = op == BC_ISEQS; | 1510 | vk = op == BC_ISEQS; |
| 1511 | dasm_put(Dst, 9751, LJ_TSTR); | 1511 | dasm_put(Dst, 9752, LJ_TSTR); |
| 1512 | iseqne_test: | 1512 | iseqne_test: |
| 1513 | if (vk) { | 1513 | if (vk) { |
| 1514 | dasm_put(Dst, 9634); | 1514 | dasm_put(Dst, 9635); |
| 1515 | } else { | 1515 | } else { |
| 1516 | dasm_put(Dst, 2836); | 1516 | dasm_put(Dst, 2836); |
| 1517 | } | 1517 | } |
| 1518 | goto iseqne_end; | 1518 | goto iseqne_end; |
| 1519 | case BC_ISEQN: case BC_ISNEN: | 1519 | case BC_ISEQN: case BC_ISNEN: |
| 1520 | vk = op == BC_ISEQN; | 1520 | vk = op == BC_ISEQN; |
| 1521 | dasm_put(Dst, 9776, LJ_TISNUM); | 1521 | dasm_put(Dst, 9777, LJ_TISNUM); |
| 1522 | if (sse) { | 1522 | if (sse) { |
| 1523 | dasm_put(Dst, 9790); | 1523 | dasm_put(Dst, 9791); |
| 1524 | } else { | 1524 | } else { |
| 1525 | dasm_put(Dst, 9803); | 1525 | dasm_put(Dst, 9804); |
| 1526 | if (cmov) { | 1526 | if (cmov) { |
| 1527 | dasm_put(Dst, 9527); | 1527 | dasm_put(Dst, 9528); |
| 1528 | } else { | 1528 | } else { |
| 1529 | dasm_put(Dst, 9533); | 1529 | dasm_put(Dst, 9534); |
| 1530 | } | 1530 | } |
| 1531 | } | 1531 | } |
| 1532 | goto iseqne_fp; | 1532 | goto iseqne_fp; |
| 1533 | case BC_ISEQP: case BC_ISNEP: | 1533 | case BC_ISEQP: case BC_ISNEP: |
| 1534 | vk = op == BC_ISEQP; | 1534 | vk = op == BC_ISEQP; |
| 1535 | dasm_put(Dst, 9811); | 1535 | dasm_put(Dst, 9812); |
| 1536 | goto iseqne_test; | 1536 | goto iseqne_test; |
| 1537 | 1537 | ||
| 1538 | /* -- Unary test and copy ops ------------------------------------------- */ | 1538 | /* -- Unary test and copy ops ------------------------------------------- */ |
| 1539 | 1539 | ||
| 1540 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | 1540 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: |
| 1541 | dasm_put(Dst, 9823, LJ_TISTRUECOND); | 1541 | dasm_put(Dst, 9824, LJ_TISTRUECOND); |
| 1542 | if (op == BC_IST || op == BC_ISTC) { | 1542 | if (op == BC_IST || op == BC_ISTC) { |
| 1543 | dasm_put(Dst, 9835); | 1543 | dasm_put(Dst, 9836); |
| 1544 | } else { | 1544 | } else { |
| 1545 | dasm_put(Dst, 9840); | 1545 | dasm_put(Dst, 9841); |
| 1546 | } | 1546 | } |
| 1547 | if (op == BC_ISTC || op == BC_ISFC) { | 1547 | if (op == BC_ISTC || op == BC_ISFC) { |
| 1548 | dasm_put(Dst, 9845); | 1548 | dasm_put(Dst, 9846); |
| 1549 | } | 1549 | } |
| 1550 | dasm_put(Dst, 9856, -BCBIAS_J*4); | 1550 | dasm_put(Dst, 9857, -BCBIAS_J*4); |
| 1551 | break; | 1551 | break; |
| 1552 | 1552 | ||
| 1553 | /* -- Unary ops --------------------------------------------------------- */ | 1553 | /* -- Unary ops --------------------------------------------------------- */ |
| 1554 | 1554 | ||
| 1555 | case BC_MOV: | 1555 | case BC_MOV: |
| 1556 | dasm_put(Dst, 9889); | 1556 | dasm_put(Dst, 9890); |
| 1557 | break; | 1557 | break; |
| 1558 | case BC_NOT: | 1558 | case BC_NOT: |
| 1559 | dasm_put(Dst, 9924, LJ_TISTRUECOND, LJ_TTRUE); | 1559 | dasm_put(Dst, 9925, LJ_TISTRUECOND, LJ_TTRUE); |
| 1560 | break; | 1560 | break; |
| 1561 | case BC_UNM: | 1561 | case BC_UNM: |
| 1562 | dasm_put(Dst, 9961, LJ_TISNUM); | 1562 | dasm_put(Dst, 9962, LJ_TISNUM); |
| 1563 | if (sse) { | 1563 | if (sse) { |
| 1564 | dasm_put(Dst, 9972, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); | 1564 | dasm_put(Dst, 9973, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); |
| 1565 | } else { | 1565 | } else { |
| 1566 | dasm_put(Dst, 9997); | 1566 | dasm_put(Dst, 9998); |
| 1567 | } | 1567 | } |
| 1568 | dasm_put(Dst, 9564); | 1568 | dasm_put(Dst, 9565); |
| 1569 | break; | 1569 | break; |
| 1570 | case BC_LEN: | 1570 | case BC_LEN: |
| 1571 | dasm_put(Dst, 10006, LJ_TSTR); | 1571 | dasm_put(Dst, 10007, LJ_TSTR); |
| 1572 | if (sse) { | 1572 | if (sse) { |
| 1573 | dasm_put(Dst, 10020, Dt5(->len)); | 1573 | dasm_put(Dst, 10021, Dt5(->len)); |
| 1574 | } else { | 1574 | } else { |
| 1575 | dasm_put(Dst, 10038, Dt5(->len)); | 1575 | dasm_put(Dst, 10039, Dt5(->len)); |
| 1576 | } | 1576 | } |
| 1577 | dasm_put(Dst, 10047, LJ_TTAB); | 1577 | dasm_put(Dst, 10048, LJ_TTAB); |
| 1578 | if (sse) { | 1578 | if (sse) { |
| 1579 | dasm_put(Dst, 10089); | 1579 | dasm_put(Dst, 10090); |
| 1580 | } else { | 1580 | } else { |
| 1581 | } | 1581 | } |
| 1582 | dasm_put(Dst, 10098); | 1582 | dasm_put(Dst, 10099); |
| 1583 | break; | 1583 | break; |
| 1584 | 1584 | ||
| 1585 | /* -- Binary ops -------------------------------------------------------- */ | 1585 | /* -- Binary ops -------------------------------------------------------- */ |
| 1586 | 1586 | ||
| 1587 | 1587 | ||
| 1588 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | 1588 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: |
| 1589 | dasm_put(Dst, 10108); | 1589 | dasm_put(Dst, 10109); |
| 1590 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1590 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1591 | switch (vk) { | 1591 | switch (vk) { |
| 1592 | case 0: | 1592 | case 0: |
| 1593 | dasm_put(Dst, 10116, LJ_TISNUM); | 1593 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1594 | if (sse) { | 1594 | if (sse) { |
| 1595 | dasm_put(Dst, 10128); | 1595 | dasm_put(Dst, 10129); |
| 1596 | } else { | 1596 | } else { |
| 1597 | dasm_put(Dst, 10143); | 1597 | dasm_put(Dst, 10144); |
| 1598 | } | 1598 | } |
| 1599 | break; | 1599 | break; |
| 1600 | case 1: | 1600 | case 1: |
| 1601 | dasm_put(Dst, 10152, LJ_TISNUM); | 1601 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1602 | if (sse) { | 1602 | if (sse) { |
| 1603 | dasm_put(Dst, 10164); | 1603 | dasm_put(Dst, 10165); |
| 1604 | } else { | 1604 | } else { |
| 1605 | dasm_put(Dst, 10179); | 1605 | dasm_put(Dst, 10180); |
| 1606 | } | 1606 | } |
| 1607 | break; | 1607 | break; |
| 1608 | default: | 1608 | default: |
| 1609 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1609 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1610 | if (sse) { | 1610 | if (sse) { |
| 1611 | dasm_put(Dst, 10210); | 1611 | dasm_put(Dst, 10211); |
| 1612 | } else { | 1612 | } else { |
| 1613 | dasm_put(Dst, 10224); | 1613 | dasm_put(Dst, 10225); |
| 1614 | } | 1614 | } |
| 1615 | break; | 1615 | break; |
| 1616 | } | 1616 | } |
| 1617 | if (sse) { | 1617 | if (sse) { |
| 1618 | dasm_put(Dst, 9990); | 1618 | dasm_put(Dst, 9991); |
| 1619 | } else { | 1619 | } else { |
| 1620 | dasm_put(Dst, 10002); | 1620 | dasm_put(Dst, 10003); |
| 1621 | } | 1621 | } |
| 1622 | dasm_put(Dst, 9564); | 1622 | dasm_put(Dst, 9565); |
| 1623 | break; | 1623 | break; |
| 1624 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | 1624 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: |
| 1625 | dasm_put(Dst, 10108); | 1625 | dasm_put(Dst, 10109); |
| 1626 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1626 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1627 | switch (vk) { | 1627 | switch (vk) { |
| 1628 | case 0: | 1628 | case 0: |
| 1629 | dasm_put(Dst, 10116, LJ_TISNUM); | 1629 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1630 | if (sse) { | 1630 | if (sse) { |
| 1631 | dasm_put(Dst, 10232); | 1631 | dasm_put(Dst, 10233); |
| 1632 | } else { | 1632 | } else { |
| 1633 | dasm_put(Dst, 10247); | 1633 | dasm_put(Dst, 10248); |
| 1634 | } | 1634 | } |
| 1635 | break; | 1635 | break; |
| 1636 | case 1: | 1636 | case 1: |
| 1637 | dasm_put(Dst, 10152, LJ_TISNUM); | 1637 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1638 | if (sse) { | 1638 | if (sse) { |
| 1639 | dasm_put(Dst, 10256); | 1639 | dasm_put(Dst, 10257); |
| 1640 | } else { | 1640 | } else { |
| 1641 | dasm_put(Dst, 10271); | 1641 | dasm_put(Dst, 10272); |
| 1642 | } | 1642 | } |
| 1643 | break; | 1643 | break; |
| 1644 | default: | 1644 | default: |
| 1645 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1645 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1646 | if (sse) { | 1646 | if (sse) { |
| 1647 | dasm_put(Dst, 10280); | 1647 | dasm_put(Dst, 10281); |
| 1648 | } else { | 1648 | } else { |
| 1649 | dasm_put(Dst, 10294); | 1649 | dasm_put(Dst, 10295); |
| 1650 | } | 1650 | } |
| 1651 | break; | 1651 | break; |
| 1652 | } | 1652 | } |
| 1653 | if (sse) { | 1653 | if (sse) { |
| 1654 | dasm_put(Dst, 9990); | 1654 | dasm_put(Dst, 9991); |
| 1655 | } else { | 1655 | } else { |
| 1656 | dasm_put(Dst, 10002); | 1656 | dasm_put(Dst, 10003); |
| 1657 | } | 1657 | } |
| 1658 | dasm_put(Dst, 9564); | 1658 | dasm_put(Dst, 9565); |
| 1659 | break; | 1659 | break; |
| 1660 | case BC_MULVN: case BC_MULNV: case BC_MULVV: | 1660 | case BC_MULVN: case BC_MULNV: case BC_MULVV: |
| 1661 | dasm_put(Dst, 10108); | 1661 | dasm_put(Dst, 10109); |
| 1662 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1662 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1663 | switch (vk) { | 1663 | switch (vk) { |
| 1664 | case 0: | 1664 | case 0: |
| 1665 | dasm_put(Dst, 10116, LJ_TISNUM); | 1665 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1666 | if (sse) { | 1666 | if (sse) { |
| 1667 | dasm_put(Dst, 10302); | 1667 | dasm_put(Dst, 10303); |
| 1668 | } else { | 1668 | } else { |
| 1669 | dasm_put(Dst, 10317); | 1669 | dasm_put(Dst, 10318); |
| 1670 | } | 1670 | } |
| 1671 | break; | 1671 | break; |
| 1672 | case 1: | 1672 | case 1: |
| 1673 | dasm_put(Dst, 10152, LJ_TISNUM); | 1673 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1674 | if (sse) { | 1674 | if (sse) { |
| 1675 | dasm_put(Dst, 10326); | 1675 | dasm_put(Dst, 10327); |
| 1676 | } else { | 1676 | } else { |
| 1677 | dasm_put(Dst, 10341); | 1677 | dasm_put(Dst, 10342); |
| 1678 | } | 1678 | } |
| 1679 | break; | 1679 | break; |
| 1680 | default: | 1680 | default: |
| 1681 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1681 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1682 | if (sse) { | 1682 | if (sse) { |
| 1683 | dasm_put(Dst, 10350); | 1683 | dasm_put(Dst, 10351); |
| 1684 | } else { | 1684 | } else { |
| 1685 | dasm_put(Dst, 10364); | 1685 | dasm_put(Dst, 10365); |
| 1686 | } | 1686 | } |
| 1687 | break; | 1687 | break; |
| 1688 | } | 1688 | } |
| 1689 | if (sse) { | 1689 | if (sse) { |
| 1690 | dasm_put(Dst, 9990); | 1690 | dasm_put(Dst, 9991); |
| 1691 | } else { | 1691 | } else { |
| 1692 | dasm_put(Dst, 10002); | 1692 | dasm_put(Dst, 10003); |
| 1693 | } | 1693 | } |
| 1694 | dasm_put(Dst, 9564); | 1694 | dasm_put(Dst, 9565); |
| 1695 | break; | 1695 | break; |
| 1696 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | 1696 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: |
| 1697 | dasm_put(Dst, 10108); | 1697 | dasm_put(Dst, 10109); |
| 1698 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1698 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1699 | switch (vk) { | 1699 | switch (vk) { |
| 1700 | case 0: | 1700 | case 0: |
| 1701 | dasm_put(Dst, 10116, LJ_TISNUM); | 1701 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1702 | if (sse) { | 1702 | if (sse) { |
| 1703 | dasm_put(Dst, 10372); | 1703 | dasm_put(Dst, 10373); |
| 1704 | } else { | 1704 | } else { |
| 1705 | dasm_put(Dst, 10387); | 1705 | dasm_put(Dst, 10388); |
| 1706 | } | 1706 | } |
| 1707 | break; | 1707 | break; |
| 1708 | case 1: | 1708 | case 1: |
| 1709 | dasm_put(Dst, 10152, LJ_TISNUM); | 1709 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1710 | if (sse) { | 1710 | if (sse) { |
| 1711 | dasm_put(Dst, 10396); | 1711 | dasm_put(Dst, 10397); |
| 1712 | } else { | 1712 | } else { |
| 1713 | dasm_put(Dst, 10411); | 1713 | dasm_put(Dst, 10412); |
| 1714 | } | 1714 | } |
| 1715 | break; | 1715 | break; |
| 1716 | default: | 1716 | default: |
| 1717 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1717 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1718 | if (sse) { | 1718 | if (sse) { |
| 1719 | dasm_put(Dst, 10420); | 1719 | dasm_put(Dst, 10421); |
| 1720 | } else { | 1720 | } else { |
| 1721 | dasm_put(Dst, 10434); | 1721 | dasm_put(Dst, 10435); |
| 1722 | } | 1722 | } |
| 1723 | break; | 1723 | break; |
| 1724 | } | 1724 | } |
| 1725 | if (sse) { | 1725 | if (sse) { |
| 1726 | dasm_put(Dst, 9990); | 1726 | dasm_put(Dst, 9991); |
| 1727 | } else { | 1727 | } else { |
| 1728 | dasm_put(Dst, 10002); | 1728 | dasm_put(Dst, 10003); |
| 1729 | } | 1729 | } |
| 1730 | dasm_put(Dst, 9564); | 1730 | dasm_put(Dst, 9565); |
| 1731 | break; | 1731 | break; |
| 1732 | case BC_MODVN: | 1732 | case BC_MODVN: |
| 1733 | dasm_put(Dst, 10108); | 1733 | dasm_put(Dst, 10109); |
| 1734 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1734 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1735 | switch (vk) { | 1735 | switch (vk) { |
| 1736 | case 0: | 1736 | case 0: |
| 1737 | dasm_put(Dst, 10116, LJ_TISNUM); | 1737 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1738 | if (sse) { | 1738 | if (sse) { |
| 1739 | dasm_put(Dst, 10442); | 1739 | dasm_put(Dst, 10443); |
| 1740 | } else { | 1740 | } else { |
| 1741 | dasm_put(Dst, 10457); | 1741 | dasm_put(Dst, 10458); |
| 1742 | } | 1742 | } |
| 1743 | break; | 1743 | break; |
| 1744 | case 1: | 1744 | case 1: |
| 1745 | dasm_put(Dst, 10152, LJ_TISNUM); | 1745 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1746 | if (sse) { | 1746 | if (sse) { |
| 1747 | dasm_put(Dst, 10466); | 1747 | dasm_put(Dst, 10467); |
| 1748 | } else { | 1748 | } else { |
| 1749 | dasm_put(Dst, 10481); | 1749 | dasm_put(Dst, 10482); |
| 1750 | } | 1750 | } |
| 1751 | break; | 1751 | break; |
| 1752 | default: | 1752 | default: |
| 1753 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1753 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1754 | if (sse) { | 1754 | if (sse) { |
| 1755 | dasm_put(Dst, 10490); | 1755 | dasm_put(Dst, 10491); |
| 1756 | } else { | 1756 | } else { |
| 1757 | dasm_put(Dst, 10504); | 1757 | dasm_put(Dst, 10505); |
| 1758 | } | 1758 | } |
| 1759 | break; | 1759 | break; |
| 1760 | } | 1760 | } |
| 1761 | dasm_put(Dst, 10512); | 1761 | dasm_put(Dst, 10513); |
| 1762 | if (sse) { | 1762 | if (sse) { |
| 1763 | dasm_put(Dst, 9990); | 1763 | dasm_put(Dst, 9991); |
| 1764 | } else { | 1764 | } else { |
| 1765 | dasm_put(Dst, 10002); | 1765 | dasm_put(Dst, 10003); |
| 1766 | } | 1766 | } |
| 1767 | dasm_put(Dst, 9564); | 1767 | dasm_put(Dst, 9565); |
| 1768 | break; | 1768 | break; |
| 1769 | case BC_MODNV: case BC_MODVV: | 1769 | case BC_MODNV: case BC_MODVV: |
| 1770 | dasm_put(Dst, 10108); | 1770 | dasm_put(Dst, 10109); |
| 1771 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1771 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1772 | switch (vk) { | 1772 | switch (vk) { |
| 1773 | case 0: | 1773 | case 0: |
| 1774 | dasm_put(Dst, 10116, LJ_TISNUM); | 1774 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1775 | if (sse) { | 1775 | if (sse) { |
| 1776 | dasm_put(Dst, 10442); | 1776 | dasm_put(Dst, 10443); |
| 1777 | } else { | 1777 | } else { |
| 1778 | dasm_put(Dst, 10457); | 1778 | dasm_put(Dst, 10458); |
| 1779 | } | 1779 | } |
| 1780 | break; | 1780 | break; |
| 1781 | case 1: | 1781 | case 1: |
| 1782 | dasm_put(Dst, 10152, LJ_TISNUM); | 1782 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1783 | if (sse) { | 1783 | if (sse) { |
| 1784 | dasm_put(Dst, 10466); | 1784 | dasm_put(Dst, 10467); |
| 1785 | } else { | 1785 | } else { |
| 1786 | dasm_put(Dst, 10481); | 1786 | dasm_put(Dst, 10482); |
| 1787 | } | 1787 | } |
| 1788 | break; | 1788 | break; |
| 1789 | default: | 1789 | default: |
| 1790 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1790 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1791 | if (sse) { | 1791 | if (sse) { |
| 1792 | dasm_put(Dst, 10490); | 1792 | dasm_put(Dst, 10491); |
| 1793 | } else { | 1793 | } else { |
| 1794 | dasm_put(Dst, 10504); | 1794 | dasm_put(Dst, 10505); |
| 1795 | } | 1795 | } |
| 1796 | break; | 1796 | break; |
| 1797 | } | 1797 | } |
| 1798 | dasm_put(Dst, 10518); | 1798 | dasm_put(Dst, 10519); |
| 1799 | break; | 1799 | break; |
| 1800 | case BC_POW: | 1800 | case BC_POW: |
| 1801 | dasm_put(Dst, 10108); | 1801 | dasm_put(Dst, 10109); |
| 1802 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1802 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1803 | switch (vk) { | 1803 | switch (vk) { |
| 1804 | case 0: | 1804 | case 0: |
| 1805 | dasm_put(Dst, 10116, LJ_TISNUM); | 1805 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1806 | if (sse) { | 1806 | if (sse) { |
| 1807 | dasm_put(Dst, 10442); | 1807 | dasm_put(Dst, 10443); |
| 1808 | } else { | 1808 | } else { |
| 1809 | dasm_put(Dst, 10457); | 1809 | dasm_put(Dst, 10458); |
| 1810 | } | 1810 | } |
| 1811 | break; | 1811 | break; |
| 1812 | case 1: | 1812 | case 1: |
| 1813 | dasm_put(Dst, 10152, LJ_TISNUM); | 1813 | dasm_put(Dst, 10153, LJ_TISNUM); |
| 1814 | if (sse) { | 1814 | if (sse) { |
| 1815 | dasm_put(Dst, 10466); | 1815 | dasm_put(Dst, 10467); |
| 1816 | } else { | 1816 | } else { |
| 1817 | dasm_put(Dst, 10481); | 1817 | dasm_put(Dst, 10482); |
| 1818 | } | 1818 | } |
| 1819 | break; | 1819 | break; |
| 1820 | default: | 1820 | default: |
| 1821 | dasm_put(Dst, 10188, LJ_TISNUM, LJ_TISNUM); | 1821 | dasm_put(Dst, 10189, LJ_TISNUM, LJ_TISNUM); |
| 1822 | if (sse) { | 1822 | if (sse) { |
| 1823 | dasm_put(Dst, 10490); | 1823 | dasm_put(Dst, 10491); |
| 1824 | } else { | 1824 | } else { |
| 1825 | dasm_put(Dst, 10504); | 1825 | dasm_put(Dst, 10505); |
| 1826 | } | 1826 | } |
| 1827 | break; | 1827 | break; |
| 1828 | } | 1828 | } |
| 1829 | dasm_put(Dst, 10523); | 1829 | dasm_put(Dst, 10524); |
| 1830 | if (sse) { | 1830 | if (sse) { |
| 1831 | dasm_put(Dst, 9990); | 1831 | dasm_put(Dst, 9991); |
| 1832 | } else { | 1832 | } else { |
| 1833 | dasm_put(Dst, 10002); | 1833 | dasm_put(Dst, 10003); |
| 1834 | } | 1834 | } |
| 1835 | dasm_put(Dst, 9564); | 1835 | dasm_put(Dst, 9565); |
| 1836 | break; | 1836 | break; |
| 1837 | 1837 | ||
| 1838 | case BC_CAT: | 1838 | case BC_CAT: |
| 1839 | dasm_put(Dst, 10527, Dt1(->base), Dt1(->base)); | 1839 | dasm_put(Dst, 10528, Dt1(->base), Dt1(->base)); |
| 1840 | break; | 1840 | break; |
| 1841 | 1841 | ||
| 1842 | /* -- Constant ops ------------------------------------------------------ */ | 1842 | /* -- Constant ops ------------------------------------------------------ */ |
| 1843 | 1843 | ||
| 1844 | case BC_KSTR: | 1844 | case BC_KSTR: |
| 1845 | dasm_put(Dst, 10618, LJ_TSTR); | 1845 | dasm_put(Dst, 10619, LJ_TSTR); |
| 1846 | break; | 1846 | break; |
| 1847 | case BC_KSHORT: | 1847 | case BC_KSHORT: |
| 1848 | if (sse) { | 1848 | if (sse) { |
| 1849 | dasm_put(Dst, 10655); | 1849 | dasm_put(Dst, 10656); |
| 1850 | } else { | 1850 | } else { |
| 1851 | dasm_put(Dst, 10670); | 1851 | dasm_put(Dst, 10671); |
| 1852 | } | 1852 | } |
| 1853 | dasm_put(Dst, 9564); | 1853 | dasm_put(Dst, 9565); |
| 1854 | break; | 1854 | break; |
| 1855 | case BC_KNUM: | 1855 | case BC_KNUM: |
| 1856 | if (sse) { | 1856 | if (sse) { |
| 1857 | dasm_put(Dst, 10678); | 1857 | dasm_put(Dst, 10679); |
| 1858 | } else { | 1858 | } else { |
| 1859 | dasm_put(Dst, 10692); | 1859 | dasm_put(Dst, 10693); |
| 1860 | } | 1860 | } |
| 1861 | dasm_put(Dst, 9564); | 1861 | dasm_put(Dst, 9565); |
| 1862 | break; | 1862 | break; |
| 1863 | case BC_KPRI: | 1863 | case BC_KPRI: |
| 1864 | dasm_put(Dst, 10700); | 1864 | dasm_put(Dst, 10701); |
| 1865 | break; | 1865 | break; |
| 1866 | case BC_KNIL: | 1866 | case BC_KNIL: |
| 1867 | dasm_put(Dst, 10729, LJ_TNIL); | 1867 | dasm_put(Dst, 10730, LJ_TNIL); |
| 1868 | break; | 1868 | break; |
| 1869 | 1869 | ||
| 1870 | /* -- Upvalue and function ops ------------------------------------------ */ | 1870 | /* -- Upvalue and function ops ------------------------------------------ */ |
| 1871 | 1871 | ||
| 1872 | case BC_UGET: | 1872 | case BC_UGET: |
| 1873 | dasm_put(Dst, 10777, offsetof(GCfuncL, uvptr), DtA(->v)); | 1873 | dasm_put(Dst, 10778, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1874 | break; | 1874 | break; |
| 1875 | case BC_USETV: | 1875 | case BC_USETV: |
| 1876 | #define TV2MARKOFS \ | 1876 | #define TV2MARKOFS \ |
| 1877 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) | 1877 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) |
| 1878 | dasm_put(Dst, 10823, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); | 1878 | dasm_put(Dst, 10824, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); |
| 1879 | dasm_put(Dst, 10919); | 1879 | dasm_put(Dst, 10920); |
| 1880 | break; | 1880 | break; |
| 1881 | #undef TV2MARKOFS | 1881 | #undef TV2MARKOFS |
| 1882 | case BC_USETS: | 1882 | case BC_USETS: |
| 1883 | dasm_put(Dst, 10931, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); | 1883 | dasm_put(Dst, 10932, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); |
| 1884 | break; | 1884 | break; |
| 1885 | case BC_USETN: | 1885 | case BC_USETN: |
| 1886 | dasm_put(Dst, 11027); | 1886 | dasm_put(Dst, 11028); |
| 1887 | if (sse) { | 1887 | if (sse) { |
| 1888 | dasm_put(Dst, 11032); | 1888 | dasm_put(Dst, 11033); |
| 1889 | } else { | 1889 | } else { |
| 1890 | dasm_put(Dst, 9806); | 1890 | dasm_put(Dst, 9807); |
| 1891 | } | 1891 | } |
| 1892 | dasm_put(Dst, 11040, offsetof(GCfuncL, uvptr), DtA(->v)); | 1892 | dasm_put(Dst, 11041, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1893 | if (sse) { | 1893 | if (sse) { |
| 1894 | dasm_put(Dst, 11049); | 1894 | dasm_put(Dst, 11050); |
| 1895 | } else { | 1895 | } else { |
| 1896 | dasm_put(Dst, 11055); | 1896 | dasm_put(Dst, 11056); |
| 1897 | } | 1897 | } |
| 1898 | dasm_put(Dst, 9564); | 1898 | dasm_put(Dst, 9565); |
| 1899 | break; | 1899 | break; |
| 1900 | case BC_USETP: | 1900 | case BC_USETP: |
| 1901 | dasm_put(Dst, 11058, offsetof(GCfuncL, uvptr), DtA(->v)); | 1901 | dasm_put(Dst, 11059, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1902 | break; | 1902 | break; |
| 1903 | case BC_UCLO: | 1903 | case BC_UCLO: |
| 1904 | dasm_put(Dst, 11098, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); | 1904 | dasm_put(Dst, 11099, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); |
| 1905 | break; | 1905 | break; |
| 1906 | 1906 | ||
| 1907 | case BC_FNEW: | 1907 | case BC_FNEW: |
| 1908 | dasm_put(Dst, 11154, Dt1(->base), Dt1(->base), LJ_TFUNC); | 1908 | dasm_put(Dst, 11155, Dt1(->base), Dt1(->base), LJ_TFUNC); |
| 1909 | break; | 1909 | break; |
| 1910 | 1910 | ||
| 1911 | /* -- Table ops --------------------------------------------------------- */ | 1911 | /* -- Table ops --------------------------------------------------------- */ |
| 1912 | 1912 | ||
| 1913 | case BC_TNEW: | 1913 | case BC_TNEW: |
| 1914 | dasm_put(Dst, 11221, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); | 1914 | dasm_put(Dst, 11222, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); |
| 1915 | break; | 1915 | break; |
| 1916 | case BC_TDUP: | 1916 | case BC_TDUP: |
| 1917 | dasm_put(Dst, 11345, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); | 1917 | dasm_put(Dst, 11346, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); |
| 1918 | break; | 1918 | break; |
| 1919 | 1919 | ||
| 1920 | case BC_GGET: | 1920 | case BC_GGET: |
| 1921 | dasm_put(Dst, 11444, Dt7(->env)); | 1921 | dasm_put(Dst, 11445, Dt7(->env)); |
| 1922 | break; | 1922 | break; |
| 1923 | case BC_GSET: | 1923 | case BC_GSET: |
| 1924 | dasm_put(Dst, 11464, Dt7(->env)); | 1924 | dasm_put(Dst, 11465, Dt7(->env)); |
| 1925 | break; | 1925 | break; |
| 1926 | 1926 | ||
| 1927 | case BC_TGETV: | 1927 | case BC_TGETV: |
| 1928 | dasm_put(Dst, 11484, LJ_TTAB, LJ_TISNUM); | 1928 | dasm_put(Dst, 11485, LJ_TTAB, LJ_TISNUM); |
| 1929 | if (sse) { | 1929 | if (sse) { |
| 1930 | dasm_put(Dst, 11517); | 1930 | dasm_put(Dst, 11518); |
| 1931 | } else { | 1931 | } else { |
| 1932 | } | 1932 | } |
| 1933 | dasm_put(Dst, 11538, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1933 | dasm_put(Dst, 11539, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1934 | dasm_put(Dst, 11632, LJ_TSTR); | 1934 | dasm_put(Dst, 11633, LJ_TSTR); |
| 1935 | break; | 1935 | break; |
| 1936 | case BC_TGETS: | 1936 | case BC_TGETS: |
| 1937 | dasm_put(Dst, 11650, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 1937 | dasm_put(Dst, 11651, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 1938 | dasm_put(Dst, 11736, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1938 | dasm_put(Dst, 11737, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1939 | break; | 1939 | break; |
| 1940 | case BC_TGETB: | 1940 | case BC_TGETB: |
| 1941 | dasm_put(Dst, 11809, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1941 | dasm_put(Dst, 11810, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1942 | dasm_put(Dst, 10098); | 1942 | dasm_put(Dst, 10099); |
| 1943 | break; | 1943 | break; |
| 1944 | 1944 | ||
| 1945 | case BC_TSETV: | 1945 | case BC_TSETV: |
| 1946 | dasm_put(Dst, 11910, LJ_TTAB, LJ_TISNUM); | 1946 | dasm_put(Dst, 11911, LJ_TTAB, LJ_TISNUM); |
| 1947 | if (sse) { | 1947 | if (sse) { |
| 1948 | dasm_put(Dst, 11517); | 1948 | dasm_put(Dst, 11518); |
| 1949 | } else { | 1949 | } else { |
| 1950 | } | 1950 | } |
| 1951 | dasm_put(Dst, 11943, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); | 1951 | dasm_put(Dst, 11944, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); |
| 1952 | dasm_put(Dst, 12028, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1952 | dasm_put(Dst, 12029, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1953 | break; | 1953 | break; |
| 1954 | case BC_TSETS: | 1954 | case BC_TSETS: |
| 1955 | dasm_put(Dst, 12092, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 1955 | dasm_put(Dst, 12093, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 1956 | dasm_put(Dst, 12169, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); | 1956 | dasm_put(Dst, 12170, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); |
| 1957 | dasm_put(Dst, 12261, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1957 | dasm_put(Dst, 12262, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1958 | break; | 1958 | break; |
| 1959 | case BC_TSETB: | 1959 | case BC_TSETB: |
| 1960 | dasm_put(Dst, 12353, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); | 1960 | dasm_put(Dst, 12354, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); |
| 1961 | dasm_put(Dst, 12453, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1961 | dasm_put(Dst, 12454, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1962 | break; | 1962 | break; |
| 1963 | 1963 | ||
| 1964 | case BC_TSETM: | 1964 | case BC_TSETM: |
| 1965 | dasm_put(Dst, 12501); | 1965 | dasm_put(Dst, 12502); |
| 1966 | if (sse) { | 1966 | if (sse) { |
| 1967 | dasm_put(Dst, 12506); | 1967 | dasm_put(Dst, 12507); |
| 1968 | } else { | 1968 | } else { |
| 1969 | } | 1969 | } |
| 1970 | dasm_put(Dst, 12514, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); | 1970 | dasm_put(Dst, 12515, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); |
| 1971 | dasm_put(Dst, 12662, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1971 | dasm_put(Dst, 12663, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1972 | break; | 1972 | break; |
| 1973 | 1973 | ||
| 1974 | /* -- Calls and vararg handling ----------------------------------------- */ | 1974 | /* -- Calls and vararg handling ----------------------------------------- */ |
| 1975 | 1975 | ||
| 1976 | case BC_CALL: case BC_CALLM: | 1976 | case BC_CALL: case BC_CALLM: |
| 1977 | dasm_put(Dst, 10112); | 1977 | dasm_put(Dst, 10113); |
| 1978 | if (op == BC_CALLM) { | 1978 | if (op == BC_CALLM) { |
| 1979 | dasm_put(Dst, 12682); | 1979 | dasm_put(Dst, 12683); |
| 1980 | } | 1980 | } |
| 1981 | dasm_put(Dst, 12687, LJ_TFUNC, Dt7(->pc)); | 1981 | dasm_put(Dst, 12688, LJ_TFUNC, Dt7(->pc)); |
| 1982 | break; | 1982 | break; |
| 1983 | 1983 | ||
| 1984 | case BC_CALLMT: | 1984 | case BC_CALLMT: |
| 1985 | dasm_put(Dst, 12682); | 1985 | dasm_put(Dst, 12683); |
| 1986 | break; | 1986 | break; |
| 1987 | case BC_CALLT: | 1987 | case BC_CALLT: |
| 1988 | dasm_put(Dst, 12730, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); | 1988 | dasm_put(Dst, 12731, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); |
| 1989 | dasm_put(Dst, 12854, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); | 1989 | dasm_put(Dst, 12855, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); |
| 1990 | break; | 1990 | break; |
| 1991 | 1991 | ||
| 1992 | case BC_ITERC: | 1992 | case BC_ITERC: |
| 1993 | dasm_put(Dst, 12928, LJ_TFUNC, 2+1, Dt7(->pc)); | 1993 | dasm_put(Dst, 12929, LJ_TFUNC, 2+1, Dt7(->pc)); |
| 1994 | break; | 1994 | break; |
| 1995 | 1995 | ||
| 1996 | case BC_VARG: | 1996 | case BC_VARG: |
| 1997 | dasm_put(Dst, 13010, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); | 1997 | dasm_put(Dst, 13011, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); |
| 1998 | dasm_put(Dst, 13164, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); | 1998 | dasm_put(Dst, 13165, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); |
| 1999 | break; | 1999 | break; |
| 2000 | 2000 | ||
| 2001 | /* -- Returns ----------------------------------------------------------- */ | 2001 | /* -- Returns ----------------------------------------------------------- */ |
| 2002 | 2002 | ||
| 2003 | case BC_RETM: | 2003 | case BC_RETM: |
| 2004 | dasm_put(Dst, 12682); | 2004 | dasm_put(Dst, 12683); |
| 2005 | break; | 2005 | break; |
| 2006 | 2006 | ||
| 2007 | case BC_RET: case BC_RET0: case BC_RET1: | 2007 | case BC_RET: case BC_RET0: case BC_RET1: |
| 2008 | if (op != BC_RET0) { | 2008 | if (op != BC_RET0) { |
| 2009 | dasm_put(Dst, 13269); | 2009 | dasm_put(Dst, 13270); |
| 2010 | } | 2010 | } |
| 2011 | dasm_put(Dst, 13273, FRAME_TYPE); | 2011 | dasm_put(Dst, 13274, FRAME_TYPE); |
| 2012 | switch (op) { | 2012 | switch (op) { |
| 2013 | case BC_RET: | 2013 | case BC_RET: |
| 2014 | dasm_put(Dst, 13292); | 2014 | dasm_put(Dst, 13293); |
| 2015 | break; | 2015 | break; |
| 2016 | case BC_RET1: | 2016 | case BC_RET1: |
| 2017 | dasm_put(Dst, 13356); | 2017 | dasm_put(Dst, 13357); |
| 2018 | /* fallthrough */ | 2018 | /* fallthrough */ |
| 2019 | case BC_RET0: | 2019 | case BC_RET0: |
| 2020 | dasm_put(Dst, 13372); | 2020 | dasm_put(Dst, 13373); |
| 2021 | default: | 2021 | default: |
| 2022 | break; | 2022 | break; |
| 2023 | } | 2023 | } |
| 2024 | dasm_put(Dst, 13383, Dt7(->pc), PC2PROTO(k)); | 2024 | dasm_put(Dst, 13384, Dt7(->pc), PC2PROTO(k)); |
| 2025 | if (op == BC_RET) { | 2025 | if (op == BC_RET) { |
| 2026 | dasm_put(Dst, 13431, LJ_TNIL); | 2026 | dasm_put(Dst, 13432, LJ_TNIL); |
| 2027 | } else { | 2027 | } else { |
| 2028 | dasm_put(Dst, 13442, LJ_TNIL); | 2028 | dasm_put(Dst, 13443, LJ_TNIL); |
| 2029 | } | 2029 | } |
| 2030 | dasm_put(Dst, 13449, -FRAME_VARG, FRAME_TYPEP); | 2030 | dasm_put(Dst, 13450, -FRAME_VARG, FRAME_TYPEP); |
| 2031 | if (op != BC_RET0) { | 2031 | if (op != BC_RET0) { |
| 2032 | dasm_put(Dst, 13473); | 2032 | dasm_put(Dst, 13474); |
| 2033 | } | 2033 | } |
| 2034 | dasm_put(Dst, 4599); | 2034 | dasm_put(Dst, 4599); |
| 2035 | break; | 2035 | break; |
| @@ -2039,7 +2039,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2039 | 2039 | ||
| 2040 | case BC_FORL: | 2040 | case BC_FORL: |
| 2041 | #if LJ_HASJIT | 2041 | #if LJ_HASJIT |
| 2042 | dasm_put(Dst, 13477, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2042 | dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2043 | #endif | 2043 | #endif |
| 2044 | break; | 2044 | break; |
| 2045 | 2045 | ||
| @@ -2051,57 +2051,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2051 | case BC_FORI: | 2051 | case BC_FORI: |
| 2052 | case BC_IFORL: | 2052 | case BC_IFORL: |
| 2053 | vk = (op == BC_IFORL || op == BC_JFORL); | 2053 | vk = (op == BC_IFORL || op == BC_JFORL); |
| 2054 | dasm_put(Dst, 13498); | 2054 | dasm_put(Dst, 13499); |
| 2055 | if (!vk) { | 2055 | if (!vk) { |
| 2056 | dasm_put(Dst, 13502, LJ_TISNUM, LJ_TISNUM); | 2056 | dasm_put(Dst, 13503, LJ_TISNUM, LJ_TISNUM); |
| 2057 | } | 2057 | } |
| 2058 | dasm_put(Dst, 13521); | 2058 | dasm_put(Dst, 13522); |
| 2059 | if (!vk) { | 2059 | if (!vk) { |
| 2060 | dasm_put(Dst, 13525, LJ_TISNUM); | 2060 | dasm_put(Dst, 13526, LJ_TISNUM); |
| 2061 | } | 2061 | } |
| 2062 | if (sse) { | 2062 | if (sse) { |
| 2063 | dasm_put(Dst, 13534); | 2063 | dasm_put(Dst, 13535); |
| 2064 | if (vk) { | 2064 | if (vk) { |
| 2065 | dasm_put(Dst, 13546); | 2065 | dasm_put(Dst, 13547); |
| 2066 | } else { | 2066 | } else { |
| 2067 | dasm_put(Dst, 13565); | 2067 | dasm_put(Dst, 13566); |
| 2068 | } | 2068 | } |
| 2069 | dasm_put(Dst, 13570); | 2069 | dasm_put(Dst, 13571); |
| 2070 | } else { | 2070 | } else { |
| 2071 | dasm_put(Dst, 13583); | 2071 | dasm_put(Dst, 13584); |
| 2072 | if (vk) { | 2072 | if (vk) { |
| 2073 | dasm_put(Dst, 13589); | 2073 | dasm_put(Dst, 13590); |
| 2074 | } else { | 2074 | } else { |
| 2075 | dasm_put(Dst, 13605); | 2075 | dasm_put(Dst, 13606); |
| 2076 | } | 2076 | } |
| 2077 | dasm_put(Dst, 13613); | 2077 | dasm_put(Dst, 13614); |
| 2078 | if (cmov) { | 2078 | if (cmov) { |
| 2079 | dasm_put(Dst, 9527); | 2079 | dasm_put(Dst, 9528); |
| 2080 | } else { | 2080 | } else { |
| 2081 | dasm_put(Dst, 9533); | 2081 | dasm_put(Dst, 9534); |
| 2082 | } | 2082 | } |
| 2083 | if (!cmov) { | 2083 | if (!cmov) { |
| 2084 | dasm_put(Dst, 13618); | 2084 | dasm_put(Dst, 13619); |
| 2085 | } | 2085 | } |
| 2086 | } | 2086 | } |
| 2087 | if (op == BC_FORI) { | 2087 | if (op == BC_FORI) { |
| 2088 | dasm_put(Dst, 13624, -BCBIAS_J*4); | 2088 | dasm_put(Dst, 13625, -BCBIAS_J*4); |
| 2089 | } else if (op == BC_JFORI) { | 2089 | } else if (op == BC_JFORI) { |
| 2090 | dasm_put(Dst, 13634, -BCBIAS_J*4, BC_JLOOP); | 2090 | dasm_put(Dst, 13635, -BCBIAS_J*4, BC_JLOOP); |
| 2091 | } else if (op == BC_IFORL) { | 2091 | } else if (op == BC_IFORL) { |
| 2092 | dasm_put(Dst, 13648, -BCBIAS_J*4); | 2092 | dasm_put(Dst, 13649, -BCBIAS_J*4); |
| 2093 | } else { | 2093 | } else { |
| 2094 | dasm_put(Dst, 13644, BC_JLOOP); | 2094 | dasm_put(Dst, 13645, BC_JLOOP); |
| 2095 | } | 2095 | } |
| 2096 | dasm_put(Dst, 9562); | 2096 | dasm_put(Dst, 9563); |
| 2097 | if (sse) { | 2097 | if (sse) { |
| 2098 | dasm_put(Dst, 13658); | 2098 | dasm_put(Dst, 13659); |
| 2099 | } | 2099 | } |
| 2100 | break; | 2100 | break; |
| 2101 | 2101 | ||
| 2102 | case BC_ITERL: | 2102 | case BC_ITERL: |
| 2103 | #if LJ_HASJIT | 2103 | #if LJ_HASJIT |
| 2104 | dasm_put(Dst, 13477, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2104 | dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2105 | #endif | 2105 | #endif |
| 2106 | break; | 2106 | break; |
| 2107 | 2107 | ||
| @@ -2110,33 +2110,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2110 | break; | 2110 | break; |
| 2111 | #endif | 2111 | #endif |
| 2112 | case BC_IITERL: | 2112 | case BC_IITERL: |
| 2113 | dasm_put(Dst, 13669, LJ_TNIL); | 2113 | dasm_put(Dst, 13670, LJ_TNIL); |
| 2114 | if (op == BC_JITERL) { | 2114 | if (op == BC_JITERL) { |
| 2115 | dasm_put(Dst, 13684, BC_JLOOP); | 2115 | dasm_put(Dst, 13685, BC_JLOOP); |
| 2116 | } else { | 2116 | } else { |
| 2117 | dasm_put(Dst, 13698, -BCBIAS_J*4); | 2117 | dasm_put(Dst, 13699, -BCBIAS_J*4); |
| 2118 | } | 2118 | } |
| 2119 | dasm_put(Dst, 9866); | 2119 | dasm_put(Dst, 9867); |
| 2120 | break; | 2120 | break; |
| 2121 | 2121 | ||
| 2122 | case BC_LOOP: | 2122 | case BC_LOOP: |
| 2123 | #if LJ_HASJIT | 2123 | #if LJ_HASJIT |
| 2124 | dasm_put(Dst, 13477, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2124 | dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2125 | #endif | 2125 | #endif |
| 2126 | break; | 2126 | break; |
| 2127 | 2127 | ||
| 2128 | case BC_ILOOP: | 2128 | case BC_ILOOP: |
| 2129 | dasm_put(Dst, 9564); | 2129 | dasm_put(Dst, 9565); |
| 2130 | break; | 2130 | break; |
| 2131 | 2131 | ||
| 2132 | case BC_JLOOP: | 2132 | case BC_JLOOP: |
| 2133 | #if LJ_HASJIT | 2133 | #if LJ_HASJIT |
| 2134 | dasm_put(Dst, 13714, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); | 2134 | dasm_put(Dst, 13715, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); |
| 2135 | #endif | 2135 | #endif |
| 2136 | break; | 2136 | break; |
| 2137 | 2137 | ||
| 2138 | case BC_JMP: | 2138 | case BC_JMP: |
| 2139 | dasm_put(Dst, 13755, -BCBIAS_J*4); | 2139 | dasm_put(Dst, 13756, -BCBIAS_J*4); |
| 2140 | break; | 2140 | break; |
| 2141 | 2141 | ||
| 2142 | /* -- Function headers -------------------------------------------------- */ | 2142 | /* -- Function headers -------------------------------------------------- */ |
| @@ -2150,7 +2150,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2150 | 2150 | ||
| 2151 | case BC_FUNCF: | 2151 | case BC_FUNCF: |
| 2152 | #if LJ_HASJIT | 2152 | #if LJ_HASJIT |
| 2153 | dasm_put(Dst, 13781, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2153 | dasm_put(Dst, 13782, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2154 | #endif | 2154 | #endif |
| 2155 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 2155 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
| 2156 | break; | 2156 | break; |
| @@ -2160,47 +2160,47 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2160 | break; | 2160 | break; |
| 2161 | #endif | 2161 | #endif |
| 2162 | case BC_IFUNCF: | 2162 | case BC_IFUNCF: |
| 2163 | dasm_put(Dst, 13802, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); | 2163 | dasm_put(Dst, 13803, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); |
| 2164 | if (op == BC_JFUNCF) { | 2164 | if (op == BC_JFUNCF) { |
| 2165 | dasm_put(Dst, 13833, BC_JLOOP); | 2165 | dasm_put(Dst, 13834, BC_JLOOP); |
| 2166 | } else { | 2166 | } else { |
| 2167 | dasm_put(Dst, 9564); | 2167 | dasm_put(Dst, 9565); |
| 2168 | } | 2168 | } |
| 2169 | dasm_put(Dst, 13842, LJ_TNIL); | 2169 | dasm_put(Dst, 13843, LJ_TNIL); |
| 2170 | break; | 2170 | break; |
| 2171 | 2171 | ||
| 2172 | case BC_JFUNCV: | 2172 | case BC_JFUNCV: |
| 2173 | #if !LJ_HASJIT | 2173 | #if !LJ_HASJIT |
| 2174 | break; | 2174 | break; |
| 2175 | #endif | 2175 | #endif |
| 2176 | dasm_put(Dst, 9043); | 2176 | dasm_put(Dst, 9044); |
| 2177 | break; /* NYI: compiled vararg functions. */ | 2177 | break; /* NYI: compiled vararg functions. */ |
| 2178 | 2178 | ||
| 2179 | case BC_IFUNCV: | 2179 | case BC_IFUNCV: |
| 2180 | dasm_put(Dst, 13864, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); | 2180 | dasm_put(Dst, 13865, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); |
| 2181 | if (op == BC_JFUNCV) { | 2181 | if (op == BC_JFUNCV) { |
| 2182 | dasm_put(Dst, 13833, BC_JLOOP); | 2182 | dasm_put(Dst, 13834, BC_JLOOP); |
| 2183 | } else { | 2183 | } else { |
| 2184 | dasm_put(Dst, 13961, -4+PC2PROTO(k)); | 2184 | dasm_put(Dst, 13962, -4+PC2PROTO(k)); |
| 2185 | } | 2185 | } |
| 2186 | dasm_put(Dst, 13986, LJ_TNIL); | 2186 | dasm_put(Dst, 13987, LJ_TNIL); |
| 2187 | break; | 2187 | break; |
| 2188 | 2188 | ||
| 2189 | case BC_FUNCC: | 2189 | case BC_FUNCC: |
| 2190 | case BC_FUNCCW: | 2190 | case BC_FUNCCW: |
| 2191 | dasm_put(Dst, 14008, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); | 2191 | dasm_put(Dst, 14009, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); |
| 2192 | if (op == BC_FUNCC) { | 2192 | if (op == BC_FUNCC) { |
| 2193 | dasm_put(Dst, 14038); | 2193 | dasm_put(Dst, 14039); |
| 2194 | } else { | 2194 | } else { |
| 2195 | dasm_put(Dst, 14042); | 2195 | dasm_put(Dst, 14043); |
| 2196 | } | 2196 | } |
| 2197 | dasm_put(Dst, 14050, DISPATCH_GL(vmstate), ~LJ_VMST_C); | 2197 | dasm_put(Dst, 14051, DISPATCH_GL(vmstate), ~LJ_VMST_C); |
| 2198 | if (op == BC_FUNCC) { | 2198 | if (op == BC_FUNCC) { |
| 2199 | dasm_put(Dst, 14060); | 2199 | dasm_put(Dst, 14061); |
| 2200 | } else { | 2200 | } else { |
| 2201 | dasm_put(Dst, 14065, DISPATCH_GL(wrapf)); | 2201 | dasm_put(Dst, 14066, DISPATCH_GL(wrapf)); |
| 2202 | } | 2202 | } |
| 2203 | dasm_put(Dst, 14071, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); | 2203 | dasm_put(Dst, 14072, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); |
| 2204 | break; | 2204 | break; |
| 2205 | 2205 | ||
| 2206 | /* ---------------------------------------------------------------------- */ | 2206 | /* ---------------------------------------------------------------------- */ |
| @@ -2228,7 +2228,7 @@ static int build_backend(BuildCtx *ctx) | |||
| 2228 | 2228 | ||
| 2229 | build_subroutines(ctx, cmov, sse); | 2229 | build_subroutines(ctx, cmov, sse); |
| 2230 | 2230 | ||
| 2231 | dasm_put(Dst, 14097); | 2231 | dasm_put(Dst, 14098); |
| 2232 | for (op = 0; op < BC__MAX; op++) | 2232 | for (op = 0; op < BC__MAX; op++) |
| 2233 | build_ins(ctx, (BCOp)op, op, cmov, sse); | 2233 | build_ins(ctx, (BCOp)op, op, cmov, sse); |
| 2234 | 2234 | ||
diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h index 9198454a..5e70ad88 100644 --- a/src/buildvm_x64win.h +++ b/src/buildvm_x64win.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #define DASM_SECTION_CODE_OP 0 | 12 | #define DASM_SECTION_CODE_OP 0 |
| 13 | #define DASM_SECTION_CODE_SUB 1 | 13 | #define DASM_SECTION_CODE_SUB 1 |
| 14 | #define DASM_MAXSECTION 2 | 14 | #define DASM_MAXSECTION 2 |
| 15 | static const unsigned char build_actionlist[14046] = { | 15 | static const unsigned char build_actionlist[14047] = { |
| 16 | 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72, | 16 | 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72, |
| 17 | 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68, | 17 | 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68, |
| 18 | 36,84,252,247,198,237,15,132,244,13,248,14,129,252,246,239,252,247,198,237, | 18 | 36,84,252,247,198,237,15,132,244,13,248,14,129,252,246,239,252,247,198,237, |
| @@ -346,12 +346,12 @@ static const unsigned char build_actionlist[14046] = { | |||
| 346 | 233,244,55,248,119,184,237,248,55,139,108,36,96,139,114,252,252,137,116,36, | 346 | 233,244,55,248,119,184,237,248,55,139,108,36,96,139,114,252,252,137,116,36, |
| 347 | 100,137,149,233,141,68,194,252,248,141,136,233,137,133,233,139,66,252,248, | 347 | 100,137,149,233,141,68,194,252,248,141,136,233,137,133,233,139,66,252,248, |
| 348 | 59,141,233,15,135,244,251,137,252,233,252,255,144,233,139,149,233,133,192, | 348 | 59,141,233,15,135,244,251,137,252,233,252,255,144,233,139,149,233,133,192, |
| 349 | 15,133,244,69,248,1,255,139,133,233,41,208,193,232,3,131,192,1,139,106,252, | 349 | 15,143,244,69,248,1,255,139,141,233,41,209,193,252,233,3,133,192,141,65,1, |
| 350 | 248,57,114,252,252,15,133,244,248,139,181,233,139,14,15,182,252,233,15,182, | 350 | 139,106,252,248,15,133,244,248,139,181,233,139,14,15,182,252,233,15,182,205, |
| 351 | 205,131,198,4,252,255,36,252,235,248,2,137,209,252,247,198,237,15,133,244, | 351 | 131,198,4,252,255,36,252,235,248,2,137,209,252,247,198,237,15,133,244,249, |
| 352 | 249,15,182,110,252,253,72,252,247,213,141,20,252,234,252,233,244,27,248,3, | 352 | 15,182,110,252,253,72,252,247,213,141,20,252,234,252,233,244,27,248,3,137, |
| 353 | 137,252,245,131,229,252,248,41,252,234,252,233,244,27,248,5,186,237,137,252, | 353 | 252,245,131,229,252,248,41,252,234,252,233,244,27,248,5,186,237,137,252,233, |
| 354 | 233,232,251,1,0,139,149,233,252,233,244,1,248,66,93,72,137,108,36,32,139, | 354 | 232,251,1,0,139,149,233,49,192,252,233,244,1,248,66,93,72,137,108,36,32,139, |
| 355 | 108,36,96,137,116,36,100,137,149,233,255,141,68,194,252,248,137,252,233,137, | 355 | 108,36,96,137,116,36,100,137,149,233,255,141,68,194,252,248,137,252,233,137, |
| 356 | 133,233,232,251,1,19,139,149,233,139,133,233,41,208,193,232,3,131,192,1,72, | 356 | 133,233,232,251,1,19,139,149,233,139,133,233,41,208,193,232,3,131,192,1,72, |
| 357 | 139,108,36,32,85,195,248,136,255,15,182,131,233,168,235,15,133,244,251,168, | 357 | 139,108,36,32,85,195,248,136,255,15,182,131,233,168,235,15,133,244,251,168, |
| @@ -1346,89 +1346,89 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) | |||
| 1346 | } | 1346 | } |
| 1347 | dasm_put(Dst, 6758, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); | 1347 | dasm_put(Dst, 6758, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); |
| 1348 | dasm_put(Dst, 6836, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); | 1348 | dasm_put(Dst, 6836, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); |
| 1349 | dasm_put(Dst, 6962, Dt1(->top), Dt1(->base), Dt1(->top)); | 1349 | dasm_put(Dst, 6963, Dt1(->top), Dt1(->base), Dt1(->top)); |
| 1350 | #if LJ_HASJIT | 1350 | #if LJ_HASJIT |
| 1351 | dasm_put(Dst, 7001, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); | 1351 | dasm_put(Dst, 7002, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); |
| 1352 | #endif | 1352 | #endif |
| 1353 | dasm_put(Dst, 7032, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); | 1353 | dasm_put(Dst, 7033, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); |
| 1354 | dasm_put(Dst, 7083, Dt1(->base), Dt1(->base), GG_DISP2STATIC); | 1354 | dasm_put(Dst, 7084, Dt1(->base), Dt1(->base), GG_DISP2STATIC); |
| 1355 | #if LJ_HASJIT | 1355 | #if LJ_HASJIT |
| 1356 | dasm_put(Dst, 7150, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); | 1356 | dasm_put(Dst, 7151, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); |
| 1357 | #endif | 1357 | #endif |
| 1358 | dasm_put(Dst, 7197); | 1358 | dasm_put(Dst, 7198); |
| 1359 | #if LJ_HASJIT | 1359 | #if LJ_HASJIT |
| 1360 | dasm_put(Dst, 7027); | 1360 | dasm_put(Dst, 7028); |
| 1361 | #endif | 1361 | #endif |
| 1362 | dasm_put(Dst, 7204); | 1362 | dasm_put(Dst, 7205); |
| 1363 | #if LJ_HASJIT | 1363 | #if LJ_HASJIT |
| 1364 | dasm_put(Dst, 7207); | 1364 | dasm_put(Dst, 7208); |
| 1365 | #endif | 1365 | #endif |
| 1366 | dasm_put(Dst, 7217, Dt1(->base), Dt1(->top)); | 1366 | dasm_put(Dst, 7218, Dt1(->base), Dt1(->top)); |
| 1367 | #if LJ_HASJIT | 1367 | #if LJ_HASJIT |
| 1368 | dasm_put(Dst, 7251); | 1368 | dasm_put(Dst, 7252); |
| 1369 | #endif | 1369 | #endif |
| 1370 | dasm_put(Dst, 7256, Dt1(->base), Dt1(->top)); | 1370 | dasm_put(Dst, 7257, Dt1(->base), Dt1(->top)); |
| 1371 | #if LJ_HASJIT | 1371 | #if LJ_HASJIT |
| 1372 | dasm_put(Dst, 7287, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 16*8+4*8, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), 4*8, GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); | 1372 | dasm_put(Dst, 7288, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 16*8+4*8, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), 4*8, GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); |
| 1373 | #endif | 1373 | #endif |
| 1374 | dasm_put(Dst, 7517); | 1374 | dasm_put(Dst, 7518); |
| 1375 | #if LJ_HASJIT | 1375 | #if LJ_HASJIT |
| 1376 | dasm_put(Dst, 7520, 9*16+4*8, -9*16, -8*16, -7*16, -6*16, -5*16, -4*16, -3*16, -2*16, -1*16, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); | 1376 | dasm_put(Dst, 7521, 9*16+4*8, -9*16, -8*16, -7*16, -6*16, -5*16, -4*16, -3*16, -2*16, -1*16, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); |
| 1377 | dasm_put(Dst, 7662); | 1377 | dasm_put(Dst, 7663); |
| 1378 | #endif | 1378 | #endif |
| 1379 | dasm_put(Dst, 7688); | 1379 | dasm_put(Dst, 7689); |
| 1380 | if (!sse) { | 1380 | if (!sse) { |
| 1381 | dasm_put(Dst, 7691); | 1381 | dasm_put(Dst, 7692); |
| 1382 | } | 1382 | } |
| 1383 | dasm_put(Dst, 7736, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1383 | dasm_put(Dst, 7737, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1384 | if (!sse) { | 1384 | if (!sse) { |
| 1385 | dasm_put(Dst, 7822); | 1385 | dasm_put(Dst, 7823); |
| 1386 | } | 1386 | } |
| 1387 | dasm_put(Dst, 7867, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); | 1387 | dasm_put(Dst, 7868, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); |
| 1388 | if (!sse) { | 1388 | if (!sse) { |
| 1389 | dasm_put(Dst, 7953); | 1389 | dasm_put(Dst, 7954); |
| 1390 | } | 1390 | } |
| 1391 | dasm_put(Dst, 7992, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1391 | dasm_put(Dst, 7993, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1392 | if (sse) { | 1392 | if (sse) { |
| 1393 | dasm_put(Dst, 8081, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1393 | dasm_put(Dst, 8082, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1394 | } else { | 1394 | } else { |
| 1395 | dasm_put(Dst, 8195); | 1395 | dasm_put(Dst, 8196); |
| 1396 | } | 1396 | } |
| 1397 | dasm_put(Dst, 8242); | 1397 | dasm_put(Dst, 8243); |
| 1398 | if (!sse) { | 1398 | if (!sse) { |
| 1399 | } else { | 1399 | } else { |
| 1400 | dasm_put(Dst, 8316); | 1400 | dasm_put(Dst, 8317); |
| 1401 | } | 1401 | } |
| 1402 | dasm_put(Dst, 8319); | 1402 | dasm_put(Dst, 8320); |
| 1403 | dasm_put(Dst, 8404, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); | 1403 | dasm_put(Dst, 8405, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); |
| 1404 | dasm_put(Dst, 8505, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); | 1404 | dasm_put(Dst, 8506, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); |
| 1405 | dasm_put(Dst, 8673); | 1405 | dasm_put(Dst, 8674); |
| 1406 | #if LJ_HASJIT | 1406 | #if LJ_HASJIT |
| 1407 | if (sse) { | 1407 | if (sse) { |
| 1408 | dasm_put(Dst, 8714); | 1408 | dasm_put(Dst, 8715); |
| 1409 | dasm_put(Dst, 8784); | 1409 | dasm_put(Dst, 8785); |
| 1410 | dasm_put(Dst, 8857); | 1410 | dasm_put(Dst, 8858); |
| 1411 | } else { | 1411 | } else { |
| 1412 | dasm_put(Dst, 8907); | 1412 | dasm_put(Dst, 8908); |
| 1413 | dasm_put(Dst, 8999); | 1413 | dasm_put(Dst, 9000); |
| 1414 | } | 1414 | } |
| 1415 | dasm_put(Dst, 9045); | 1415 | dasm_put(Dst, 9046); |
| 1416 | #endif | 1416 | #endif |
| 1417 | dasm_put(Dst, 9049); | 1417 | dasm_put(Dst, 9050); |
| 1418 | if (sse) { | 1418 | if (sse) { |
| 1419 | dasm_put(Dst, 9052, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); | 1419 | dasm_put(Dst, 9053, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); |
| 1420 | dasm_put(Dst, 9141, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); | 1420 | dasm_put(Dst, 9142, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); |
| 1421 | } else { | 1421 | } else { |
| 1422 | dasm_put(Dst, 9265); | 1422 | dasm_put(Dst, 9266); |
| 1423 | dasm_put(Dst, 9348); | 1423 | dasm_put(Dst, 9349); |
| 1424 | if (cmov) { | 1424 | if (cmov) { |
| 1425 | dasm_put(Dst, 9403); | 1425 | dasm_put(Dst, 9404); |
| 1426 | } else { | 1426 | } else { |
| 1427 | dasm_put(Dst, 9422); | 1427 | dasm_put(Dst, 9423); |
| 1428 | } | 1428 | } |
| 1429 | dasm_put(Dst, 9045); | 1429 | dasm_put(Dst, 9046); |
| 1430 | } | 1430 | } |
| 1431 | dasm_put(Dst, 9463); | 1431 | dasm_put(Dst, 9464); |
| 1432 | } | 1432 | } |
| 1433 | 1433 | ||
| 1434 | /* Generate the code for a single instruction. */ | 1434 | /* Generate the code for a single instruction. */ |
| @@ -1444,595 +1444,595 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 1444 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ | 1444 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ |
| 1445 | 1445 | ||
| 1446 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: | 1446 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: |
| 1447 | dasm_put(Dst, 9489, LJ_TISNUM, LJ_TISNUM); | 1447 | dasm_put(Dst, 9490, LJ_TISNUM, LJ_TISNUM); |
| 1448 | if (sse) { | 1448 | if (sse) { |
| 1449 | dasm_put(Dst, 9510); | 1449 | dasm_put(Dst, 9511); |
| 1450 | } else { | 1450 | } else { |
| 1451 | dasm_put(Dst, 9525); | 1451 | dasm_put(Dst, 9526); |
| 1452 | if (cmov) { | 1452 | if (cmov) { |
| 1453 | dasm_put(Dst, 9535); | 1453 | dasm_put(Dst, 9536); |
| 1454 | } else { | 1454 | } else { |
| 1455 | dasm_put(Dst, 9541); | 1455 | dasm_put(Dst, 9542); |
| 1456 | } | 1456 | } |
| 1457 | } | 1457 | } |
| 1458 | switch (op) { | 1458 | switch (op) { |
| 1459 | case BC_ISLT: | 1459 | case BC_ISLT: |
| 1460 | dasm_put(Dst, 9548); | 1460 | dasm_put(Dst, 9549); |
| 1461 | break; | 1461 | break; |
| 1462 | case BC_ISGE: | 1462 | case BC_ISGE: |
| 1463 | dasm_put(Dst, 9343); | 1463 | dasm_put(Dst, 9344); |
| 1464 | break; | 1464 | break; |
| 1465 | case BC_ISLE: | 1465 | case BC_ISLE: |
| 1466 | dasm_put(Dst, 5905); | 1466 | dasm_put(Dst, 5905); |
| 1467 | break; | 1467 | break; |
| 1468 | case BC_ISGT: | 1468 | case BC_ISGT: |
| 1469 | dasm_put(Dst, 9553); | 1469 | dasm_put(Dst, 9554); |
| 1470 | break; | 1470 | break; |
| 1471 | default: break; /* Shut up GCC. */ | 1471 | default: break; /* Shut up GCC. */ |
| 1472 | } | 1472 | } |
| 1473 | dasm_put(Dst, 9558, -BCBIAS_J*4); | 1473 | dasm_put(Dst, 9559, -BCBIAS_J*4); |
| 1474 | break; | 1474 | break; |
| 1475 | 1475 | ||
| 1476 | case BC_ISEQV: case BC_ISNEV: | 1476 | case BC_ISEQV: case BC_ISNEV: |
| 1477 | vk = op == BC_ISEQV; | 1477 | vk = op == BC_ISEQV; |
| 1478 | dasm_put(Dst, 9592, LJ_TISNUM, LJ_TISNUM); | 1478 | dasm_put(Dst, 9593, LJ_TISNUM, LJ_TISNUM); |
| 1479 | if (sse) { | 1479 | if (sse) { |
| 1480 | dasm_put(Dst, 9618); | 1480 | dasm_put(Dst, 9619); |
| 1481 | } else { | 1481 | } else { |
| 1482 | dasm_put(Dst, 9630); | 1482 | dasm_put(Dst, 9631); |
| 1483 | if (cmov) { | 1483 | if (cmov) { |
| 1484 | dasm_put(Dst, 9535); | 1484 | dasm_put(Dst, 9536); |
| 1485 | } else { | 1485 | } else { |
| 1486 | dasm_put(Dst, 9541); | 1486 | dasm_put(Dst, 9542); |
| 1487 | } | 1487 | } |
| 1488 | } | 1488 | } |
| 1489 | iseqne_fp: | 1489 | iseqne_fp: |
| 1490 | if (vk) { | 1490 | if (vk) { |
| 1491 | dasm_put(Dst, 9637); | 1491 | dasm_put(Dst, 9638); |
| 1492 | } else { | 1492 | } else { |
| 1493 | dasm_put(Dst, 9646); | 1493 | dasm_put(Dst, 9647); |
| 1494 | } | 1494 | } |
| 1495 | iseqne_end: | 1495 | iseqne_end: |
| 1496 | if (vk) { | 1496 | if (vk) { |
| 1497 | dasm_put(Dst, 9655, -BCBIAS_J*4); | 1497 | dasm_put(Dst, 9656, -BCBIAS_J*4); |
| 1498 | } else { | 1498 | } else { |
| 1499 | dasm_put(Dst, 9670, -BCBIAS_J*4); | 1499 | dasm_put(Dst, 9671, -BCBIAS_J*4); |
| 1500 | } | 1500 | } |
| 1501 | dasm_put(Dst, 9572); | 1501 | dasm_put(Dst, 9573); |
| 1502 | if (op == BC_ISEQV || op == BC_ISNEV) { | 1502 | if (op == BC_ISEQV || op == BC_ISNEV) { |
| 1503 | dasm_put(Dst, 9685, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); | 1503 | dasm_put(Dst, 9686, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); |
| 1504 | if (vk) { | 1504 | if (vk) { |
| 1505 | dasm_put(Dst, 9743); | 1505 | dasm_put(Dst, 9744); |
| 1506 | } else { | 1506 | } else { |
| 1507 | dasm_put(Dst, 9747); | 1507 | dasm_put(Dst, 9748); |
| 1508 | } | 1508 | } |
| 1509 | dasm_put(Dst, 9753); | 1509 | dasm_put(Dst, 9754); |
| 1510 | } | 1510 | } |
| 1511 | break; | 1511 | break; |
| 1512 | case BC_ISEQS: case BC_ISNES: | 1512 | case BC_ISEQS: case BC_ISNES: |
| 1513 | vk = op == BC_ISEQS; | 1513 | vk = op == BC_ISEQS; |
| 1514 | dasm_put(Dst, 9758, LJ_TSTR); | 1514 | dasm_put(Dst, 9759, LJ_TSTR); |
| 1515 | iseqne_test: | 1515 | iseqne_test: |
| 1516 | if (vk) { | 1516 | if (vk) { |
| 1517 | dasm_put(Dst, 9641); | 1517 | dasm_put(Dst, 9642); |
| 1518 | } else { | 1518 | } else { |
| 1519 | dasm_put(Dst, 2805); | 1519 | dasm_put(Dst, 2805); |
| 1520 | } | 1520 | } |
| 1521 | goto iseqne_end; | 1521 | goto iseqne_end; |
| 1522 | case BC_ISEQN: case BC_ISNEN: | 1522 | case BC_ISEQN: case BC_ISNEN: |
| 1523 | vk = op == BC_ISEQN; | 1523 | vk = op == BC_ISEQN; |
| 1524 | dasm_put(Dst, 9782, LJ_TISNUM); | 1524 | dasm_put(Dst, 9783, LJ_TISNUM); |
| 1525 | if (sse) { | 1525 | if (sse) { |
| 1526 | dasm_put(Dst, 9796); | 1526 | dasm_put(Dst, 9797); |
| 1527 | } else { | 1527 | } else { |
| 1528 | dasm_put(Dst, 9808); | 1528 | dasm_put(Dst, 9809); |
| 1529 | if (cmov) { | 1529 | if (cmov) { |
| 1530 | dasm_put(Dst, 9535); | 1530 | dasm_put(Dst, 9536); |
| 1531 | } else { | 1531 | } else { |
| 1532 | dasm_put(Dst, 9541); | 1532 | dasm_put(Dst, 9542); |
| 1533 | } | 1533 | } |
| 1534 | } | 1534 | } |
| 1535 | goto iseqne_fp; | 1535 | goto iseqne_fp; |
| 1536 | case BC_ISEQP: case BC_ISNEP: | 1536 | case BC_ISEQP: case BC_ISNEP: |
| 1537 | vk = op == BC_ISEQP; | 1537 | vk = op == BC_ISEQP; |
| 1538 | dasm_put(Dst, 9815); | 1538 | dasm_put(Dst, 9816); |
| 1539 | goto iseqne_test; | 1539 | goto iseqne_test; |
| 1540 | 1540 | ||
| 1541 | /* -- Unary test and copy ops ------------------------------------------- */ | 1541 | /* -- Unary test and copy ops ------------------------------------------- */ |
| 1542 | 1542 | ||
| 1543 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | 1543 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: |
| 1544 | dasm_put(Dst, 9827, LJ_TISTRUECOND); | 1544 | dasm_put(Dst, 9828, LJ_TISTRUECOND); |
| 1545 | if (op == BC_IST || op == BC_ISTC) { | 1545 | if (op == BC_IST || op == BC_ISTC) { |
| 1546 | dasm_put(Dst, 9839); | 1546 | dasm_put(Dst, 9840); |
| 1547 | } else { | 1547 | } else { |
| 1548 | dasm_put(Dst, 9844); | 1548 | dasm_put(Dst, 9845); |
| 1549 | } | 1549 | } |
| 1550 | if (op == BC_ISTC || op == BC_ISFC) { | 1550 | if (op == BC_ISTC || op == BC_ISFC) { |
| 1551 | dasm_put(Dst, 9849); | 1551 | dasm_put(Dst, 9850); |
| 1552 | } | 1552 | } |
| 1553 | dasm_put(Dst, 9860, -BCBIAS_J*4); | 1553 | dasm_put(Dst, 9861, -BCBIAS_J*4); |
| 1554 | break; | 1554 | break; |
| 1555 | 1555 | ||
| 1556 | /* -- Unary ops --------------------------------------------------------- */ | 1556 | /* -- Unary ops --------------------------------------------------------- */ |
| 1557 | 1557 | ||
| 1558 | case BC_MOV: | 1558 | case BC_MOV: |
| 1559 | dasm_put(Dst, 9892); | 1559 | dasm_put(Dst, 9893); |
| 1560 | break; | 1560 | break; |
| 1561 | case BC_NOT: | 1561 | case BC_NOT: |
| 1562 | dasm_put(Dst, 9926, LJ_TISTRUECOND, LJ_TTRUE); | 1562 | dasm_put(Dst, 9927, LJ_TISTRUECOND, LJ_TTRUE); |
| 1563 | break; | 1563 | break; |
| 1564 | case BC_UNM: | 1564 | case BC_UNM: |
| 1565 | dasm_put(Dst, 9962, LJ_TISNUM); | 1565 | dasm_put(Dst, 9963, LJ_TISNUM); |
| 1566 | if (sse) { | 1566 | if (sse) { |
| 1567 | dasm_put(Dst, 9973, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); | 1567 | dasm_put(Dst, 9974, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); |
| 1568 | } else { | 1568 | } else { |
| 1569 | dasm_put(Dst, 9998); | 1569 | dasm_put(Dst, 9999); |
| 1570 | } | 1570 | } |
| 1571 | dasm_put(Dst, 9572); | 1571 | dasm_put(Dst, 9573); |
| 1572 | break; | 1572 | break; |
| 1573 | case BC_LEN: | 1573 | case BC_LEN: |
| 1574 | dasm_put(Dst, 10007, LJ_TSTR); | 1574 | dasm_put(Dst, 10008, LJ_TSTR); |
| 1575 | if (sse) { | 1575 | if (sse) { |
| 1576 | dasm_put(Dst, 10021, Dt5(->len)); | 1576 | dasm_put(Dst, 10022, Dt5(->len)); |
| 1577 | } else { | 1577 | } else { |
| 1578 | dasm_put(Dst, 10039, Dt5(->len)); | 1578 | dasm_put(Dst, 10040, Dt5(->len)); |
| 1579 | } | 1579 | } |
| 1580 | dasm_put(Dst, 10048, LJ_TTAB); | 1580 | dasm_put(Dst, 10049, LJ_TTAB); |
| 1581 | if (sse) { | 1581 | if (sse) { |
| 1582 | dasm_put(Dst, 10089); | 1582 | dasm_put(Dst, 10090); |
| 1583 | } else { | 1583 | } else { |
| 1584 | } | 1584 | } |
| 1585 | dasm_put(Dst, 10098); | 1585 | dasm_put(Dst, 10099); |
| 1586 | break; | 1586 | break; |
| 1587 | 1587 | ||
| 1588 | /* -- Binary ops -------------------------------------------------------- */ | 1588 | /* -- Binary ops -------------------------------------------------------- */ |
| 1589 | 1589 | ||
| 1590 | 1590 | ||
| 1591 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | 1591 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: |
| 1592 | dasm_put(Dst, 10108); | 1592 | dasm_put(Dst, 10109); |
| 1593 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1593 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1594 | switch (vk) { | 1594 | switch (vk) { |
| 1595 | case 0: | 1595 | case 0: |
| 1596 | dasm_put(Dst, 10116, LJ_TISNUM); | 1596 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1597 | if (sse) { | 1597 | if (sse) { |
| 1598 | dasm_put(Dst, 10128); | 1598 | dasm_put(Dst, 10129); |
| 1599 | } else { | 1599 | } else { |
| 1600 | dasm_put(Dst, 10142); | 1600 | dasm_put(Dst, 10143); |
| 1601 | } | 1601 | } |
| 1602 | break; | 1602 | break; |
| 1603 | case 1: | 1603 | case 1: |
| 1604 | dasm_put(Dst, 10150, LJ_TISNUM); | 1604 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1605 | if (sse) { | 1605 | if (sse) { |
| 1606 | dasm_put(Dst, 10162); | 1606 | dasm_put(Dst, 10163); |
| 1607 | } else { | 1607 | } else { |
| 1608 | dasm_put(Dst, 10176); | 1608 | dasm_put(Dst, 10177); |
| 1609 | } | 1609 | } |
| 1610 | break; | 1610 | break; |
| 1611 | default: | 1611 | default: |
| 1612 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1612 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1613 | if (sse) { | 1613 | if (sse) { |
| 1614 | dasm_put(Dst, 10206); | 1614 | dasm_put(Dst, 10207); |
| 1615 | } else { | 1615 | } else { |
| 1616 | dasm_put(Dst, 10220); | 1616 | dasm_put(Dst, 10221); |
| 1617 | } | 1617 | } |
| 1618 | break; | 1618 | break; |
| 1619 | } | 1619 | } |
| 1620 | if (sse) { | 1620 | if (sse) { |
| 1621 | dasm_put(Dst, 9991); | 1621 | dasm_put(Dst, 9992); |
| 1622 | } else { | 1622 | } else { |
| 1623 | dasm_put(Dst, 10003); | 1623 | dasm_put(Dst, 10004); |
| 1624 | } | 1624 | } |
| 1625 | dasm_put(Dst, 9572); | 1625 | dasm_put(Dst, 9573); |
| 1626 | break; | 1626 | break; |
| 1627 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | 1627 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: |
| 1628 | dasm_put(Dst, 10108); | 1628 | dasm_put(Dst, 10109); |
| 1629 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1629 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1630 | switch (vk) { | 1630 | switch (vk) { |
| 1631 | case 0: | 1631 | case 0: |
| 1632 | dasm_put(Dst, 10116, LJ_TISNUM); | 1632 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1633 | if (sse) { | 1633 | if (sse) { |
| 1634 | dasm_put(Dst, 10228); | 1634 | dasm_put(Dst, 10229); |
| 1635 | } else { | 1635 | } else { |
| 1636 | dasm_put(Dst, 10242); | 1636 | dasm_put(Dst, 10243); |
| 1637 | } | 1637 | } |
| 1638 | break; | 1638 | break; |
| 1639 | case 1: | 1639 | case 1: |
| 1640 | dasm_put(Dst, 10150, LJ_TISNUM); | 1640 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1641 | if (sse) { | 1641 | if (sse) { |
| 1642 | dasm_put(Dst, 10250); | 1642 | dasm_put(Dst, 10251); |
| 1643 | } else { | 1643 | } else { |
| 1644 | dasm_put(Dst, 10264); | 1644 | dasm_put(Dst, 10265); |
| 1645 | } | 1645 | } |
| 1646 | break; | 1646 | break; |
| 1647 | default: | 1647 | default: |
| 1648 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1648 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1649 | if (sse) { | 1649 | if (sse) { |
| 1650 | dasm_put(Dst, 10272); | 1650 | dasm_put(Dst, 10273); |
| 1651 | } else { | 1651 | } else { |
| 1652 | dasm_put(Dst, 10286); | 1652 | dasm_put(Dst, 10287); |
| 1653 | } | 1653 | } |
| 1654 | break; | 1654 | break; |
| 1655 | } | 1655 | } |
| 1656 | if (sse) { | 1656 | if (sse) { |
| 1657 | dasm_put(Dst, 9991); | 1657 | dasm_put(Dst, 9992); |
| 1658 | } else { | 1658 | } else { |
| 1659 | dasm_put(Dst, 10003); | 1659 | dasm_put(Dst, 10004); |
| 1660 | } | 1660 | } |
| 1661 | dasm_put(Dst, 9572); | 1661 | dasm_put(Dst, 9573); |
| 1662 | break; | 1662 | break; |
| 1663 | case BC_MULVN: case BC_MULNV: case BC_MULVV: | 1663 | case BC_MULVN: case BC_MULNV: case BC_MULVV: |
| 1664 | dasm_put(Dst, 10108); | 1664 | dasm_put(Dst, 10109); |
| 1665 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1665 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1666 | switch (vk) { | 1666 | switch (vk) { |
| 1667 | case 0: | 1667 | case 0: |
| 1668 | dasm_put(Dst, 10116, LJ_TISNUM); | 1668 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1669 | if (sse) { | 1669 | if (sse) { |
| 1670 | dasm_put(Dst, 10294); | 1670 | dasm_put(Dst, 10295); |
| 1671 | } else { | 1671 | } else { |
| 1672 | dasm_put(Dst, 10308); | 1672 | dasm_put(Dst, 10309); |
| 1673 | } | 1673 | } |
| 1674 | break; | 1674 | break; |
| 1675 | case 1: | 1675 | case 1: |
| 1676 | dasm_put(Dst, 10150, LJ_TISNUM); | 1676 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1677 | if (sse) { | 1677 | if (sse) { |
| 1678 | dasm_put(Dst, 10316); | 1678 | dasm_put(Dst, 10317); |
| 1679 | } else { | 1679 | } else { |
| 1680 | dasm_put(Dst, 10330); | 1680 | dasm_put(Dst, 10331); |
| 1681 | } | 1681 | } |
| 1682 | break; | 1682 | break; |
| 1683 | default: | 1683 | default: |
| 1684 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1684 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1685 | if (sse) { | 1685 | if (sse) { |
| 1686 | dasm_put(Dst, 10338); | 1686 | dasm_put(Dst, 10339); |
| 1687 | } else { | 1687 | } else { |
| 1688 | dasm_put(Dst, 10352); | 1688 | dasm_put(Dst, 10353); |
| 1689 | } | 1689 | } |
| 1690 | break; | 1690 | break; |
| 1691 | } | 1691 | } |
| 1692 | if (sse) { | 1692 | if (sse) { |
| 1693 | dasm_put(Dst, 9991); | 1693 | dasm_put(Dst, 9992); |
| 1694 | } else { | 1694 | } else { |
| 1695 | dasm_put(Dst, 10003); | 1695 | dasm_put(Dst, 10004); |
| 1696 | } | 1696 | } |
| 1697 | dasm_put(Dst, 9572); | 1697 | dasm_put(Dst, 9573); |
| 1698 | break; | 1698 | break; |
| 1699 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | 1699 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: |
| 1700 | dasm_put(Dst, 10108); | 1700 | dasm_put(Dst, 10109); |
| 1701 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1701 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1702 | switch (vk) { | 1702 | switch (vk) { |
| 1703 | case 0: | 1703 | case 0: |
| 1704 | dasm_put(Dst, 10116, LJ_TISNUM); | 1704 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1705 | if (sse) { | 1705 | if (sse) { |
| 1706 | dasm_put(Dst, 10360); | 1706 | dasm_put(Dst, 10361); |
| 1707 | } else { | 1707 | } else { |
| 1708 | dasm_put(Dst, 10374); | 1708 | dasm_put(Dst, 10375); |
| 1709 | } | 1709 | } |
| 1710 | break; | 1710 | break; |
| 1711 | case 1: | 1711 | case 1: |
| 1712 | dasm_put(Dst, 10150, LJ_TISNUM); | 1712 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1713 | if (sse) { | 1713 | if (sse) { |
| 1714 | dasm_put(Dst, 10382); | 1714 | dasm_put(Dst, 10383); |
| 1715 | } else { | 1715 | } else { |
| 1716 | dasm_put(Dst, 10396); | 1716 | dasm_put(Dst, 10397); |
| 1717 | } | 1717 | } |
| 1718 | break; | 1718 | break; |
| 1719 | default: | 1719 | default: |
| 1720 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1720 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1721 | if (sse) { | 1721 | if (sse) { |
| 1722 | dasm_put(Dst, 10404); | 1722 | dasm_put(Dst, 10405); |
| 1723 | } else { | 1723 | } else { |
| 1724 | dasm_put(Dst, 10418); | 1724 | dasm_put(Dst, 10419); |
| 1725 | } | 1725 | } |
| 1726 | break; | 1726 | break; |
| 1727 | } | 1727 | } |
| 1728 | if (sse) { | 1728 | if (sse) { |
| 1729 | dasm_put(Dst, 9991); | 1729 | dasm_put(Dst, 9992); |
| 1730 | } else { | 1730 | } else { |
| 1731 | dasm_put(Dst, 10003); | 1731 | dasm_put(Dst, 10004); |
| 1732 | } | 1732 | } |
| 1733 | dasm_put(Dst, 9572); | 1733 | dasm_put(Dst, 9573); |
| 1734 | break; | 1734 | break; |
| 1735 | case BC_MODVN: | 1735 | case BC_MODVN: |
| 1736 | dasm_put(Dst, 10108); | 1736 | dasm_put(Dst, 10109); |
| 1737 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1737 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1738 | switch (vk) { | 1738 | switch (vk) { |
| 1739 | case 0: | 1739 | case 0: |
| 1740 | dasm_put(Dst, 10116, LJ_TISNUM); | 1740 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1741 | if (sse) { | 1741 | if (sse) { |
| 1742 | dasm_put(Dst, 10426); | 1742 | dasm_put(Dst, 10427); |
| 1743 | } else { | 1743 | } else { |
| 1744 | dasm_put(Dst, 10440); | 1744 | dasm_put(Dst, 10441); |
| 1745 | } | 1745 | } |
| 1746 | break; | 1746 | break; |
| 1747 | case 1: | 1747 | case 1: |
| 1748 | dasm_put(Dst, 10150, LJ_TISNUM); | 1748 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1749 | if (sse) { | 1749 | if (sse) { |
| 1750 | dasm_put(Dst, 10448); | 1750 | dasm_put(Dst, 10449); |
| 1751 | } else { | 1751 | } else { |
| 1752 | dasm_put(Dst, 10462); | 1752 | dasm_put(Dst, 10463); |
| 1753 | } | 1753 | } |
| 1754 | break; | 1754 | break; |
| 1755 | default: | 1755 | default: |
| 1756 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1756 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1757 | if (sse) { | 1757 | if (sse) { |
| 1758 | dasm_put(Dst, 10470); | 1758 | dasm_put(Dst, 10471); |
| 1759 | } else { | 1759 | } else { |
| 1760 | dasm_put(Dst, 10484); | 1760 | dasm_put(Dst, 10485); |
| 1761 | } | 1761 | } |
| 1762 | break; | 1762 | break; |
| 1763 | } | 1763 | } |
| 1764 | dasm_put(Dst, 10492); | 1764 | dasm_put(Dst, 10493); |
| 1765 | if (sse) { | 1765 | if (sse) { |
| 1766 | dasm_put(Dst, 9991); | 1766 | dasm_put(Dst, 9992); |
| 1767 | } else { | 1767 | } else { |
| 1768 | dasm_put(Dst, 10003); | 1768 | dasm_put(Dst, 10004); |
| 1769 | } | 1769 | } |
| 1770 | dasm_put(Dst, 9572); | 1770 | dasm_put(Dst, 9573); |
| 1771 | break; | 1771 | break; |
| 1772 | case BC_MODNV: case BC_MODVV: | 1772 | case BC_MODNV: case BC_MODVV: |
| 1773 | dasm_put(Dst, 10108); | 1773 | dasm_put(Dst, 10109); |
| 1774 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1774 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1775 | switch (vk) { | 1775 | switch (vk) { |
| 1776 | case 0: | 1776 | case 0: |
| 1777 | dasm_put(Dst, 10116, LJ_TISNUM); | 1777 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1778 | if (sse) { | 1778 | if (sse) { |
| 1779 | dasm_put(Dst, 10426); | 1779 | dasm_put(Dst, 10427); |
| 1780 | } else { | 1780 | } else { |
| 1781 | dasm_put(Dst, 10440); | 1781 | dasm_put(Dst, 10441); |
| 1782 | } | 1782 | } |
| 1783 | break; | 1783 | break; |
| 1784 | case 1: | 1784 | case 1: |
| 1785 | dasm_put(Dst, 10150, LJ_TISNUM); | 1785 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1786 | if (sse) { | 1786 | if (sse) { |
| 1787 | dasm_put(Dst, 10448); | 1787 | dasm_put(Dst, 10449); |
| 1788 | } else { | 1788 | } else { |
| 1789 | dasm_put(Dst, 10462); | 1789 | dasm_put(Dst, 10463); |
| 1790 | } | 1790 | } |
| 1791 | break; | 1791 | break; |
| 1792 | default: | 1792 | default: |
| 1793 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1793 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1794 | if (sse) { | 1794 | if (sse) { |
| 1795 | dasm_put(Dst, 10470); | 1795 | dasm_put(Dst, 10471); |
| 1796 | } else { | 1796 | } else { |
| 1797 | dasm_put(Dst, 10484); | 1797 | dasm_put(Dst, 10485); |
| 1798 | } | 1798 | } |
| 1799 | break; | 1799 | break; |
| 1800 | } | 1800 | } |
| 1801 | dasm_put(Dst, 10498); | 1801 | dasm_put(Dst, 10499); |
| 1802 | break; | 1802 | break; |
| 1803 | case BC_POW: | 1803 | case BC_POW: |
| 1804 | dasm_put(Dst, 10108); | 1804 | dasm_put(Dst, 10109); |
| 1805 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1805 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1806 | switch (vk) { | 1806 | switch (vk) { |
| 1807 | case 0: | 1807 | case 0: |
| 1808 | dasm_put(Dst, 10116, LJ_TISNUM); | 1808 | dasm_put(Dst, 10117, LJ_TISNUM); |
| 1809 | if (sse) { | 1809 | if (sse) { |
| 1810 | dasm_put(Dst, 10426); | 1810 | dasm_put(Dst, 10427); |
| 1811 | } else { | 1811 | } else { |
| 1812 | dasm_put(Dst, 10440); | 1812 | dasm_put(Dst, 10441); |
| 1813 | } | 1813 | } |
| 1814 | break; | 1814 | break; |
| 1815 | case 1: | 1815 | case 1: |
| 1816 | dasm_put(Dst, 10150, LJ_TISNUM); | 1816 | dasm_put(Dst, 10151, LJ_TISNUM); |
| 1817 | if (sse) { | 1817 | if (sse) { |
| 1818 | dasm_put(Dst, 10448); | 1818 | dasm_put(Dst, 10449); |
| 1819 | } else { | 1819 | } else { |
| 1820 | dasm_put(Dst, 10462); | 1820 | dasm_put(Dst, 10463); |
| 1821 | } | 1821 | } |
| 1822 | break; | 1822 | break; |
| 1823 | default: | 1823 | default: |
| 1824 | dasm_put(Dst, 10184, LJ_TISNUM, LJ_TISNUM); | 1824 | dasm_put(Dst, 10185, LJ_TISNUM, LJ_TISNUM); |
| 1825 | if (sse) { | 1825 | if (sse) { |
| 1826 | dasm_put(Dst, 10470); | 1826 | dasm_put(Dst, 10471); |
| 1827 | } else { | 1827 | } else { |
| 1828 | dasm_put(Dst, 10484); | 1828 | dasm_put(Dst, 10485); |
| 1829 | } | 1829 | } |
| 1830 | break; | 1830 | break; |
| 1831 | } | 1831 | } |
| 1832 | dasm_put(Dst, 10503); | 1832 | dasm_put(Dst, 10504); |
| 1833 | if (sse) { | 1833 | if (sse) { |
| 1834 | dasm_put(Dst, 9991); | 1834 | dasm_put(Dst, 9992); |
| 1835 | } else { | 1835 | } else { |
| 1836 | dasm_put(Dst, 10003); | 1836 | dasm_put(Dst, 10004); |
| 1837 | } | 1837 | } |
| 1838 | dasm_put(Dst, 9572); | 1838 | dasm_put(Dst, 9573); |
| 1839 | break; | 1839 | break; |
| 1840 | 1840 | ||
| 1841 | case BC_CAT: | 1841 | case BC_CAT: |
| 1842 | dasm_put(Dst, 10507, Dt1(->base), Dt1(->base)); | 1842 | dasm_put(Dst, 10508, Dt1(->base), Dt1(->base)); |
| 1843 | break; | 1843 | break; |
| 1844 | 1844 | ||
| 1845 | /* -- Constant ops ------------------------------------------------------ */ | 1845 | /* -- Constant ops ------------------------------------------------------ */ |
| 1846 | 1846 | ||
| 1847 | case BC_KSTR: | 1847 | case BC_KSTR: |
| 1848 | dasm_put(Dst, 10597, LJ_TSTR); | 1848 | dasm_put(Dst, 10598, LJ_TSTR); |
| 1849 | break; | 1849 | break; |
| 1850 | case BC_KSHORT: | 1850 | case BC_KSHORT: |
| 1851 | if (sse) { | 1851 | if (sse) { |
| 1852 | dasm_put(Dst, 10632); | 1852 | dasm_put(Dst, 10633); |
| 1853 | } else { | 1853 | } else { |
| 1854 | dasm_put(Dst, 10647); | 1854 | dasm_put(Dst, 10648); |
| 1855 | } | 1855 | } |
| 1856 | dasm_put(Dst, 9572); | 1856 | dasm_put(Dst, 9573); |
| 1857 | break; | 1857 | break; |
| 1858 | case BC_KNUM: | 1858 | case BC_KNUM: |
| 1859 | if (sse) { | 1859 | if (sse) { |
| 1860 | dasm_put(Dst, 10655); | 1860 | dasm_put(Dst, 10656); |
| 1861 | } else { | 1861 | } else { |
| 1862 | dasm_put(Dst, 10668); | 1862 | dasm_put(Dst, 10669); |
| 1863 | } | 1863 | } |
| 1864 | dasm_put(Dst, 9572); | 1864 | dasm_put(Dst, 9573); |
| 1865 | break; | 1865 | break; |
| 1866 | case BC_KPRI: | 1866 | case BC_KPRI: |
| 1867 | dasm_put(Dst, 10675); | 1867 | dasm_put(Dst, 10676); |
| 1868 | break; | 1868 | break; |
| 1869 | case BC_KNIL: | 1869 | case BC_KNIL: |
| 1870 | dasm_put(Dst, 10703, LJ_TNIL); | 1870 | dasm_put(Dst, 10704, LJ_TNIL); |
| 1871 | break; | 1871 | break; |
| 1872 | 1872 | ||
| 1873 | /* -- Upvalue and function ops ------------------------------------------ */ | 1873 | /* -- Upvalue and function ops ------------------------------------------ */ |
| 1874 | 1874 | ||
| 1875 | case BC_UGET: | 1875 | case BC_UGET: |
| 1876 | dasm_put(Dst, 10750, offsetof(GCfuncL, uvptr), DtA(->v)); | 1876 | dasm_put(Dst, 10751, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1877 | break; | 1877 | break; |
| 1878 | case BC_USETV: | 1878 | case BC_USETV: |
| 1879 | #define TV2MARKOFS \ | 1879 | #define TV2MARKOFS \ |
| 1880 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) | 1880 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) |
| 1881 | dasm_put(Dst, 10795, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); | 1881 | dasm_put(Dst, 10796, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); |
| 1882 | dasm_put(Dst, 10886); | 1882 | dasm_put(Dst, 10887); |
| 1883 | break; | 1883 | break; |
| 1884 | #undef TV2MARKOFS | 1884 | #undef TV2MARKOFS |
| 1885 | case BC_USETS: | 1885 | case BC_USETS: |
| 1886 | dasm_put(Dst, 10898, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); | 1886 | dasm_put(Dst, 10899, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); |
| 1887 | break; | 1887 | break; |
| 1888 | case BC_USETN: | 1888 | case BC_USETN: |
| 1889 | dasm_put(Dst, 10991); | 1889 | dasm_put(Dst, 10992); |
| 1890 | if (sse) { | 1890 | if (sse) { |
| 1891 | dasm_put(Dst, 10996); | 1891 | dasm_put(Dst, 10997); |
| 1892 | } else { | 1892 | } else { |
| 1893 | dasm_put(Dst, 9811); | 1893 | dasm_put(Dst, 9812); |
| 1894 | } | 1894 | } |
| 1895 | dasm_put(Dst, 11003, offsetof(GCfuncL, uvptr), DtA(->v)); | 1895 | dasm_put(Dst, 11004, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1896 | if (sse) { | 1896 | if (sse) { |
| 1897 | dasm_put(Dst, 11012); | 1897 | dasm_put(Dst, 11013); |
| 1898 | } else { | 1898 | } else { |
| 1899 | dasm_put(Dst, 11018); | 1899 | dasm_put(Dst, 11019); |
| 1900 | } | 1900 | } |
| 1901 | dasm_put(Dst, 9572); | 1901 | dasm_put(Dst, 9573); |
| 1902 | break; | 1902 | break; |
| 1903 | case BC_USETP: | 1903 | case BC_USETP: |
| 1904 | dasm_put(Dst, 11021, offsetof(GCfuncL, uvptr), DtA(->v)); | 1904 | dasm_put(Dst, 11022, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1905 | break; | 1905 | break; |
| 1906 | case BC_UCLO: | 1906 | case BC_UCLO: |
| 1907 | dasm_put(Dst, 11060, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); | 1907 | dasm_put(Dst, 11061, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); |
| 1908 | break; | 1908 | break; |
| 1909 | 1909 | ||
| 1910 | case BC_FNEW: | 1910 | case BC_FNEW: |
| 1911 | dasm_put(Dst, 11115, Dt1(->base), Dt1(->base), LJ_TFUNC); | 1911 | dasm_put(Dst, 11116, Dt1(->base), Dt1(->base), LJ_TFUNC); |
| 1912 | break; | 1912 | break; |
| 1913 | 1913 | ||
| 1914 | /* -- Table ops --------------------------------------------------------- */ | 1914 | /* -- Table ops --------------------------------------------------------- */ |
| 1915 | 1915 | ||
| 1916 | case BC_TNEW: | 1916 | case BC_TNEW: |
| 1917 | dasm_put(Dst, 11181, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); | 1917 | dasm_put(Dst, 11182, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); |
| 1918 | break; | 1918 | break; |
| 1919 | case BC_TDUP: | 1919 | case BC_TDUP: |
| 1920 | dasm_put(Dst, 11303, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); | 1920 | dasm_put(Dst, 11304, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); |
| 1921 | break; | 1921 | break; |
| 1922 | 1922 | ||
| 1923 | case BC_GGET: | 1923 | case BC_GGET: |
| 1924 | dasm_put(Dst, 11398, Dt7(->env)); | 1924 | dasm_put(Dst, 11399, Dt7(->env)); |
| 1925 | break; | 1925 | break; |
| 1926 | case BC_GSET: | 1926 | case BC_GSET: |
| 1927 | dasm_put(Dst, 11417, Dt7(->env)); | 1927 | dasm_put(Dst, 11418, Dt7(->env)); |
| 1928 | break; | 1928 | break; |
| 1929 | 1929 | ||
| 1930 | case BC_TGETV: | 1930 | case BC_TGETV: |
| 1931 | dasm_put(Dst, 11436, LJ_TTAB, LJ_TISNUM); | 1931 | dasm_put(Dst, 11437, LJ_TTAB, LJ_TISNUM); |
| 1932 | if (sse) { | 1932 | if (sse) { |
| 1933 | dasm_put(Dst, 11469); | 1933 | dasm_put(Dst, 11470); |
| 1934 | } else { | 1934 | } else { |
| 1935 | } | 1935 | } |
| 1936 | dasm_put(Dst, 11490, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1936 | dasm_put(Dst, 11491, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1937 | dasm_put(Dst, 11583, LJ_TSTR); | 1937 | dasm_put(Dst, 11584, LJ_TSTR); |
| 1938 | break; | 1938 | break; |
| 1939 | case BC_TGETS: | 1939 | case BC_TGETS: |
| 1940 | dasm_put(Dst, 11601, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 1940 | dasm_put(Dst, 11602, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 1941 | dasm_put(Dst, 11686, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1941 | dasm_put(Dst, 11687, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1942 | break; | 1942 | break; |
| 1943 | case BC_TGETB: | 1943 | case BC_TGETB: |
| 1944 | dasm_put(Dst, 11758, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 1944 | dasm_put(Dst, 11759, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 1945 | dasm_put(Dst, 10098); | 1945 | dasm_put(Dst, 10099); |
| 1946 | break; | 1946 | break; |
| 1947 | 1947 | ||
| 1948 | case BC_TSETV: | 1948 | case BC_TSETV: |
| 1949 | dasm_put(Dst, 11858, LJ_TTAB, LJ_TISNUM); | 1949 | dasm_put(Dst, 11859, LJ_TTAB, LJ_TISNUM); |
| 1950 | if (sse) { | 1950 | if (sse) { |
| 1951 | dasm_put(Dst, 11469); | 1951 | dasm_put(Dst, 11470); |
| 1952 | } else { | 1952 | } else { |
| 1953 | } | 1953 | } |
| 1954 | dasm_put(Dst, 11891, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); | 1954 | dasm_put(Dst, 11892, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); |
| 1955 | dasm_put(Dst, 11975, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1955 | dasm_put(Dst, 11976, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1956 | break; | 1956 | break; |
| 1957 | case BC_TSETS: | 1957 | case BC_TSETS: |
| 1958 | dasm_put(Dst, 12037, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 1958 | dasm_put(Dst, 12038, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 1959 | dasm_put(Dst, 12113, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); | 1959 | dasm_put(Dst, 12114, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); |
| 1960 | dasm_put(Dst, 12206, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1960 | dasm_put(Dst, 12207, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1961 | break; | 1961 | break; |
| 1962 | case BC_TSETB: | 1962 | case BC_TSETB: |
| 1963 | dasm_put(Dst, 12297, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); | 1963 | dasm_put(Dst, 12298, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); |
| 1964 | dasm_put(Dst, 12396, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1964 | dasm_put(Dst, 12397, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1965 | break; | 1965 | break; |
| 1966 | 1966 | ||
| 1967 | case BC_TSETM: | 1967 | case BC_TSETM: |
| 1968 | dasm_put(Dst, 12442); | 1968 | dasm_put(Dst, 12443); |
| 1969 | if (sse) { | 1969 | if (sse) { |
| 1970 | dasm_put(Dst, 12447); | 1970 | dasm_put(Dst, 12448); |
| 1971 | } else { | 1971 | } else { |
| 1972 | } | 1972 | } |
| 1973 | dasm_put(Dst, 12454, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); | 1973 | dasm_put(Dst, 12455, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); |
| 1974 | dasm_put(Dst, 12594, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 1974 | dasm_put(Dst, 12595, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 1975 | break; | 1975 | break; |
| 1976 | 1976 | ||
| 1977 | /* -- Calls and vararg handling ----------------------------------------- */ | 1977 | /* -- Calls and vararg handling ----------------------------------------- */ |
| 1978 | 1978 | ||
| 1979 | case BC_CALL: case BC_CALLM: | 1979 | case BC_CALL: case BC_CALLM: |
| 1980 | dasm_put(Dst, 10112); | 1980 | dasm_put(Dst, 10113); |
| 1981 | if (op == BC_CALLM) { | 1981 | if (op == BC_CALLM) { |
| 1982 | dasm_put(Dst, 12612); | 1982 | dasm_put(Dst, 12613); |
| 1983 | } | 1983 | } |
| 1984 | dasm_put(Dst, 12617, LJ_TFUNC, Dt7(->pc)); | 1984 | dasm_put(Dst, 12618, LJ_TFUNC, Dt7(->pc)); |
| 1985 | break; | 1985 | break; |
| 1986 | 1986 | ||
| 1987 | case BC_CALLMT: | 1987 | case BC_CALLMT: |
| 1988 | dasm_put(Dst, 12612); | 1988 | dasm_put(Dst, 12613); |
| 1989 | break; | 1989 | break; |
| 1990 | case BC_CALLT: | 1990 | case BC_CALLT: |
| 1991 | dasm_put(Dst, 12659, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); | 1991 | dasm_put(Dst, 12660, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); |
| 1992 | dasm_put(Dst, 12778, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); | 1992 | dasm_put(Dst, 12779, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); |
| 1993 | break; | 1993 | break; |
| 1994 | 1994 | ||
| 1995 | case BC_ITERC: | 1995 | case BC_ITERC: |
| 1996 | dasm_put(Dst, 12849, LJ_TFUNC, 2+1, Dt7(->pc)); | 1996 | dasm_put(Dst, 12850, LJ_TFUNC, 2+1, Dt7(->pc)); |
| 1997 | break; | 1997 | break; |
| 1998 | 1998 | ||
| 1999 | case BC_VARG: | 1999 | case BC_VARG: |
| 2000 | dasm_put(Dst, 12930, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); | 2000 | dasm_put(Dst, 12931, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); |
| 2001 | dasm_put(Dst, 13075, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); | 2001 | dasm_put(Dst, 13076, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); |
| 2002 | break; | 2002 | break; |
| 2003 | 2003 | ||
| 2004 | /* -- Returns ----------------------------------------------------------- */ | 2004 | /* -- Returns ----------------------------------------------------------- */ |
| 2005 | 2005 | ||
| 2006 | case BC_RETM: | 2006 | case BC_RETM: |
| 2007 | dasm_put(Dst, 12612); | 2007 | dasm_put(Dst, 12613); |
| 2008 | break; | 2008 | break; |
| 2009 | 2009 | ||
| 2010 | case BC_RET: case BC_RET0: case BC_RET1: | 2010 | case BC_RET: case BC_RET0: case BC_RET1: |
| 2011 | if (op != BC_RET0) { | 2011 | if (op != BC_RET0) { |
| 2012 | dasm_put(Dst, 13174); | 2012 | dasm_put(Dst, 13175); |
| 2013 | } | 2013 | } |
| 2014 | dasm_put(Dst, 13178, FRAME_TYPE); | 2014 | dasm_put(Dst, 13179, FRAME_TYPE); |
| 2015 | switch (op) { | 2015 | switch (op) { |
| 2016 | case BC_RET: | 2016 | case BC_RET: |
| 2017 | dasm_put(Dst, 13197); | 2017 | dasm_put(Dst, 13198); |
| 2018 | break; | 2018 | break; |
| 2019 | case BC_RET1: | 2019 | case BC_RET1: |
| 2020 | dasm_put(Dst, 13255); | 2020 | dasm_put(Dst, 13256); |
| 2021 | /* fallthrough */ | 2021 | /* fallthrough */ |
| 2022 | case BC_RET0: | 2022 | case BC_RET0: |
| 2023 | dasm_put(Dst, 13271); | 2023 | dasm_put(Dst, 13272); |
| 2024 | default: | 2024 | default: |
| 2025 | break; | 2025 | break; |
| 2026 | } | 2026 | } |
| 2027 | dasm_put(Dst, 13282, Dt7(->pc), PC2PROTO(k)); | 2027 | dasm_put(Dst, 13283, Dt7(->pc), PC2PROTO(k)); |
| 2028 | if (op == BC_RET) { | 2028 | if (op == BC_RET) { |
| 2029 | dasm_put(Dst, 13326, LJ_TNIL); | 2029 | dasm_put(Dst, 13327, LJ_TNIL); |
| 2030 | } else { | 2030 | } else { |
| 2031 | dasm_put(Dst, 13335, LJ_TNIL); | 2031 | dasm_put(Dst, 13336, LJ_TNIL); |
| 2032 | } | 2032 | } |
| 2033 | dasm_put(Dst, 13342, -FRAME_VARG, FRAME_TYPEP); | 2033 | dasm_put(Dst, 13343, -FRAME_VARG, FRAME_TYPEP); |
| 2034 | if (op != BC_RET0) { | 2034 | if (op != BC_RET0) { |
| 2035 | dasm_put(Dst, 13366); | 2035 | dasm_put(Dst, 13367); |
| 2036 | } | 2036 | } |
| 2037 | dasm_put(Dst, 4573); | 2037 | dasm_put(Dst, 4573); |
| 2038 | break; | 2038 | break; |
| @@ -2042,7 +2042,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2042 | 2042 | ||
| 2043 | case BC_FORL: | 2043 | case BC_FORL: |
| 2044 | #if LJ_HASJIT | 2044 | #if LJ_HASJIT |
| 2045 | dasm_put(Dst, 13370, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2045 | dasm_put(Dst, 13371, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2046 | #endif | 2046 | #endif |
| 2047 | break; | 2047 | break; |
| 2048 | 2048 | ||
| @@ -2054,57 +2054,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2054 | case BC_FORI: | 2054 | case BC_FORI: |
| 2055 | case BC_IFORL: | 2055 | case BC_IFORL: |
| 2056 | vk = (op == BC_IFORL || op == BC_JFORL); | 2056 | vk = (op == BC_IFORL || op == BC_JFORL); |
| 2057 | dasm_put(Dst, 13391); | 2057 | dasm_put(Dst, 13392); |
| 2058 | if (!vk) { | 2058 | if (!vk) { |
| 2059 | dasm_put(Dst, 13395, LJ_TISNUM, LJ_TISNUM); | 2059 | dasm_put(Dst, 13396, LJ_TISNUM, LJ_TISNUM); |
| 2060 | } | 2060 | } |
| 2061 | dasm_put(Dst, 13414); | 2061 | dasm_put(Dst, 13415); |
| 2062 | if (!vk) { | 2062 | if (!vk) { |
| 2063 | dasm_put(Dst, 13418, LJ_TISNUM); | 2063 | dasm_put(Dst, 13419, LJ_TISNUM); |
| 2064 | } | 2064 | } |
| 2065 | if (sse) { | 2065 | if (sse) { |
| 2066 | dasm_put(Dst, 13427); | 2066 | dasm_put(Dst, 13428); |
| 2067 | if (vk) { | 2067 | if (vk) { |
| 2068 | dasm_put(Dst, 13439); | 2068 | dasm_put(Dst, 13440); |
| 2069 | } else { | 2069 | } else { |
| 2070 | dasm_put(Dst, 13458); | 2070 | dasm_put(Dst, 13459); |
| 2071 | } | 2071 | } |
| 2072 | dasm_put(Dst, 13463); | 2072 | dasm_put(Dst, 13464); |
| 2073 | } else { | 2073 | } else { |
| 2074 | dasm_put(Dst, 13476); | 2074 | dasm_put(Dst, 13477); |
| 2075 | if (vk) { | 2075 | if (vk) { |
| 2076 | dasm_put(Dst, 13482); | 2076 | dasm_put(Dst, 13483); |
| 2077 | } else { | 2077 | } else { |
| 2078 | dasm_put(Dst, 13498); | 2078 | dasm_put(Dst, 13499); |
| 2079 | } | 2079 | } |
| 2080 | dasm_put(Dst, 13506); | 2080 | dasm_put(Dst, 13507); |
| 2081 | if (cmov) { | 2081 | if (cmov) { |
| 2082 | dasm_put(Dst, 9535); | 2082 | dasm_put(Dst, 9536); |
| 2083 | } else { | 2083 | } else { |
| 2084 | dasm_put(Dst, 9541); | 2084 | dasm_put(Dst, 9542); |
| 2085 | } | 2085 | } |
| 2086 | if (!cmov) { | 2086 | if (!cmov) { |
| 2087 | dasm_put(Dst, 13511); | 2087 | dasm_put(Dst, 13512); |
| 2088 | } | 2088 | } |
| 2089 | } | 2089 | } |
| 2090 | if (op == BC_FORI) { | 2090 | if (op == BC_FORI) { |
| 2091 | dasm_put(Dst, 13517, -BCBIAS_J*4); | 2091 | dasm_put(Dst, 13518, -BCBIAS_J*4); |
| 2092 | } else if (op == BC_JFORI) { | 2092 | } else if (op == BC_JFORI) { |
| 2093 | dasm_put(Dst, 13527, -BCBIAS_J*4, BC_JLOOP); | 2093 | dasm_put(Dst, 13528, -BCBIAS_J*4, BC_JLOOP); |
| 2094 | } else if (op == BC_IFORL) { | 2094 | } else if (op == BC_IFORL) { |
| 2095 | dasm_put(Dst, 13541, -BCBIAS_J*4); | 2095 | dasm_put(Dst, 13542, -BCBIAS_J*4); |
| 2096 | } else { | 2096 | } else { |
| 2097 | dasm_put(Dst, 13537, BC_JLOOP); | 2097 | dasm_put(Dst, 13538, BC_JLOOP); |
| 2098 | } | 2098 | } |
| 2099 | dasm_put(Dst, 9570); | 2099 | dasm_put(Dst, 9571); |
| 2100 | if (sse) { | 2100 | if (sse) { |
| 2101 | dasm_put(Dst, 13551); | 2101 | dasm_put(Dst, 13552); |
| 2102 | } | 2102 | } |
| 2103 | break; | 2103 | break; |
| 2104 | 2104 | ||
| 2105 | case BC_ITERL: | 2105 | case BC_ITERL: |
| 2106 | #if LJ_HASJIT | 2106 | #if LJ_HASJIT |
| 2107 | dasm_put(Dst, 13370, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2107 | dasm_put(Dst, 13371, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2108 | #endif | 2108 | #endif |
| 2109 | break; | 2109 | break; |
| 2110 | 2110 | ||
| @@ -2113,33 +2113,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2113 | break; | 2113 | break; |
| 2114 | #endif | 2114 | #endif |
| 2115 | case BC_IITERL: | 2115 | case BC_IITERL: |
| 2116 | dasm_put(Dst, 13562, LJ_TNIL); | 2116 | dasm_put(Dst, 13563, LJ_TNIL); |
| 2117 | if (op == BC_JITERL) { | 2117 | if (op == BC_JITERL) { |
| 2118 | dasm_put(Dst, 13577, BC_JLOOP); | 2118 | dasm_put(Dst, 13578, BC_JLOOP); |
| 2119 | } else { | 2119 | } else { |
| 2120 | dasm_put(Dst, 13591, -BCBIAS_J*4); | 2120 | dasm_put(Dst, 13592, -BCBIAS_J*4); |
| 2121 | } | 2121 | } |
| 2122 | dasm_put(Dst, 9870); | 2122 | dasm_put(Dst, 9871); |
| 2123 | break; | 2123 | break; |
| 2124 | 2124 | ||
| 2125 | case BC_LOOP: | 2125 | case BC_LOOP: |
| 2126 | #if LJ_HASJIT | 2126 | #if LJ_HASJIT |
| 2127 | dasm_put(Dst, 13370, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2127 | dasm_put(Dst, 13371, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2128 | #endif | 2128 | #endif |
| 2129 | break; | 2129 | break; |
| 2130 | 2130 | ||
| 2131 | case BC_ILOOP: | 2131 | case BC_ILOOP: |
| 2132 | dasm_put(Dst, 9572); | 2132 | dasm_put(Dst, 9573); |
| 2133 | break; | 2133 | break; |
| 2134 | 2134 | ||
| 2135 | case BC_JLOOP: | 2135 | case BC_JLOOP: |
| 2136 | #if LJ_HASJIT | 2136 | #if LJ_HASJIT |
| 2137 | dasm_put(Dst, 13607, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L), 9*16+4*8, -1*16, -2*16, -3*16, -4*16, -5*16, -6*16, -7*16, -8*16, -9*16); | 2137 | dasm_put(Dst, 13608, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L), 9*16+4*8, -1*16, -2*16, -3*16, -4*16, -5*16, -6*16, -7*16, -8*16, -9*16); |
| 2138 | #endif | 2138 | #endif |
| 2139 | break; | 2139 | break; |
| 2140 | 2140 | ||
| 2141 | case BC_JMP: | 2141 | case BC_JMP: |
| 2142 | dasm_put(Dst, 13716, -BCBIAS_J*4); | 2142 | dasm_put(Dst, 13717, -BCBIAS_J*4); |
| 2143 | break; | 2143 | break; |
| 2144 | 2144 | ||
| 2145 | /* -- Function headers -------------------------------------------------- */ | 2145 | /* -- Function headers -------------------------------------------------- */ |
| @@ -2153,7 +2153,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2153 | 2153 | ||
| 2154 | case BC_FUNCF: | 2154 | case BC_FUNCF: |
| 2155 | #if LJ_HASJIT | 2155 | #if LJ_HASJIT |
| 2156 | dasm_put(Dst, 13741, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2156 | dasm_put(Dst, 13742, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2157 | #endif | 2157 | #endif |
| 2158 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 2158 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
| 2159 | break; | 2159 | break; |
| @@ -2163,47 +2163,47 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2163 | break; | 2163 | break; |
| 2164 | #endif | 2164 | #endif |
| 2165 | case BC_IFUNCF: | 2165 | case BC_IFUNCF: |
| 2166 | dasm_put(Dst, 13762, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); | 2166 | dasm_put(Dst, 13763, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); |
| 2167 | if (op == BC_JFUNCF) { | 2167 | if (op == BC_JFUNCF) { |
| 2168 | dasm_put(Dst, 13792, BC_JLOOP); | 2168 | dasm_put(Dst, 13793, BC_JLOOP); |
| 2169 | } else { | 2169 | } else { |
| 2170 | dasm_put(Dst, 9572); | 2170 | dasm_put(Dst, 9573); |
| 2171 | } | 2171 | } |
| 2172 | dasm_put(Dst, 13801, LJ_TNIL); | 2172 | dasm_put(Dst, 13802, LJ_TNIL); |
| 2173 | break; | 2173 | break; |
| 2174 | 2174 | ||
| 2175 | case BC_JFUNCV: | 2175 | case BC_JFUNCV: |
| 2176 | #if !LJ_HASJIT | 2176 | #if !LJ_HASJIT |
| 2177 | break; | 2177 | break; |
| 2178 | #endif | 2178 | #endif |
| 2179 | dasm_put(Dst, 9047); | 2179 | dasm_put(Dst, 9048); |
| 2180 | break; /* NYI: compiled vararg functions. */ | 2180 | break; /* NYI: compiled vararg functions. */ |
| 2181 | 2181 | ||
| 2182 | case BC_IFUNCV: | 2182 | case BC_IFUNCV: |
| 2183 | dasm_put(Dst, 13823, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); | 2183 | dasm_put(Dst, 13824, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); |
| 2184 | if (op == BC_JFUNCV) { | 2184 | if (op == BC_JFUNCV) { |
| 2185 | dasm_put(Dst, 13792, BC_JLOOP); | 2185 | dasm_put(Dst, 13793, BC_JLOOP); |
| 2186 | } else { | 2186 | } else { |
| 2187 | dasm_put(Dst, 13914, -4+PC2PROTO(k)); | 2187 | dasm_put(Dst, 13915, -4+PC2PROTO(k)); |
| 2188 | } | 2188 | } |
| 2189 | dasm_put(Dst, 13937, LJ_TNIL); | 2189 | dasm_put(Dst, 13938, LJ_TNIL); |
| 2190 | break; | 2190 | break; |
| 2191 | 2191 | ||
| 2192 | case BC_FUNCC: | 2192 | case BC_FUNCC: |
| 2193 | case BC_FUNCCW: | 2193 | case BC_FUNCCW: |
| 2194 | dasm_put(Dst, 13959, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); | 2194 | dasm_put(Dst, 13960, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); |
| 2195 | if (op == BC_FUNCC) { | 2195 | if (op == BC_FUNCC) { |
| 2196 | dasm_put(Dst, 13989); | 2196 | dasm_put(Dst, 13990); |
| 2197 | } else { | 2197 | } else { |
| 2198 | dasm_put(Dst, 13993); | 2198 | dasm_put(Dst, 13994); |
| 2199 | } | 2199 | } |
| 2200 | dasm_put(Dst, 14001, DISPATCH_GL(vmstate), ~LJ_VMST_C); | 2200 | dasm_put(Dst, 14002, DISPATCH_GL(vmstate), ~LJ_VMST_C); |
| 2201 | if (op == BC_FUNCC) { | 2201 | if (op == BC_FUNCC) { |
| 2202 | dasm_put(Dst, 14010); | 2202 | dasm_put(Dst, 14011); |
| 2203 | } else { | 2203 | } else { |
| 2204 | dasm_put(Dst, 14014, DISPATCH_GL(wrapf)); | 2204 | dasm_put(Dst, 14015, DISPATCH_GL(wrapf)); |
| 2205 | } | 2205 | } |
| 2206 | dasm_put(Dst, 14019, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); | 2206 | dasm_put(Dst, 14020, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); |
| 2207 | break; | 2207 | break; |
| 2208 | 2208 | ||
| 2209 | /* ---------------------------------------------------------------------- */ | 2209 | /* ---------------------------------------------------------------------- */ |
| @@ -2231,7 +2231,7 @@ static int build_backend(BuildCtx *ctx) | |||
| 2231 | 2231 | ||
| 2232 | build_subroutines(ctx, cmov, sse); | 2232 | build_subroutines(ctx, cmov, sse); |
| 2233 | 2233 | ||
| 2234 | dasm_put(Dst, 14044); | 2234 | dasm_put(Dst, 14045); |
| 2235 | for (op = 0; op < BC__MAX; op++) | 2235 | for (op = 0; op < BC__MAX; op++) |
| 2236 | build_ins(ctx, (BCOp)op, op, cmov, sse); | 2236 | build_ins(ctx, (BCOp)op, op, cmov, sse); |
| 2237 | 2237 | ||
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc index 69672adc..bc128457 100644 --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc | |||
| @@ -2393,37 +2393,38 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) | |||
| 2393 | |.endif | 2393 | |.endif |
| 2394 | | call aword CFUNC:RD->f // (lua_State *L) | 2394 | | call aword CFUNC:RD->f // (lua_State *L) |
| 2395 | | mov BASE, L:RB->base | 2395 | | mov BASE, L:RB->base |
| 2396 | | // Either throws an error or recovers and returns 0 or MULTRES (+1). | 2396 | | // Either throws an error, or recovers and returns -1, 0 or nresults+1. |
| 2397 | | test RD, RD; jnz ->fff_res // Returned MULTRES (already in RD). | 2397 | | test RD, RD; jg ->fff_res // Returned nresults+1? |
| 2398 | |1: // Returned 0: retry fast path. | 2398 | |1: |
| 2399 | | mov RD, L:RB->top | 2399 | | mov RA, L:RB->top |
| 2400 | | sub RD, BASE | 2400 | | sub RA, BASE |
| 2401 | | shr RD, 3 | 2401 | | shr RA, 3 |
| 2402 | | add NARGS:RD, 1 | 2402 | | test RD, RD |
| 2403 | | lea NARGS:RD, [RA+1] | ||
| 2403 | | mov LFUNC:RB, [BASE-8] | 2404 | | mov LFUNC:RB, [BASE-8] |
| 2404 | | cmp dword [BASE-4], PC | 2405 | | jne >2 // Returned -1? |
| 2405 | | jne >2 // Tailcalled? | 2406 | | ins_callt // Returned 0: retry fast path. |
| 2406 | | ins_callt // Retry the call. | ||
| 2407 | | | 2407 | | |
| 2408 | |2: // Reconstruct previous base for vmeta_call. | 2408 | |2: // Reconstruct previous base for vmeta_call during tailcall. |
| 2409 | | mov RA, BASE | 2409 | | mov RA, BASE |
| 2410 | | test PC, FRAME_TYPE | 2410 | | test PC, FRAME_TYPE |
| 2411 | | jnz >3 | 2411 | | jnz >3 |
| 2412 | | movzx RB, PC_RA | 2412 | | movzx RB, PC_RA |
| 2413 | | not RBa // Note: ~RB = -(RB+1) | 2413 | | not RBa // Note: ~RB = -(RB+1) |
| 2414 | | lea BASE, [BASE+RB*8] // base = base - (RB+1)*8 | 2414 | | lea BASE, [BASE+RB*8] // base = base - (RB+1)*8 |
| 2415 | | jmp ->vm_call_dispatch // Resolve again. | 2415 | | jmp ->vm_call_dispatch // Resolve again for tailcall. |
| 2416 | |3: | 2416 | |3: |
| 2417 | | mov RB, PC | 2417 | | mov RB, PC |
| 2418 | | and RB, -8 | 2418 | | and RB, -8 |
| 2419 | | sub BASE, RB | 2419 | | sub BASE, RB |
| 2420 | | jmp ->vm_call_dispatch // Resolve again. | 2420 | | jmp ->vm_call_dispatch // Resolve again for tailcall. |
| 2421 | | | 2421 | | |
| 2422 | |5: // Grow stack for fallback handler. | 2422 | |5: // Grow stack for fallback handler. |
| 2423 | | mov FCARG2, LUA_MINSTACK | 2423 | | mov FCARG2, LUA_MINSTACK |
| 2424 | | mov FCARG1, L:RB | 2424 | | mov FCARG1, L:RB |
| 2425 | | call extern lj_state_growstack@8 // (lua_State *L, int n) | 2425 | | call extern lj_state_growstack@8 // (lua_State *L, int n) |
| 2426 | | mov BASE, L:RB->base | 2426 | | mov BASE, L:RB->base |
| 2427 | | xor RD, RD // Simulate a return 0. | ||
| 2427 | | jmp <1 // Dumb retry (goes through ff first). | 2428 | | jmp <1 // Dumb retry (goes through ff first). |
| 2428 | | | 2429 | | |
| 2429 | |->fff_gcstep: // Call GC step function. | 2430 | |->fff_gcstep: // Call GC step function. |
| @@ -4366,7 +4367,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 4366 | case BC_CALLMT: | 4367 | case BC_CALLMT: |
| 4367 | | ins_AD // RA = base, RD = extra_nargs | 4368 | | ins_AD // RA = base, RD = extra_nargs |
| 4368 | | add NARGS:RD, MULTRES | 4369 | | add NARGS:RD, MULTRES |
| 4369 | | // Fall through. Assumes BC_CALLMT follows and ins_AD is a no-op. | 4370 | | // Fall through. Assumes BC_CALLT follows and ins_AD is a no-op. |
| 4370 | break; | 4371 | break; |
| 4371 | case BC_CALLT: | 4372 | case BC_CALLT: |
| 4372 | | ins_AD // RA = base, RD = nargs+1 | 4373 | | ins_AD // RA = base, RD = nargs+1 |
diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h index c50b541a..bb1645ab 100644 --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #define DASM_SECTION_CODE_OP 0 | 12 | #define DASM_SECTION_CODE_OP 0 |
| 13 | #define DASM_SECTION_CODE_SUB 1 | 13 | #define DASM_SECTION_CODE_SUB 1 |
| 14 | #define DASM_MAXSECTION 2 | 14 | #define DASM_MAXSECTION 2 |
| 15 | static const unsigned char build_actionlist[15251] = { | 15 | static const unsigned char build_actionlist[15252] = { |
| 16 | 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141, | 16 | 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141, |
| 17 | 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36, | 17 | 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36, |
| 18 | 20,252,247,198,237,15,132,244,13,248,14,129,252,246,239,252,247,198,237,15, | 18 | 20,252,247,198,237,15,132,244,13,248,14,129,252,246,239,252,247,198,237,15, |
| @@ -389,12 +389,12 @@ static const unsigned char build_actionlist[15251] = { | |||
| 389 | 205,137,193,252,233,244,125,248,117,184,237,252,233,244,55,248,119,184,237, | 389 | 205,137,193,252,233,244,125,248,117,184,237,252,233,244,55,248,119,184,237, |
| 390 | 248,55,139,108,36,48,139,114,252,252,137,116,36,24,137,149,233,141,68,194, | 390 | 248,55,139,108,36,48,139,114,252,252,137,116,36,24,137,149,233,141,68,194, |
| 391 | 252,248,141,136,233,137,133,233,139,66,252,248,59,141,233,15,135,244,251, | 391 | 252,248,141,136,233,137,133,233,139,66,252,248,59,141,233,15,135,244,251, |
| 392 | 137,44,36,252,255,144,233,139,149,233,133,192,15,133,244,69,248,1,255,139, | 392 | 137,44,36,252,255,144,233,139,149,233,133,192,15,143,244,69,248,1,255,139, |
| 393 | 133,233,41,208,193,232,3,131,192,1,139,106,252,248,57,114,252,252,15,133, | 393 | 141,233,41,209,193,252,233,3,133,192,141,65,1,139,106,252,248,15,133,244, |
| 394 | 244,248,139,181,233,139,14,15,182,252,233,15,182,205,131,198,4,252,255,36, | 394 | 248,139,181,233,139,14,15,182,252,233,15,182,205,131,198,4,252,255,36,171, |
| 395 | 171,248,2,137,209,252,247,198,237,15,133,244,249,15,182,110,252,253,252,247, | 395 | 248,2,137,209,252,247,198,237,15,133,244,249,15,182,110,252,253,252,247,213, |
| 396 | 213,141,20,252,234,252,233,244,27,248,3,137,252,245,131,229,252,248,41,252, | 396 | 141,20,252,234,252,233,244,27,248,3,137,252,245,131,229,252,248,41,252,234, |
| 397 | 234,252,233,244,27,248,5,186,237,137,252,233,232,251,1,0,139,149,233,252, | 397 | 252,233,244,27,248,5,186,237,137,252,233,232,251,1,0,139,149,233,49,192,252, |
| 398 | 233,244,1,248,66,93,137,108,36,16,139,108,36,48,137,116,36,24,137,149,233, | 398 | 233,244,1,248,66,93,137,108,36,16,139,108,36,48,137,116,36,24,137,149,233, |
| 399 | 255,141,68,194,252,248,137,252,233,137,133,233,232,251,1,19,139,149,233,139, | 399 | 255,141,68,194,252,248,137,252,233,137,133,233,232,251,1,19,139,149,233,139, |
| 400 | 133,233,41,208,193,232,3,131,192,1,139,108,36,16,85,195,248,136,255,15,182, | 400 | 133,233,41,208,193,232,3,131,192,1,139,108,36,16,85,195,248,136,255,15,182, |
| @@ -1434,117 +1434,117 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) | |||
| 1434 | } | 1434 | } |
| 1435 | dasm_put(Dst, 7731, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); | 1435 | dasm_put(Dst, 7731, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); |
| 1436 | dasm_put(Dst, 7809, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); | 1436 | dasm_put(Dst, 7809, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base)); |
| 1437 | dasm_put(Dst, 7932, Dt1(->top), Dt1(->base), Dt1(->top)); | 1437 | dasm_put(Dst, 7933, Dt1(->top), Dt1(->base), Dt1(->top)); |
| 1438 | #if LJ_HASJIT | 1438 | #if LJ_HASJIT |
| 1439 | dasm_put(Dst, 7970, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); | 1439 | dasm_put(Dst, 7971, DISPATCH_GL(hookmask), HOOK_VMEVENT, HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount)); |
| 1440 | #endif | 1440 | #endif |
| 1441 | dasm_put(Dst, 8001, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); | 1441 | dasm_put(Dst, 8002, DISPATCH_GL(hookmask), HOOK_ACTIVE, DISPATCH_GL(hookmask), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE); |
| 1442 | dasm_put(Dst, 8052, Dt1(->base), Dt1(->base), GG_DISP2STATIC); | 1442 | dasm_put(Dst, 8053, Dt1(->base), Dt1(->base), GG_DISP2STATIC); |
| 1443 | #if LJ_HASJIT | 1443 | #if LJ_HASJIT |
| 1444 | dasm_put(Dst, 8118, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); | 1444 | dasm_put(Dst, 8119, Dt7(->pc), PC2PROTO(framesize), Dt1(->base), Dt1(->top), GG_DISP2J, DISPATCH_J(L)); |
| 1445 | #endif | 1445 | #endif |
| 1446 | dasm_put(Dst, 8164); | 1446 | dasm_put(Dst, 8165); |
| 1447 | #if LJ_HASJIT | 1447 | #if LJ_HASJIT |
| 1448 | dasm_put(Dst, 7996); | 1448 | dasm_put(Dst, 7997); |
| 1449 | #endif | 1449 | #endif |
| 1450 | dasm_put(Dst, 8171); | 1450 | dasm_put(Dst, 8172); |
| 1451 | #if LJ_HASJIT | 1451 | #if LJ_HASJIT |
| 1452 | dasm_put(Dst, 8174); | 1452 | dasm_put(Dst, 8175); |
| 1453 | #endif | 1453 | #endif |
| 1454 | dasm_put(Dst, 8184, Dt1(->base), Dt1(->top)); | 1454 | dasm_put(Dst, 8185, Dt1(->base), Dt1(->top)); |
| 1455 | #if LJ_HASJIT | 1455 | #if LJ_HASJIT |
| 1456 | dasm_put(Dst, 8218); | 1456 | dasm_put(Dst, 8219); |
| 1457 | #endif | 1457 | #endif |
| 1458 | dasm_put(Dst, 8223, Dt1(->base), Dt1(->top)); | 1458 | dasm_put(Dst, 8224, Dt1(->base), Dt1(->top)); |
| 1459 | #if LJ_HASJIT | 1459 | #if LJ_HASJIT |
| 1460 | dasm_put(Dst, 8252, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 8*8+16, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); | 1460 | dasm_put(Dst, 8253, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 8*8+16, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), DISPATCH_GL(jit_L), Dt1(->base), GG_DISP2J, Dt1(->cframe), CFRAME_RAWMASK, CFRAME_OFS_L, Dt1(->base), CFRAME_OFS_PC); |
| 1461 | #endif | 1461 | #endif |
| 1462 | dasm_put(Dst, 8395); | 1462 | dasm_put(Dst, 8396); |
| 1463 | #if LJ_HASJIT | 1463 | #if LJ_HASJIT |
| 1464 | dasm_put(Dst, 8398, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); | 1464 | dasm_put(Dst, 8399, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, BC_FUNCF); |
| 1465 | #endif | 1465 | #endif |
| 1466 | dasm_put(Dst, 8476); | 1466 | dasm_put(Dst, 8477); |
| 1467 | if (!sse) { | 1467 | if (!sse) { |
| 1468 | dasm_put(Dst, 8479); | 1468 | dasm_put(Dst, 8480); |
| 1469 | } | 1469 | } |
| 1470 | dasm_put(Dst, 8524); | 1470 | dasm_put(Dst, 8525); |
| 1471 | if (!sse) { | 1471 | if (!sse) { |
| 1472 | dasm_put(Dst, 8626); | 1472 | dasm_put(Dst, 8627); |
| 1473 | } | 1473 | } |
| 1474 | dasm_put(Dst, 8671); | 1474 | dasm_put(Dst, 8672); |
| 1475 | if (!sse) { | 1475 | if (!sse) { |
| 1476 | dasm_put(Dst, 8773); | 1476 | dasm_put(Dst, 8774); |
| 1477 | } | 1477 | } |
| 1478 | dasm_put(Dst, 8812); | 1478 | dasm_put(Dst, 8813); |
| 1479 | if (sse) { | 1479 | if (sse) { |
| 1480 | dasm_put(Dst, 8917); | 1480 | dasm_put(Dst, 8918); |
| 1481 | } else { | 1481 | } else { |
| 1482 | dasm_put(Dst, 9047); | 1482 | dasm_put(Dst, 9048); |
| 1483 | } | 1483 | } |
| 1484 | dasm_put(Dst, 9094); | 1484 | dasm_put(Dst, 9095); |
| 1485 | if (!sse) { | 1485 | if (!sse) { |
| 1486 | dasm_put(Dst, 9168); | 1486 | dasm_put(Dst, 9169); |
| 1487 | if (cmov) { | 1487 | if (cmov) { |
| 1488 | dasm_put(Dst, 9179); | 1488 | dasm_put(Dst, 9180); |
| 1489 | } else { | 1489 | } else { |
| 1490 | dasm_put(Dst, 9183); | 1490 | dasm_put(Dst, 9184); |
| 1491 | } | 1491 | } |
| 1492 | dasm_put(Dst, 9190); | 1492 | dasm_put(Dst, 9191); |
| 1493 | dasm_put(Dst, 9264); | 1493 | dasm_put(Dst, 9265); |
| 1494 | dasm_put(Dst, 9364); | 1494 | dasm_put(Dst, 9365); |
| 1495 | if (cmov) { | 1495 | if (cmov) { |
| 1496 | dasm_put(Dst, 9367); | 1496 | dasm_put(Dst, 9368); |
| 1497 | } else { | 1497 | } else { |
| 1498 | dasm_put(Dst, 9371); | 1498 | dasm_put(Dst, 9372); |
| 1499 | } | 1499 | } |
| 1500 | dasm_put(Dst, 9378); | 1500 | dasm_put(Dst, 9379); |
| 1501 | if (cmov) { | 1501 | if (cmov) { |
| 1502 | dasm_put(Dst, 9179); | 1502 | dasm_put(Dst, 9180); |
| 1503 | } else { | 1503 | } else { |
| 1504 | dasm_put(Dst, 9183); | 1504 | dasm_put(Dst, 9184); |
| 1505 | } | 1505 | } |
| 1506 | dasm_put(Dst, 9396); | 1506 | dasm_put(Dst, 9397); |
| 1507 | } else { | 1507 | } else { |
| 1508 | dasm_put(Dst, 9475); | 1508 | dasm_put(Dst, 9476); |
| 1509 | } | 1509 | } |
| 1510 | dasm_put(Dst, 9478); | 1510 | dasm_put(Dst, 9479); |
| 1511 | dasm_put(Dst, 9563); | 1511 | dasm_put(Dst, 9564); |
| 1512 | dasm_put(Dst, 9694); | 1512 | dasm_put(Dst, 9695); |
| 1513 | dasm_put(Dst, 9893); | 1513 | dasm_put(Dst, 9894); |
| 1514 | #if LJ_HASJIT | 1514 | #if LJ_HASJIT |
| 1515 | if (sse) { | 1515 | if (sse) { |
| 1516 | dasm_put(Dst, 9916); | 1516 | dasm_put(Dst, 9917); |
| 1517 | dasm_put(Dst, 9973); | 1517 | dasm_put(Dst, 9974); |
| 1518 | dasm_put(Dst, 10064); | 1518 | dasm_put(Dst, 10065); |
| 1519 | } else { | 1519 | } else { |
| 1520 | dasm_put(Dst, 10106); | 1520 | dasm_put(Dst, 10107); |
| 1521 | dasm_put(Dst, 10198); | 1521 | dasm_put(Dst, 10199); |
| 1522 | } | 1522 | } |
| 1523 | dasm_put(Dst, 10244); | 1523 | dasm_put(Dst, 10245); |
| 1524 | #endif | 1524 | #endif |
| 1525 | dasm_put(Dst, 10248); | 1525 | dasm_put(Dst, 10249); |
| 1526 | if (sse) { | 1526 | if (sse) { |
| 1527 | dasm_put(Dst, 10251); | 1527 | dasm_put(Dst, 10252); |
| 1528 | dasm_put(Dst, 10356); | 1528 | dasm_put(Dst, 10357); |
| 1529 | dasm_put(Dst, 10439); | 1529 | dasm_put(Dst, 10440); |
| 1530 | } else { | 1530 | } else { |
| 1531 | dasm_put(Dst, 10511); | 1531 | dasm_put(Dst, 10512); |
| 1532 | dasm_put(Dst, 10594); | 1532 | dasm_put(Dst, 10595); |
| 1533 | if (cmov) { | 1533 | if (cmov) { |
| 1534 | dasm_put(Dst, 10649); | 1534 | dasm_put(Dst, 10650); |
| 1535 | } else { | 1535 | } else { |
| 1536 | dasm_put(Dst, 10668); | 1536 | dasm_put(Dst, 10669); |
| 1537 | } | 1537 | } |
| 1538 | dasm_put(Dst, 10244); | 1538 | dasm_put(Dst, 10245); |
| 1539 | } | 1539 | } |
| 1540 | dasm_put(Dst, 10709); | 1540 | dasm_put(Dst, 10710); |
| 1541 | } | 1541 | } |
| 1542 | 1542 | ||
| 1543 | /* Generate the code for a single instruction. */ | 1543 | /* Generate the code for a single instruction. */ |
| 1544 | static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | 1544 | static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) |
| 1545 | { | 1545 | { |
| 1546 | int vk = 0; | 1546 | int vk = 0; |
| 1547 | dasm_put(Dst, 10763, defop); | 1547 | dasm_put(Dst, 10764, defop); |
| 1548 | 1548 | ||
| 1549 | switch (op) { | 1549 | switch (op) { |
| 1550 | 1550 | ||
| @@ -1553,611 +1553,611 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 1553 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ | 1553 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ |
| 1554 | 1554 | ||
| 1555 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: | 1555 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: |
| 1556 | dasm_put(Dst, 10765, LJ_TISNUM, LJ_TISNUM); | 1556 | dasm_put(Dst, 10766, LJ_TISNUM, LJ_TISNUM); |
| 1557 | if (sse) { | 1557 | if (sse) { |
| 1558 | dasm_put(Dst, 10786); | 1558 | dasm_put(Dst, 10787); |
| 1559 | } else { | 1559 | } else { |
| 1560 | dasm_put(Dst, 10801); | 1560 | dasm_put(Dst, 10802); |
| 1561 | if (cmov) { | 1561 | if (cmov) { |
| 1562 | dasm_put(Dst, 10811); | 1562 | dasm_put(Dst, 10812); |
| 1563 | } else { | 1563 | } else { |
| 1564 | dasm_put(Dst, 10817); | 1564 | dasm_put(Dst, 10818); |
| 1565 | } | 1565 | } |
| 1566 | } | 1566 | } |
| 1567 | switch (op) { | 1567 | switch (op) { |
| 1568 | case BC_ISLT: | 1568 | case BC_ISLT: |
| 1569 | dasm_put(Dst, 10824); | 1569 | dasm_put(Dst, 10825); |
| 1570 | break; | 1570 | break; |
| 1571 | case BC_ISGE: | 1571 | case BC_ISGE: |
| 1572 | dasm_put(Dst, 10059); | 1572 | dasm_put(Dst, 10060); |
| 1573 | break; | 1573 | break; |
| 1574 | case BC_ISLE: | 1574 | case BC_ISLE: |
| 1575 | dasm_put(Dst, 6186); | 1575 | dasm_put(Dst, 6186); |
| 1576 | break; | 1576 | break; |
| 1577 | case BC_ISGT: | 1577 | case BC_ISGT: |
| 1578 | dasm_put(Dst, 10829); | 1578 | dasm_put(Dst, 10830); |
| 1579 | break; | 1579 | break; |
| 1580 | default: break; /* Shut up GCC. */ | 1580 | default: break; /* Shut up GCC. */ |
| 1581 | } | 1581 | } |
| 1582 | dasm_put(Dst, 10834, -BCBIAS_J*4); | 1582 | dasm_put(Dst, 10835, -BCBIAS_J*4); |
| 1583 | break; | 1583 | break; |
| 1584 | 1584 | ||
| 1585 | case BC_ISEQV: case BC_ISNEV: | 1585 | case BC_ISEQV: case BC_ISNEV: |
| 1586 | vk = op == BC_ISEQV; | 1586 | vk = op == BC_ISEQV; |
| 1587 | dasm_put(Dst, 10867, LJ_TISNUM, LJ_TISNUM); | 1587 | dasm_put(Dst, 10868, LJ_TISNUM, LJ_TISNUM); |
| 1588 | if (sse) { | 1588 | if (sse) { |
| 1589 | dasm_put(Dst, 10893); | 1589 | dasm_put(Dst, 10894); |
| 1590 | } else { | 1590 | } else { |
| 1591 | dasm_put(Dst, 10905); | 1591 | dasm_put(Dst, 10906); |
| 1592 | if (cmov) { | 1592 | if (cmov) { |
| 1593 | dasm_put(Dst, 10811); | 1593 | dasm_put(Dst, 10812); |
| 1594 | } else { | 1594 | } else { |
| 1595 | dasm_put(Dst, 10817); | 1595 | dasm_put(Dst, 10818); |
| 1596 | } | 1596 | } |
| 1597 | } | 1597 | } |
| 1598 | iseqne_fp: | 1598 | iseqne_fp: |
| 1599 | if (vk) { | 1599 | if (vk) { |
| 1600 | dasm_put(Dst, 10912); | 1600 | dasm_put(Dst, 10913); |
| 1601 | } else { | 1601 | } else { |
| 1602 | dasm_put(Dst, 10921); | 1602 | dasm_put(Dst, 10922); |
| 1603 | } | 1603 | } |
| 1604 | iseqne_end: | 1604 | iseqne_end: |
| 1605 | if (vk) { | 1605 | if (vk) { |
| 1606 | dasm_put(Dst, 10930, -BCBIAS_J*4); | 1606 | dasm_put(Dst, 10931, -BCBIAS_J*4); |
| 1607 | } else { | 1607 | } else { |
| 1608 | dasm_put(Dst, 10945, -BCBIAS_J*4); | 1608 | dasm_put(Dst, 10946, -BCBIAS_J*4); |
| 1609 | } | 1609 | } |
| 1610 | dasm_put(Dst, 10848); | 1610 | dasm_put(Dst, 10849); |
| 1611 | if (op == BC_ISEQV || op == BC_ISNEV) { | 1611 | if (op == BC_ISEQV || op == BC_ISNEV) { |
| 1612 | dasm_put(Dst, 10960, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); | 1612 | dasm_put(Dst, 10961, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); |
| 1613 | if (vk) { | 1613 | if (vk) { |
| 1614 | dasm_put(Dst, 11018); | 1614 | dasm_put(Dst, 11019); |
| 1615 | } else { | 1615 | } else { |
| 1616 | dasm_put(Dst, 11022); | 1616 | dasm_put(Dst, 11023); |
| 1617 | } | 1617 | } |
| 1618 | dasm_put(Dst, 11028); | 1618 | dasm_put(Dst, 11029); |
| 1619 | } | 1619 | } |
| 1620 | break; | 1620 | break; |
| 1621 | case BC_ISEQS: case BC_ISNES: | 1621 | case BC_ISEQS: case BC_ISNES: |
| 1622 | vk = op == BC_ISEQS; | 1622 | vk = op == BC_ISEQS; |
| 1623 | dasm_put(Dst, 11033, LJ_TSTR); | 1623 | dasm_put(Dst, 11034, LJ_TSTR); |
| 1624 | iseqne_test: | 1624 | iseqne_test: |
| 1625 | if (vk) { | 1625 | if (vk) { |
| 1626 | dasm_put(Dst, 10916); | 1626 | dasm_put(Dst, 10917); |
| 1627 | } else { | 1627 | } else { |
| 1628 | dasm_put(Dst, 2814); | 1628 | dasm_put(Dst, 2814); |
| 1629 | } | 1629 | } |
| 1630 | goto iseqne_end; | 1630 | goto iseqne_end; |
| 1631 | case BC_ISEQN: case BC_ISNEN: | 1631 | case BC_ISEQN: case BC_ISNEN: |
| 1632 | vk = op == BC_ISEQN; | 1632 | vk = op == BC_ISEQN; |
| 1633 | dasm_put(Dst, 11056, LJ_TISNUM); | 1633 | dasm_put(Dst, 11057, LJ_TISNUM); |
| 1634 | if (sse) { | 1634 | if (sse) { |
| 1635 | dasm_put(Dst, 11070); | 1635 | dasm_put(Dst, 11071); |
| 1636 | } else { | 1636 | } else { |
| 1637 | dasm_put(Dst, 11082); | 1637 | dasm_put(Dst, 11083); |
| 1638 | if (cmov) { | 1638 | if (cmov) { |
| 1639 | dasm_put(Dst, 10811); | 1639 | dasm_put(Dst, 10812); |
| 1640 | } else { | 1640 | } else { |
| 1641 | dasm_put(Dst, 10817); | 1641 | dasm_put(Dst, 10818); |
| 1642 | } | 1642 | } |
| 1643 | } | 1643 | } |
| 1644 | goto iseqne_fp; | 1644 | goto iseqne_fp; |
| 1645 | case BC_ISEQP: case BC_ISNEP: | 1645 | case BC_ISEQP: case BC_ISNEP: |
| 1646 | vk = op == BC_ISEQP; | 1646 | vk = op == BC_ISEQP; |
| 1647 | dasm_put(Dst, 11089); | 1647 | dasm_put(Dst, 11090); |
| 1648 | goto iseqne_test; | 1648 | goto iseqne_test; |
| 1649 | 1649 | ||
| 1650 | /* -- Unary test and copy ops ------------------------------------------- */ | 1650 | /* -- Unary test and copy ops ------------------------------------------- */ |
| 1651 | 1651 | ||
| 1652 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | 1652 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: |
| 1653 | dasm_put(Dst, 11100, LJ_TISTRUECOND); | 1653 | dasm_put(Dst, 11101, LJ_TISTRUECOND); |
| 1654 | if (op == BC_IST || op == BC_ISTC) { | 1654 | if (op == BC_IST || op == BC_ISTC) { |
| 1655 | dasm_put(Dst, 11112); | 1655 | dasm_put(Dst, 11113); |
| 1656 | } else { | 1656 | } else { |
| 1657 | dasm_put(Dst, 11117); | 1657 | dasm_put(Dst, 11118); |
| 1658 | } | 1658 | } |
| 1659 | if (op == BC_ISTC || op == BC_ISFC) { | 1659 | if (op == BC_ISTC || op == BC_ISFC) { |
| 1660 | dasm_put(Dst, 11122); | 1660 | dasm_put(Dst, 11123); |
| 1661 | } | 1661 | } |
| 1662 | dasm_put(Dst, 11133, -BCBIAS_J*4); | 1662 | dasm_put(Dst, 11134, -BCBIAS_J*4); |
| 1663 | break; | 1663 | break; |
| 1664 | 1664 | ||
| 1665 | /* -- Unary ops --------------------------------------------------------- */ | 1665 | /* -- Unary ops --------------------------------------------------------- */ |
| 1666 | 1666 | ||
| 1667 | case BC_MOV: | 1667 | case BC_MOV: |
| 1668 | dasm_put(Dst, 11164); | 1668 | dasm_put(Dst, 11165); |
| 1669 | break; | 1669 | break; |
| 1670 | case BC_NOT: | 1670 | case BC_NOT: |
| 1671 | dasm_put(Dst, 11197, LJ_TISTRUECOND, LJ_TTRUE); | 1671 | dasm_put(Dst, 11198, LJ_TISTRUECOND, LJ_TTRUE); |
| 1672 | break; | 1672 | break; |
| 1673 | case BC_UNM: | 1673 | case BC_UNM: |
| 1674 | dasm_put(Dst, 11232, LJ_TISNUM); | 1674 | dasm_put(Dst, 11233, LJ_TISNUM); |
| 1675 | if (sse) { | 1675 | if (sse) { |
| 1676 | dasm_put(Dst, 11243); | 1676 | dasm_put(Dst, 11244); |
| 1677 | } else { | 1677 | } else { |
| 1678 | dasm_put(Dst, 11273); | 1678 | dasm_put(Dst, 11274); |
| 1679 | } | 1679 | } |
| 1680 | dasm_put(Dst, 10848); | 1680 | dasm_put(Dst, 10849); |
| 1681 | break; | 1681 | break; |
| 1682 | case BC_LEN: | 1682 | case BC_LEN: |
| 1683 | dasm_put(Dst, 11282, LJ_TSTR); | 1683 | dasm_put(Dst, 11283, LJ_TSTR); |
| 1684 | if (sse) { | 1684 | if (sse) { |
| 1685 | dasm_put(Dst, 11296, Dt5(->len)); | 1685 | dasm_put(Dst, 11297, Dt5(->len)); |
| 1686 | } else { | 1686 | } else { |
| 1687 | dasm_put(Dst, 11314, Dt5(->len)); | 1687 | dasm_put(Dst, 11315, Dt5(->len)); |
| 1688 | } | 1688 | } |
| 1689 | dasm_put(Dst, 11323, LJ_TTAB); | 1689 | dasm_put(Dst, 11324, LJ_TTAB); |
| 1690 | if (sse) { | 1690 | if (sse) { |
| 1691 | dasm_put(Dst, 11363); | 1691 | dasm_put(Dst, 11364); |
| 1692 | } else { | 1692 | } else { |
| 1693 | dasm_put(Dst, 11372); | 1693 | dasm_put(Dst, 11373); |
| 1694 | } | 1694 | } |
| 1695 | dasm_put(Dst, 11382); | 1695 | dasm_put(Dst, 11383); |
| 1696 | break; | 1696 | break; |
| 1697 | 1697 | ||
| 1698 | /* -- Binary ops -------------------------------------------------------- */ | 1698 | /* -- Binary ops -------------------------------------------------------- */ |
| 1699 | 1699 | ||
| 1700 | 1700 | ||
| 1701 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | 1701 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: |
| 1702 | dasm_put(Dst, 11392); | 1702 | dasm_put(Dst, 11393); |
| 1703 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1703 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1704 | switch (vk) { | 1704 | switch (vk) { |
| 1705 | case 0: | 1705 | case 0: |
| 1706 | dasm_put(Dst, 11400, LJ_TISNUM); | 1706 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1707 | if (sse) { | 1707 | if (sse) { |
| 1708 | dasm_put(Dst, 11412); | 1708 | dasm_put(Dst, 11413); |
| 1709 | } else { | 1709 | } else { |
| 1710 | dasm_put(Dst, 11426); | 1710 | dasm_put(Dst, 11427); |
| 1711 | } | 1711 | } |
| 1712 | break; | 1712 | break; |
| 1713 | case 1: | 1713 | case 1: |
| 1714 | dasm_put(Dst, 11434, LJ_TISNUM); | 1714 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1715 | if (sse) { | 1715 | if (sse) { |
| 1716 | dasm_put(Dst, 11446); | 1716 | dasm_put(Dst, 11447); |
| 1717 | } else { | 1717 | } else { |
| 1718 | dasm_put(Dst, 11460); | 1718 | dasm_put(Dst, 11461); |
| 1719 | } | 1719 | } |
| 1720 | break; | 1720 | break; |
| 1721 | default: | 1721 | default: |
| 1722 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1722 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1723 | if (sse) { | 1723 | if (sse) { |
| 1724 | dasm_put(Dst, 11490); | 1724 | dasm_put(Dst, 11491); |
| 1725 | } else { | 1725 | } else { |
| 1726 | dasm_put(Dst, 11504); | 1726 | dasm_put(Dst, 11505); |
| 1727 | } | 1727 | } |
| 1728 | break; | 1728 | break; |
| 1729 | } | 1729 | } |
| 1730 | if (sse) { | 1730 | if (sse) { |
| 1731 | dasm_put(Dst, 11266); | 1731 | dasm_put(Dst, 11267); |
| 1732 | } else { | 1732 | } else { |
| 1733 | dasm_put(Dst, 11278); | 1733 | dasm_put(Dst, 11279); |
| 1734 | } | 1734 | } |
| 1735 | dasm_put(Dst, 10848); | 1735 | dasm_put(Dst, 10849); |
| 1736 | break; | 1736 | break; |
| 1737 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | 1737 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: |
| 1738 | dasm_put(Dst, 11392); | 1738 | dasm_put(Dst, 11393); |
| 1739 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1739 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1740 | switch (vk) { | 1740 | switch (vk) { |
| 1741 | case 0: | 1741 | case 0: |
| 1742 | dasm_put(Dst, 11400, LJ_TISNUM); | 1742 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1743 | if (sse) { | 1743 | if (sse) { |
| 1744 | dasm_put(Dst, 11512); | 1744 | dasm_put(Dst, 11513); |
| 1745 | } else { | 1745 | } else { |
| 1746 | dasm_put(Dst, 11526); | 1746 | dasm_put(Dst, 11527); |
| 1747 | } | 1747 | } |
| 1748 | break; | 1748 | break; |
| 1749 | case 1: | 1749 | case 1: |
| 1750 | dasm_put(Dst, 11434, LJ_TISNUM); | 1750 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1751 | if (sse) { | 1751 | if (sse) { |
| 1752 | dasm_put(Dst, 11534); | 1752 | dasm_put(Dst, 11535); |
| 1753 | } else { | 1753 | } else { |
| 1754 | dasm_put(Dst, 11548); | 1754 | dasm_put(Dst, 11549); |
| 1755 | } | 1755 | } |
| 1756 | break; | 1756 | break; |
| 1757 | default: | 1757 | default: |
| 1758 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1758 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1759 | if (sse) { | 1759 | if (sse) { |
| 1760 | dasm_put(Dst, 11556); | 1760 | dasm_put(Dst, 11557); |
| 1761 | } else { | 1761 | } else { |
| 1762 | dasm_put(Dst, 11570); | 1762 | dasm_put(Dst, 11571); |
| 1763 | } | 1763 | } |
| 1764 | break; | 1764 | break; |
| 1765 | } | 1765 | } |
| 1766 | if (sse) { | 1766 | if (sse) { |
| 1767 | dasm_put(Dst, 11266); | 1767 | dasm_put(Dst, 11267); |
| 1768 | } else { | 1768 | } else { |
| 1769 | dasm_put(Dst, 11278); | 1769 | dasm_put(Dst, 11279); |
| 1770 | } | 1770 | } |
| 1771 | dasm_put(Dst, 10848); | 1771 | dasm_put(Dst, 10849); |
| 1772 | break; | 1772 | break; |
| 1773 | case BC_MULVN: case BC_MULNV: case BC_MULVV: | 1773 | case BC_MULVN: case BC_MULNV: case BC_MULVV: |
| 1774 | dasm_put(Dst, 11392); | 1774 | dasm_put(Dst, 11393); |
| 1775 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1775 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1776 | switch (vk) { | 1776 | switch (vk) { |
| 1777 | case 0: | 1777 | case 0: |
| 1778 | dasm_put(Dst, 11400, LJ_TISNUM); | 1778 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1779 | if (sse) { | 1779 | if (sse) { |
| 1780 | dasm_put(Dst, 11578); | 1780 | dasm_put(Dst, 11579); |
| 1781 | } else { | 1781 | } else { |
| 1782 | dasm_put(Dst, 11592); | 1782 | dasm_put(Dst, 11593); |
| 1783 | } | 1783 | } |
| 1784 | break; | 1784 | break; |
| 1785 | case 1: | 1785 | case 1: |
| 1786 | dasm_put(Dst, 11434, LJ_TISNUM); | 1786 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1787 | if (sse) { | 1787 | if (sse) { |
| 1788 | dasm_put(Dst, 11600); | 1788 | dasm_put(Dst, 11601); |
| 1789 | } else { | 1789 | } else { |
| 1790 | dasm_put(Dst, 11614); | 1790 | dasm_put(Dst, 11615); |
| 1791 | } | 1791 | } |
| 1792 | break; | 1792 | break; |
| 1793 | default: | 1793 | default: |
| 1794 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1794 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1795 | if (sse) { | 1795 | if (sse) { |
| 1796 | dasm_put(Dst, 11622); | 1796 | dasm_put(Dst, 11623); |
| 1797 | } else { | 1797 | } else { |
| 1798 | dasm_put(Dst, 11636); | 1798 | dasm_put(Dst, 11637); |
| 1799 | } | 1799 | } |
| 1800 | break; | 1800 | break; |
| 1801 | } | 1801 | } |
| 1802 | if (sse) { | 1802 | if (sse) { |
| 1803 | dasm_put(Dst, 11266); | 1803 | dasm_put(Dst, 11267); |
| 1804 | } else { | 1804 | } else { |
| 1805 | dasm_put(Dst, 11278); | 1805 | dasm_put(Dst, 11279); |
| 1806 | } | 1806 | } |
| 1807 | dasm_put(Dst, 10848); | 1807 | dasm_put(Dst, 10849); |
| 1808 | break; | 1808 | break; |
| 1809 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | 1809 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: |
| 1810 | dasm_put(Dst, 11392); | 1810 | dasm_put(Dst, 11393); |
| 1811 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1811 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1812 | switch (vk) { | 1812 | switch (vk) { |
| 1813 | case 0: | 1813 | case 0: |
| 1814 | dasm_put(Dst, 11400, LJ_TISNUM); | 1814 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1815 | if (sse) { | 1815 | if (sse) { |
| 1816 | dasm_put(Dst, 11644); | 1816 | dasm_put(Dst, 11645); |
| 1817 | } else { | 1817 | } else { |
| 1818 | dasm_put(Dst, 11658); | 1818 | dasm_put(Dst, 11659); |
| 1819 | } | 1819 | } |
| 1820 | break; | 1820 | break; |
| 1821 | case 1: | 1821 | case 1: |
| 1822 | dasm_put(Dst, 11434, LJ_TISNUM); | 1822 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1823 | if (sse) { | 1823 | if (sse) { |
| 1824 | dasm_put(Dst, 11666); | 1824 | dasm_put(Dst, 11667); |
| 1825 | } else { | 1825 | } else { |
| 1826 | dasm_put(Dst, 11680); | 1826 | dasm_put(Dst, 11681); |
| 1827 | } | 1827 | } |
| 1828 | break; | 1828 | break; |
| 1829 | default: | 1829 | default: |
| 1830 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1830 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1831 | if (sse) { | 1831 | if (sse) { |
| 1832 | dasm_put(Dst, 11688); | 1832 | dasm_put(Dst, 11689); |
| 1833 | } else { | 1833 | } else { |
| 1834 | dasm_put(Dst, 11702); | 1834 | dasm_put(Dst, 11703); |
| 1835 | } | 1835 | } |
| 1836 | break; | 1836 | break; |
| 1837 | } | 1837 | } |
| 1838 | if (sse) { | 1838 | if (sse) { |
| 1839 | dasm_put(Dst, 11266); | 1839 | dasm_put(Dst, 11267); |
| 1840 | } else { | 1840 | } else { |
| 1841 | dasm_put(Dst, 11278); | 1841 | dasm_put(Dst, 11279); |
| 1842 | } | 1842 | } |
| 1843 | dasm_put(Dst, 10848); | 1843 | dasm_put(Dst, 10849); |
| 1844 | break; | 1844 | break; |
| 1845 | case BC_MODVN: | 1845 | case BC_MODVN: |
| 1846 | dasm_put(Dst, 11392); | 1846 | dasm_put(Dst, 11393); |
| 1847 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1847 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1848 | switch (vk) { | 1848 | switch (vk) { |
| 1849 | case 0: | 1849 | case 0: |
| 1850 | dasm_put(Dst, 11400, LJ_TISNUM); | 1850 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1851 | if (sse) { | 1851 | if (sse) { |
| 1852 | dasm_put(Dst, 11710); | 1852 | dasm_put(Dst, 11711); |
| 1853 | } else { | 1853 | } else { |
| 1854 | dasm_put(Dst, 11724); | 1854 | dasm_put(Dst, 11725); |
| 1855 | } | 1855 | } |
| 1856 | break; | 1856 | break; |
| 1857 | case 1: | 1857 | case 1: |
| 1858 | dasm_put(Dst, 11434, LJ_TISNUM); | 1858 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1859 | if (sse) { | 1859 | if (sse) { |
| 1860 | dasm_put(Dst, 11732); | 1860 | dasm_put(Dst, 11733); |
| 1861 | } else { | 1861 | } else { |
| 1862 | dasm_put(Dst, 11746); | 1862 | dasm_put(Dst, 11747); |
| 1863 | } | 1863 | } |
| 1864 | break; | 1864 | break; |
| 1865 | default: | 1865 | default: |
| 1866 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1866 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1867 | if (sse) { | 1867 | if (sse) { |
| 1868 | dasm_put(Dst, 11754); | 1868 | dasm_put(Dst, 11755); |
| 1869 | } else { | 1869 | } else { |
| 1870 | dasm_put(Dst, 11768); | 1870 | dasm_put(Dst, 11769); |
| 1871 | } | 1871 | } |
| 1872 | break; | 1872 | break; |
| 1873 | } | 1873 | } |
| 1874 | dasm_put(Dst, 11776); | 1874 | dasm_put(Dst, 11777); |
| 1875 | if (sse) { | 1875 | if (sse) { |
| 1876 | dasm_put(Dst, 11266); | 1876 | dasm_put(Dst, 11267); |
| 1877 | } else { | 1877 | } else { |
| 1878 | dasm_put(Dst, 11278); | 1878 | dasm_put(Dst, 11279); |
| 1879 | } | 1879 | } |
| 1880 | dasm_put(Dst, 10848); | 1880 | dasm_put(Dst, 10849); |
| 1881 | break; | 1881 | break; |
| 1882 | case BC_MODNV: case BC_MODVV: | 1882 | case BC_MODNV: case BC_MODVV: |
| 1883 | dasm_put(Dst, 11392); | 1883 | dasm_put(Dst, 11393); |
| 1884 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1884 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1885 | switch (vk) { | 1885 | switch (vk) { |
| 1886 | case 0: | 1886 | case 0: |
| 1887 | dasm_put(Dst, 11400, LJ_TISNUM); | 1887 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1888 | if (sse) { | 1888 | if (sse) { |
| 1889 | dasm_put(Dst, 11710); | 1889 | dasm_put(Dst, 11711); |
| 1890 | } else { | 1890 | } else { |
| 1891 | dasm_put(Dst, 11724); | 1891 | dasm_put(Dst, 11725); |
| 1892 | } | 1892 | } |
| 1893 | break; | 1893 | break; |
| 1894 | case 1: | 1894 | case 1: |
| 1895 | dasm_put(Dst, 11434, LJ_TISNUM); | 1895 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1896 | if (sse) { | 1896 | if (sse) { |
| 1897 | dasm_put(Dst, 11732); | 1897 | dasm_put(Dst, 11733); |
| 1898 | } else { | 1898 | } else { |
| 1899 | dasm_put(Dst, 11746); | 1899 | dasm_put(Dst, 11747); |
| 1900 | } | 1900 | } |
| 1901 | break; | 1901 | break; |
| 1902 | default: | 1902 | default: |
| 1903 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1903 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1904 | if (sse) { | 1904 | if (sse) { |
| 1905 | dasm_put(Dst, 11754); | 1905 | dasm_put(Dst, 11755); |
| 1906 | } else { | 1906 | } else { |
| 1907 | dasm_put(Dst, 11768); | 1907 | dasm_put(Dst, 11769); |
| 1908 | } | 1908 | } |
| 1909 | break; | 1909 | break; |
| 1910 | } | 1910 | } |
| 1911 | dasm_put(Dst, 11782); | 1911 | dasm_put(Dst, 11783); |
| 1912 | break; | 1912 | break; |
| 1913 | case BC_POW: | 1913 | case BC_POW: |
| 1914 | dasm_put(Dst, 11392); | 1914 | dasm_put(Dst, 11393); |
| 1915 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 1915 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
| 1916 | switch (vk) { | 1916 | switch (vk) { |
| 1917 | case 0: | 1917 | case 0: |
| 1918 | dasm_put(Dst, 11400, LJ_TISNUM); | 1918 | dasm_put(Dst, 11401, LJ_TISNUM); |
| 1919 | if (sse) { | 1919 | if (sse) { |
| 1920 | dasm_put(Dst, 11710); | 1920 | dasm_put(Dst, 11711); |
| 1921 | } else { | 1921 | } else { |
| 1922 | dasm_put(Dst, 11724); | 1922 | dasm_put(Dst, 11725); |
| 1923 | } | 1923 | } |
| 1924 | break; | 1924 | break; |
| 1925 | case 1: | 1925 | case 1: |
| 1926 | dasm_put(Dst, 11434, LJ_TISNUM); | 1926 | dasm_put(Dst, 11435, LJ_TISNUM); |
| 1927 | if (sse) { | 1927 | if (sse) { |
| 1928 | dasm_put(Dst, 11732); | 1928 | dasm_put(Dst, 11733); |
| 1929 | } else { | 1929 | } else { |
| 1930 | dasm_put(Dst, 11746); | 1930 | dasm_put(Dst, 11747); |
| 1931 | } | 1931 | } |
| 1932 | break; | 1932 | break; |
| 1933 | default: | 1933 | default: |
| 1934 | dasm_put(Dst, 11468, LJ_TISNUM, LJ_TISNUM); | 1934 | dasm_put(Dst, 11469, LJ_TISNUM, LJ_TISNUM); |
| 1935 | if (sse) { | 1935 | if (sse) { |
| 1936 | dasm_put(Dst, 11754); | 1936 | dasm_put(Dst, 11755); |
| 1937 | } else { | 1937 | } else { |
| 1938 | dasm_put(Dst, 11768); | 1938 | dasm_put(Dst, 11769); |
| 1939 | } | 1939 | } |
| 1940 | break; | 1940 | break; |
| 1941 | } | 1941 | } |
| 1942 | dasm_put(Dst, 11787); | 1942 | dasm_put(Dst, 11788); |
| 1943 | if (sse) { | 1943 | if (sse) { |
| 1944 | dasm_put(Dst, 11266); | 1944 | dasm_put(Dst, 11267); |
| 1945 | } else { | 1945 | } else { |
| 1946 | dasm_put(Dst, 11278); | 1946 | dasm_put(Dst, 11279); |
| 1947 | } | 1947 | } |
| 1948 | dasm_put(Dst, 10848); | 1948 | dasm_put(Dst, 10849); |
| 1949 | break; | 1949 | break; |
| 1950 | 1950 | ||
| 1951 | case BC_CAT: | 1951 | case BC_CAT: |
| 1952 | dasm_put(Dst, 11791, Dt1(->base), Dt1(->base)); | 1952 | dasm_put(Dst, 11792, Dt1(->base), Dt1(->base)); |
| 1953 | break; | 1953 | break; |
| 1954 | 1954 | ||
| 1955 | /* -- Constant ops ------------------------------------------------------ */ | 1955 | /* -- Constant ops ------------------------------------------------------ */ |
| 1956 | 1956 | ||
| 1957 | case BC_KSTR: | 1957 | case BC_KSTR: |
| 1958 | dasm_put(Dst, 11885, LJ_TSTR); | 1958 | dasm_put(Dst, 11886, LJ_TSTR); |
| 1959 | break; | 1959 | break; |
| 1960 | case BC_KSHORT: | 1960 | case BC_KSHORT: |
| 1961 | if (sse) { | 1961 | if (sse) { |
| 1962 | dasm_put(Dst, 11918); | 1962 | dasm_put(Dst, 11919); |
| 1963 | } else { | 1963 | } else { |
| 1964 | dasm_put(Dst, 11933); | 1964 | dasm_put(Dst, 11934); |
| 1965 | } | 1965 | } |
| 1966 | dasm_put(Dst, 10848); | 1966 | dasm_put(Dst, 10849); |
| 1967 | break; | 1967 | break; |
| 1968 | case BC_KNUM: | 1968 | case BC_KNUM: |
| 1969 | if (sse) { | 1969 | if (sse) { |
| 1970 | dasm_put(Dst, 11941); | 1970 | dasm_put(Dst, 11942); |
| 1971 | } else { | 1971 | } else { |
| 1972 | dasm_put(Dst, 11954); | 1972 | dasm_put(Dst, 11955); |
| 1973 | } | 1973 | } |
| 1974 | dasm_put(Dst, 10848); | 1974 | dasm_put(Dst, 10849); |
| 1975 | break; | 1975 | break; |
| 1976 | case BC_KPRI: | 1976 | case BC_KPRI: |
| 1977 | dasm_put(Dst, 11961); | 1977 | dasm_put(Dst, 11962); |
| 1978 | break; | 1978 | break; |
| 1979 | case BC_KNIL: | 1979 | case BC_KNIL: |
| 1980 | dasm_put(Dst, 11987, LJ_TNIL); | 1980 | dasm_put(Dst, 11988, LJ_TNIL); |
| 1981 | break; | 1981 | break; |
| 1982 | 1982 | ||
| 1983 | /* -- Upvalue and function ops ------------------------------------------ */ | 1983 | /* -- Upvalue and function ops ------------------------------------------ */ |
| 1984 | 1984 | ||
| 1985 | case BC_UGET: | 1985 | case BC_UGET: |
| 1986 | dasm_put(Dst, 12033, offsetof(GCfuncL, uvptr), DtA(->v)); | 1986 | dasm_put(Dst, 12034, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 1987 | break; | 1987 | break; |
| 1988 | case BC_USETV: | 1988 | case BC_USETV: |
| 1989 | #define TV2MARKOFS \ | 1989 | #define TV2MARKOFS \ |
| 1990 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) | 1990 | ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) |
| 1991 | dasm_put(Dst, 12077, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); | 1991 | dasm_put(Dst, 12078, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); |
| 1992 | dasm_put(Dst, 12167); | 1992 | dasm_put(Dst, 12168); |
| 1993 | break; | 1993 | break; |
| 1994 | #undef TV2MARKOFS | 1994 | #undef TV2MARKOFS |
| 1995 | case BC_USETS: | 1995 | case BC_USETS: |
| 1996 | dasm_put(Dst, 12179, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); | 1996 | dasm_put(Dst, 12180, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); |
| 1997 | break; | 1997 | break; |
| 1998 | case BC_USETN: | 1998 | case BC_USETN: |
| 1999 | dasm_put(Dst, 12270); | 1999 | dasm_put(Dst, 12271); |
| 2000 | if (sse) { | 2000 | if (sse) { |
| 2001 | dasm_put(Dst, 12275); | 2001 | dasm_put(Dst, 12276); |
| 2002 | } else { | 2002 | } else { |
| 2003 | dasm_put(Dst, 11085); | 2003 | dasm_put(Dst, 11086); |
| 2004 | } | 2004 | } |
| 2005 | dasm_put(Dst, 12282, offsetof(GCfuncL, uvptr), DtA(->v)); | 2005 | dasm_put(Dst, 12283, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 2006 | if (sse) { | 2006 | if (sse) { |
| 2007 | dasm_put(Dst, 12291); | 2007 | dasm_put(Dst, 12292); |
| 2008 | } else { | 2008 | } else { |
| 2009 | dasm_put(Dst, 12297); | 2009 | dasm_put(Dst, 12298); |
| 2010 | } | 2010 | } |
| 2011 | dasm_put(Dst, 10848); | 2011 | dasm_put(Dst, 10849); |
| 2012 | break; | 2012 | break; |
| 2013 | case BC_USETP: | 2013 | case BC_USETP: |
| 2014 | dasm_put(Dst, 12300, offsetof(GCfuncL, uvptr), DtA(->v)); | 2014 | dasm_put(Dst, 12301, offsetof(GCfuncL, uvptr), DtA(->v)); |
| 2015 | break; | 2015 | break; |
| 2016 | case BC_UCLO: | 2016 | case BC_UCLO: |
| 2017 | dasm_put(Dst, 12337, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); | 2017 | dasm_put(Dst, 12338, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); |
| 2018 | break; | 2018 | break; |
| 2019 | 2019 | ||
| 2020 | case BC_FNEW: | 2020 | case BC_FNEW: |
| 2021 | dasm_put(Dst, 12391, Dt1(->base), Dt1(->base), LJ_TFUNC); | 2021 | dasm_put(Dst, 12392, Dt1(->base), Dt1(->base), LJ_TFUNC); |
| 2022 | break; | 2022 | break; |
| 2023 | 2023 | ||
| 2024 | /* -- Table ops --------------------------------------------------------- */ | 2024 | /* -- Table ops --------------------------------------------------------- */ |
| 2025 | 2025 | ||
| 2026 | case BC_TNEW: | 2026 | case BC_TNEW: |
| 2027 | dasm_put(Dst, 12462, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); | 2027 | dasm_put(Dst, 12463, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); |
| 2028 | break; | 2028 | break; |
| 2029 | case BC_TDUP: | 2029 | case BC_TDUP: |
| 2030 | dasm_put(Dst, 12588, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); | 2030 | dasm_put(Dst, 12589, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); |
| 2031 | break; | 2031 | break; |
| 2032 | 2032 | ||
| 2033 | case BC_GGET: | 2033 | case BC_GGET: |
| 2034 | dasm_put(Dst, 12680, Dt7(->env)); | 2034 | dasm_put(Dst, 12681, Dt7(->env)); |
| 2035 | break; | 2035 | break; |
| 2036 | case BC_GSET: | 2036 | case BC_GSET: |
| 2037 | dasm_put(Dst, 12698, Dt7(->env)); | 2037 | dasm_put(Dst, 12699, Dt7(->env)); |
| 2038 | break; | 2038 | break; |
| 2039 | 2039 | ||
| 2040 | case BC_TGETV: | 2040 | case BC_TGETV: |
| 2041 | dasm_put(Dst, 12716, LJ_TTAB, LJ_TISNUM); | 2041 | dasm_put(Dst, 12717, LJ_TTAB, LJ_TISNUM); |
| 2042 | if (sse) { | 2042 | if (sse) { |
| 2043 | dasm_put(Dst, 12749); | 2043 | dasm_put(Dst, 12750); |
| 2044 | } else { | 2044 | } else { |
| 2045 | dasm_put(Dst, 12770); | 2045 | dasm_put(Dst, 12771); |
| 2046 | if (cmov) { | 2046 | if (cmov) { |
| 2047 | dasm_put(Dst, 10811); | 2047 | dasm_put(Dst, 10812); |
| 2048 | } else { | 2048 | } else { |
| 2049 | dasm_put(Dst, 10817); | 2049 | dasm_put(Dst, 10818); |
| 2050 | } | 2050 | } |
| 2051 | dasm_put(Dst, 2527); | 2051 | dasm_put(Dst, 2527); |
| 2052 | } | 2052 | } |
| 2053 | dasm_put(Dst, 12780, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 2053 | dasm_put(Dst, 12781, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 2054 | dasm_put(Dst, 12872, LJ_TSTR); | 2054 | dasm_put(Dst, 12873, LJ_TSTR); |
| 2055 | break; | 2055 | break; |
| 2056 | case BC_TGETS: | 2056 | case BC_TGETS: |
| 2057 | dasm_put(Dst, 12890, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 2057 | dasm_put(Dst, 12891, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 2058 | dasm_put(Dst, 12974, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 2058 | dasm_put(Dst, 12975, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 2059 | break; | 2059 | break; |
| 2060 | case BC_TGETB: | 2060 | case BC_TGETB: |
| 2061 | dasm_put(Dst, 13045, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 2061 | dasm_put(Dst, 13046, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
| 2062 | dasm_put(Dst, 11382); | 2062 | dasm_put(Dst, 11383); |
| 2063 | break; | 2063 | break; |
| 2064 | 2064 | ||
| 2065 | case BC_TSETV: | 2065 | case BC_TSETV: |
| 2066 | dasm_put(Dst, 13144, LJ_TTAB, LJ_TISNUM); | 2066 | dasm_put(Dst, 13145, LJ_TTAB, LJ_TISNUM); |
| 2067 | if (sse) { | 2067 | if (sse) { |
| 2068 | dasm_put(Dst, 12749); | 2068 | dasm_put(Dst, 12750); |
| 2069 | } else { | 2069 | } else { |
| 2070 | dasm_put(Dst, 12770); | 2070 | dasm_put(Dst, 12771); |
| 2071 | if (cmov) { | 2071 | if (cmov) { |
| 2072 | dasm_put(Dst, 10811); | 2072 | dasm_put(Dst, 10812); |
| 2073 | } else { | 2073 | } else { |
| 2074 | dasm_put(Dst, 10817); | 2074 | dasm_put(Dst, 10818); |
| 2075 | } | 2075 | } |
| 2076 | dasm_put(Dst, 2527); | 2076 | dasm_put(Dst, 2527); |
| 2077 | } | 2077 | } |
| 2078 | dasm_put(Dst, 13177, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); | 2078 | dasm_put(Dst, 13178, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); |
| 2079 | dasm_put(Dst, 13260, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 2079 | dasm_put(Dst, 13261, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 2080 | break; | 2080 | break; |
| 2081 | case BC_TSETS: | 2081 | case BC_TSETS: |
| 2082 | dasm_put(Dst, 13322, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); | 2082 | dasm_put(Dst, 13323, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); |
| 2083 | dasm_put(Dst, 13397, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); | 2083 | dasm_put(Dst, 13398, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); |
| 2084 | dasm_put(Dst, 13489, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 2084 | dasm_put(Dst, 13490, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 2085 | break; | 2085 | break; |
| 2086 | case BC_TSETB: | 2086 | case BC_TSETB: |
| 2087 | dasm_put(Dst, 13585, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); | 2087 | dasm_put(Dst, 13586, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); |
| 2088 | dasm_put(Dst, 13683, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 2088 | dasm_put(Dst, 13684, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 2089 | break; | 2089 | break; |
| 2090 | 2090 | ||
| 2091 | case BC_TSETM: | 2091 | case BC_TSETM: |
| 2092 | dasm_put(Dst, 13729); | 2092 | dasm_put(Dst, 13730); |
| 2093 | if (sse) { | 2093 | if (sse) { |
| 2094 | dasm_put(Dst, 13734); | 2094 | dasm_put(Dst, 13735); |
| 2095 | } else { | 2095 | } else { |
| 2096 | dasm_put(Dst, 13741); | 2096 | dasm_put(Dst, 13742); |
| 2097 | } | 2097 | } |
| 2098 | dasm_put(Dst, 13753, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); | 2098 | dasm_put(Dst, 13754, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base)); |
| 2099 | dasm_put(Dst, 13895, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); | 2099 | dasm_put(Dst, 13896, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); |
| 2100 | break; | 2100 | break; |
| 2101 | 2101 | ||
| 2102 | /* -- Calls and vararg handling ----------------------------------------- */ | 2102 | /* -- Calls and vararg handling ----------------------------------------- */ |
| 2103 | 2103 | ||
| 2104 | case BC_CALL: case BC_CALLM: | 2104 | case BC_CALL: case BC_CALLM: |
| 2105 | dasm_put(Dst, 11396); | 2105 | dasm_put(Dst, 11397); |
| 2106 | if (op == BC_CALLM) { | 2106 | if (op == BC_CALLM) { |
| 2107 | dasm_put(Dst, 13913); | 2107 | dasm_put(Dst, 13914); |
| 2108 | } | 2108 | } |
| 2109 | dasm_put(Dst, 13918, LJ_TFUNC, Dt7(->pc)); | 2109 | dasm_put(Dst, 13919, LJ_TFUNC, Dt7(->pc)); |
| 2110 | break; | 2110 | break; |
| 2111 | 2111 | ||
| 2112 | case BC_CALLMT: | 2112 | case BC_CALLMT: |
| 2113 | dasm_put(Dst, 13913); | 2113 | dasm_put(Dst, 13914); |
| 2114 | break; | 2114 | break; |
| 2115 | case BC_CALLT: | 2115 | case BC_CALLT: |
| 2116 | dasm_put(Dst, 13959, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); | 2116 | dasm_put(Dst, 13960, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); |
| 2117 | dasm_put(Dst, 14077, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); | 2117 | dasm_put(Dst, 14078, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG); |
| 2118 | break; | 2118 | break; |
| 2119 | 2119 | ||
| 2120 | case BC_ITERC: | 2120 | case BC_ITERC: |
| 2121 | dasm_put(Dst, 14147, LJ_TFUNC, 2+1, Dt7(->pc)); | 2121 | dasm_put(Dst, 14148, LJ_TFUNC, 2+1, Dt7(->pc)); |
| 2122 | break; | 2122 | break; |
| 2123 | 2123 | ||
| 2124 | case BC_VARG: | 2124 | case BC_VARG: |
| 2125 | dasm_put(Dst, 14227, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); | 2125 | dasm_put(Dst, 14228, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); |
| 2126 | dasm_put(Dst, 14371, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); | 2126 | dasm_put(Dst, 14372, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); |
| 2127 | break; | 2127 | break; |
| 2128 | 2128 | ||
| 2129 | /* -- Returns ----------------------------------------------------------- */ | 2129 | /* -- Returns ----------------------------------------------------------- */ |
| 2130 | 2130 | ||
| 2131 | case BC_RETM: | 2131 | case BC_RETM: |
| 2132 | dasm_put(Dst, 13913); | 2132 | dasm_put(Dst, 13914); |
| 2133 | break; | 2133 | break; |
| 2134 | 2134 | ||
| 2135 | case BC_RET: case BC_RET0: case BC_RET1: | 2135 | case BC_RET: case BC_RET0: case BC_RET1: |
| 2136 | if (op != BC_RET0) { | 2136 | if (op != BC_RET0) { |
| 2137 | dasm_put(Dst, 14470); | 2137 | dasm_put(Dst, 14471); |
| 2138 | } | 2138 | } |
| 2139 | dasm_put(Dst, 14474, FRAME_TYPE); | 2139 | dasm_put(Dst, 14475, FRAME_TYPE); |
| 2140 | switch (op) { | 2140 | switch (op) { |
| 2141 | case BC_RET: | 2141 | case BC_RET: |
| 2142 | dasm_put(Dst, 14493); | 2142 | dasm_put(Dst, 14494); |
| 2143 | break; | 2143 | break; |
| 2144 | case BC_RET1: | 2144 | case BC_RET1: |
| 2145 | dasm_put(Dst, 14551); | 2145 | dasm_put(Dst, 14552); |
| 2146 | /* fallthrough */ | 2146 | /* fallthrough */ |
| 2147 | case BC_RET0: | 2147 | case BC_RET0: |
| 2148 | dasm_put(Dst, 14567); | 2148 | dasm_put(Dst, 14568); |
| 2149 | default: | 2149 | default: |
| 2150 | break; | 2150 | break; |
| 2151 | } | 2151 | } |
| 2152 | dasm_put(Dst, 14578, Dt7(->pc), PC2PROTO(k)); | 2152 | dasm_put(Dst, 14579, Dt7(->pc), PC2PROTO(k)); |
| 2153 | if (op == BC_RET) { | 2153 | if (op == BC_RET) { |
| 2154 | dasm_put(Dst, 14620, LJ_TNIL); | 2154 | dasm_put(Dst, 14621, LJ_TNIL); |
| 2155 | } else { | 2155 | } else { |
| 2156 | dasm_put(Dst, 14629, LJ_TNIL); | 2156 | dasm_put(Dst, 14630, LJ_TNIL); |
| 2157 | } | 2157 | } |
| 2158 | dasm_put(Dst, 14636, -FRAME_VARG, FRAME_TYPEP); | 2158 | dasm_put(Dst, 14637, -FRAME_VARG, FRAME_TYPEP); |
| 2159 | if (op != BC_RET0) { | 2159 | if (op != BC_RET0) { |
| 2160 | dasm_put(Dst, 14660); | 2160 | dasm_put(Dst, 14661); |
| 2161 | } | 2161 | } |
| 2162 | dasm_put(Dst, 4683); | 2162 | dasm_put(Dst, 4683); |
| 2163 | break; | 2163 | break; |
| @@ -2167,7 +2167,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2167 | 2167 | ||
| 2168 | case BC_FORL: | 2168 | case BC_FORL: |
| 2169 | #if LJ_HASJIT | 2169 | #if LJ_HASJIT |
| 2170 | dasm_put(Dst, 14664, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2170 | dasm_put(Dst, 14665, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2171 | #endif | 2171 | #endif |
| 2172 | break; | 2172 | break; |
| 2173 | 2173 | ||
| @@ -2179,57 +2179,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2179 | case BC_FORI: | 2179 | case BC_FORI: |
| 2180 | case BC_IFORL: | 2180 | case BC_IFORL: |
| 2181 | vk = (op == BC_IFORL || op == BC_JFORL); | 2181 | vk = (op == BC_IFORL || op == BC_JFORL); |
| 2182 | dasm_put(Dst, 14685); | 2182 | dasm_put(Dst, 14686); |
| 2183 | if (!vk) { | 2183 | if (!vk) { |
| 2184 | dasm_put(Dst, 14689, LJ_TISNUM, LJ_TISNUM); | 2184 | dasm_put(Dst, 14690, LJ_TISNUM, LJ_TISNUM); |
| 2185 | } | 2185 | } |
| 2186 | dasm_put(Dst, 14708); | 2186 | dasm_put(Dst, 14709); |
| 2187 | if (!vk) { | 2187 | if (!vk) { |
| 2188 | dasm_put(Dst, 14712, LJ_TISNUM); | 2188 | dasm_put(Dst, 14713, LJ_TISNUM); |
| 2189 | } | 2189 | } |
| 2190 | if (sse) { | 2190 | if (sse) { |
| 2191 | dasm_put(Dst, 14721); | 2191 | dasm_put(Dst, 14722); |
| 2192 | if (vk) { | 2192 | if (vk) { |
| 2193 | dasm_put(Dst, 14733); | 2193 | dasm_put(Dst, 14734); |
| 2194 | } else { | 2194 | } else { |
| 2195 | dasm_put(Dst, 14752); | 2195 | dasm_put(Dst, 14753); |
| 2196 | } | 2196 | } |
| 2197 | dasm_put(Dst, 14757); | 2197 | dasm_put(Dst, 14758); |
| 2198 | } else { | 2198 | } else { |
| 2199 | dasm_put(Dst, 14770); | 2199 | dasm_put(Dst, 14771); |
| 2200 | if (vk) { | 2200 | if (vk) { |
| 2201 | dasm_put(Dst, 14776); | 2201 | dasm_put(Dst, 14777); |
| 2202 | } else { | 2202 | } else { |
| 2203 | dasm_put(Dst, 14792); | 2203 | dasm_put(Dst, 14793); |
| 2204 | } | 2204 | } |
| 2205 | dasm_put(Dst, 14800); | 2205 | dasm_put(Dst, 14801); |
| 2206 | if (cmov) { | 2206 | if (cmov) { |
| 2207 | dasm_put(Dst, 10811); | 2207 | dasm_put(Dst, 10812); |
| 2208 | } else { | 2208 | } else { |
| 2209 | dasm_put(Dst, 10817); | 2209 | dasm_put(Dst, 10818); |
| 2210 | } | 2210 | } |
| 2211 | if (!cmov) { | 2211 | if (!cmov) { |
| 2212 | dasm_put(Dst, 14805); | 2212 | dasm_put(Dst, 14806); |
| 2213 | } | 2213 | } |
| 2214 | } | 2214 | } |
| 2215 | if (op == BC_FORI) { | 2215 | if (op == BC_FORI) { |
| 2216 | dasm_put(Dst, 14811, -BCBIAS_J*4); | 2216 | dasm_put(Dst, 14812, -BCBIAS_J*4); |
| 2217 | } else if (op == BC_JFORI) { | 2217 | } else if (op == BC_JFORI) { |
| 2218 | dasm_put(Dst, 14821, -BCBIAS_J*4, BC_JLOOP); | 2218 | dasm_put(Dst, 14822, -BCBIAS_J*4, BC_JLOOP); |
| 2219 | } else if (op == BC_IFORL) { | 2219 | } else if (op == BC_IFORL) { |
| 2220 | dasm_put(Dst, 14835, -BCBIAS_J*4); | 2220 | dasm_put(Dst, 14836, -BCBIAS_J*4); |
| 2221 | } else { | 2221 | } else { |
| 2222 | dasm_put(Dst, 14831, BC_JLOOP); | 2222 | dasm_put(Dst, 14832, BC_JLOOP); |
| 2223 | } | 2223 | } |
| 2224 | dasm_put(Dst, 10846); | 2224 | dasm_put(Dst, 10847); |
| 2225 | if (sse) { | 2225 | if (sse) { |
| 2226 | dasm_put(Dst, 14845); | 2226 | dasm_put(Dst, 14846); |
| 2227 | } | 2227 | } |
| 2228 | break; | 2228 | break; |
| 2229 | 2229 | ||
| 2230 | case BC_ITERL: | 2230 | case BC_ITERL: |
| 2231 | #if LJ_HASJIT | 2231 | #if LJ_HASJIT |
| 2232 | dasm_put(Dst, 14664, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2232 | dasm_put(Dst, 14665, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2233 | #endif | 2233 | #endif |
| 2234 | break; | 2234 | break; |
| 2235 | 2235 | ||
| @@ -2238,33 +2238,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2238 | break; | 2238 | break; |
| 2239 | #endif | 2239 | #endif |
| 2240 | case BC_IITERL: | 2240 | case BC_IITERL: |
| 2241 | dasm_put(Dst, 14856, LJ_TNIL); | 2241 | dasm_put(Dst, 14857, LJ_TNIL); |
| 2242 | if (op == BC_JITERL) { | 2242 | if (op == BC_JITERL) { |
| 2243 | dasm_put(Dst, 14871, BC_JLOOP); | 2243 | dasm_put(Dst, 14872, BC_JLOOP); |
| 2244 | } else { | 2244 | } else { |
| 2245 | dasm_put(Dst, 14885, -BCBIAS_J*4); | 2245 | dasm_put(Dst, 14886, -BCBIAS_J*4); |
| 2246 | } | 2246 | } |
| 2247 | dasm_put(Dst, 11143); | 2247 | dasm_put(Dst, 11144); |
| 2248 | break; | 2248 | break; |
| 2249 | 2249 | ||
| 2250 | case BC_LOOP: | 2250 | case BC_LOOP: |
| 2251 | #if LJ_HASJIT | 2251 | #if LJ_HASJIT |
| 2252 | dasm_put(Dst, 14664, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2252 | dasm_put(Dst, 14665, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2253 | #endif | 2253 | #endif |
| 2254 | break; | 2254 | break; |
| 2255 | 2255 | ||
| 2256 | case BC_ILOOP: | 2256 | case BC_ILOOP: |
| 2257 | dasm_put(Dst, 10848); | 2257 | dasm_put(Dst, 10849); |
| 2258 | break; | 2258 | break; |
| 2259 | 2259 | ||
| 2260 | case BC_JLOOP: | 2260 | case BC_JLOOP: |
| 2261 | #if LJ_HASJIT | 2261 | #if LJ_HASJIT |
| 2262 | dasm_put(Dst, 14901, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); | 2262 | dasm_put(Dst, 14902, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); |
| 2263 | #endif | 2263 | #endif |
| 2264 | break; | 2264 | break; |
| 2265 | 2265 | ||
| 2266 | case BC_JMP: | 2266 | case BC_JMP: |
| 2267 | dasm_put(Dst, 14924, -BCBIAS_J*4); | 2267 | dasm_put(Dst, 14925, -BCBIAS_J*4); |
| 2268 | break; | 2268 | break; |
| 2269 | 2269 | ||
| 2270 | /* -- Function headers -------------------------------------------------- */ | 2270 | /* -- Function headers -------------------------------------------------- */ |
| @@ -2278,7 +2278,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2278 | 2278 | ||
| 2279 | case BC_FUNCF: | 2279 | case BC_FUNCF: |
| 2280 | #if LJ_HASJIT | 2280 | #if LJ_HASJIT |
| 2281 | dasm_put(Dst, 14948, HOTCOUNT_PCMASK, GG_DISP2HOT); | 2281 | dasm_put(Dst, 14949, HOTCOUNT_PCMASK, GG_DISP2HOT); |
| 2282 | #endif | 2282 | #endif |
| 2283 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 2283 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
| 2284 | break; | 2284 | break; |
| @@ -2288,47 +2288,47 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) | |||
| 2288 | break; | 2288 | break; |
| 2289 | #endif | 2289 | #endif |
| 2290 | case BC_IFUNCF: | 2290 | case BC_IFUNCF: |
| 2291 | dasm_put(Dst, 14969, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); | 2291 | dasm_put(Dst, 14970, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); |
| 2292 | if (op == BC_JFUNCF) { | 2292 | if (op == BC_JFUNCF) { |
| 2293 | dasm_put(Dst, 14999, BC_JLOOP); | 2293 | dasm_put(Dst, 15000, BC_JLOOP); |
| 2294 | } else { | 2294 | } else { |
| 2295 | dasm_put(Dst, 10848); | 2295 | dasm_put(Dst, 10849); |
| 2296 | } | 2296 | } |
| 2297 | dasm_put(Dst, 15008, LJ_TNIL); | 2297 | dasm_put(Dst, 15009, LJ_TNIL); |
| 2298 | break; | 2298 | break; |
| 2299 | 2299 | ||
| 2300 | case BC_JFUNCV: | 2300 | case BC_JFUNCV: |
| 2301 | #if !LJ_HASJIT | 2301 | #if !LJ_HASJIT |
| 2302 | break; | 2302 | break; |
| 2303 | #endif | 2303 | #endif |
| 2304 | dasm_put(Dst, 10246); | 2304 | dasm_put(Dst, 10247); |
| 2305 | break; /* NYI: compiled vararg functions. */ | 2305 | break; /* NYI: compiled vararg functions. */ |
| 2306 | 2306 | ||
| 2307 | case BC_IFUNCV: | 2307 | case BC_IFUNCV: |
| 2308 | dasm_put(Dst, 15030, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); | 2308 | dasm_put(Dst, 15031, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); |
| 2309 | if (op == BC_JFUNCV) { | 2309 | if (op == BC_JFUNCV) { |
| 2310 | dasm_put(Dst, 14999, BC_JLOOP); | 2310 | dasm_put(Dst, 15000, BC_JLOOP); |
| 2311 | } else { | 2311 | } else { |
| 2312 | dasm_put(Dst, 15121, -4+PC2PROTO(k)); | 2312 | dasm_put(Dst, 15122, -4+PC2PROTO(k)); |
| 2313 | } | 2313 | } |
| 2314 | dasm_put(Dst, 15143, LJ_TNIL); | 2314 | dasm_put(Dst, 15144, LJ_TNIL); |
| 2315 | break; | 2315 | break; |
| 2316 | 2316 | ||
| 2317 | case BC_FUNCC: | 2317 | case BC_FUNCC: |
| 2318 | case BC_FUNCCW: | 2318 | case BC_FUNCCW: |
| 2319 | dasm_put(Dst, 15165, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); | 2319 | dasm_put(Dst, 15166, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); |
| 2320 | if (op == BC_FUNCC) { | 2320 | if (op == BC_FUNCC) { |
| 2321 | dasm_put(Dst, 15194); | 2321 | dasm_put(Dst, 15195); |
| 2322 | } else { | 2322 | } else { |
| 2323 | dasm_put(Dst, 15198); | 2323 | dasm_put(Dst, 15199); |
| 2324 | } | 2324 | } |
| 2325 | dasm_put(Dst, 15206, DISPATCH_GL(vmstate), ~LJ_VMST_C); | 2325 | dasm_put(Dst, 15207, DISPATCH_GL(vmstate), ~LJ_VMST_C); |
| 2326 | if (op == BC_FUNCC) { | 2326 | if (op == BC_FUNCC) { |
| 2327 | dasm_put(Dst, 15215); | 2327 | dasm_put(Dst, 15216); |
| 2328 | } else { | 2328 | } else { |
| 2329 | dasm_put(Dst, 15219, DISPATCH_GL(wrapf)); | 2329 | dasm_put(Dst, 15220, DISPATCH_GL(wrapf)); |
| 2330 | } | 2330 | } |
| 2331 | dasm_put(Dst, 15224, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); | 2331 | dasm_put(Dst, 15225, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); |
| 2332 | break; | 2332 | break; |
| 2333 | 2333 | ||
| 2334 | /* ---------------------------------------------------------------------- */ | 2334 | /* ---------------------------------------------------------------------- */ |
| @@ -2356,7 +2356,7 @@ static int build_backend(BuildCtx *ctx) | |||
| 2356 | 2356 | ||
| 2357 | build_subroutines(ctx, cmov, sse); | 2357 | build_subroutines(ctx, cmov, sse); |
| 2358 | 2358 | ||
| 2359 | dasm_put(Dst, 15249); | 2359 | dasm_put(Dst, 15250); |
| 2360 | for (op = 0; op < BC__MAX; op++) | 2360 | for (op = 0; op < BC__MAX; op++) |
| 2361 | build_ins(ctx, (BCOp)op, op, cmov, sse); | 2361 | build_ins(ctx, (BCOp)op, op, cmov, sse); |
| 2362 | 2362 | ||
diff --git a/src/lib_base.c b/src/lib_base.c index c8ac5f86..9127b0d5 100644 --- a/src/lib_base.c +++ b/src/lib_base.c | |||
| @@ -218,7 +218,7 @@ LJLIB_ASM(tostring) LJLIB_REC(.) | |||
| 218 | L->top = o+1; /* Only keep one argument. */ | 218 | L->top = o+1; /* Only keep one argument. */ |
| 219 | if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { | 219 | if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { |
| 220 | copyTV(L, L->base-1, mo); /* Replace callable. */ | 220 | copyTV(L, L->base-1, mo); /* Replace callable. */ |
| 221 | return FFH_RETRY; | 221 | return FFH_TAILCALL; |
| 222 | } else { | 222 | } else { |
| 223 | GCstr *s; | 223 | GCstr *s; |
| 224 | if (tvisnum(o)) { | 224 | if (tvisnum(o)) { |
diff --git a/src/lj_lib.h b/src/lj_lib.h index fd2b025c..814c9739 100644 --- a/src/lj_lib.h +++ b/src/lj_lib.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #define FFH_RETRY 0 | 28 | #define FFH_RETRY 0 |
| 29 | #define FFH_UNREACHABLE FFH_RETRY | 29 | #define FFH_UNREACHABLE FFH_RETRY |
| 30 | #define FFH_RES(n) ((n)+1) | 30 | #define FFH_RES(n) ((n)+1) |
| 31 | #define FFH_TAILCALL (-1) | ||
| 31 | 32 | ||
| 32 | LJ_FUNC TValue *lj_lib_checkany(lua_State *L, int narg); | 33 | LJ_FUNC TValue *lj_lib_checkany(lua_State *L, int narg); |
| 33 | LJ_FUNC GCstr *lj_lib_checkstr(lua_State *L, int narg); | 34 | LJ_FUNC GCstr *lj_lib_checkstr(lua_State *L, int narg); |
