PPC: Avoid pointless arg clearing in BC_IFUNCF. Remove dead code.

This commit is contained in:
Mike Pall 2012-01-23 19:15:52 +01:00
parent 9f485115ef
commit 7d2774e4c5
2 changed files with 537 additions and 580 deletions

View File

@ -1347,7 +1347,6 @@ static void build_subroutines(BuildCtx *ctx)
| cmplwi NARGS8:RC, 16
| lwz CARG4, 8(BASE)
| lfd FARG2, 8(BASE)
| lwz CARG3, 0(BASE)
| lfd FARG1, 0(BASE)
| blt ->fff_fallback
| lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH)
@ -1356,9 +1355,9 @@ static void build_subroutines(BuildCtx *ctx)
| la BASE, 16(BASE)
| // Remember active hook before pcall.
| rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31
| stfd FARG2, 0(TMP2) // Swap function and traceback.
| stfd FARG2, 0(TMP2) // Swap function and traceback.
| subi NARGS8:RC, NARGS8:RC, 16
| stfd FARG1, 8(TMP2)
| stfd FARG1, 8(TMP2)
| addi PC, TMP1, 16+FRAME_PCALL
| b ->vm_call_dispatch
|
@ -2570,14 +2569,14 @@ static void build_subroutines(BuildCtx *ctx)
| bl extern lj_ccallback_enter // (CTState *cts, void *cf)
| // Returns lua_State *.
| lwz BASE, L:CRET1->base
| li TISNUM, LJ_TISNUM // Setup type comparison constants.
| li TISNUM, LJ_TISNUM // Setup type comparison constants.
| lwz RC, L:CRET1->top
| lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
| lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
| li ZERO, 0
| mr L, CRET1
| stw TMP3, TMPD
| lwz LFUNC:RB, FRAME_FUNC(BASE)
| ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float).
| ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float).
| li TISNIL, LJ_TNIL
| li_vmstate INTERP
| lfs TOBIT, TMPD
@ -2588,7 +2587,7 @@ static void build_subroutines(BuildCtx *ctx)
| ins_callt
#endif
|
|->cont_ffi_callback: // Return from FFI callback.
|->cont_ffi_callback: // Return from FFI callback.
#if LJ_HASFFI
| lwz CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH)
| stw BASE, L->base
@ -2619,7 +2618,6 @@ static void build_subroutines(BuildCtx *ctx)
| stwux sp, sp, TMP1
| crnot 4*cr1+eq, 4*cr1+eq // For vararg calls.
| stw r14, -4(TMP2)
| li TMP3, 0
| stw CCSTATE, -8(TMP2)
| mr r14, TMP2
| la TMP1, CCSTATE->stack
@ -3840,14 +3838,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| barrierback TAB:RB, TMP3, TMP0
| b <2
break;
|1:
| checkstr CARG1; bne >4
| cmpw TMP0, STR:RC; bne >4
| checknil CARG2; beq >5 // Key found, but nil value?
|3:
| stwux CARG2, RA, BASE
| stw TMP1, 4(RA)
| ins_next
case BC_TSETS:
| // RA = src*8, RB = table*8, RC = str_const*8 (~)
| lwzux CARG1, RB, BASE
@ -3874,7 +3864,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| lwz CARG1, NODE:TMP2->key
| lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2)
| lwz CARG2, NODE:TMP2->val
| lwz TMP1, 4+offsetof(Node, val)(NODE:TMP2)
| lwz NODE:TMP1, NODE:TMP2->next
| checkstr CARG1; bne >5
| cmpw TMP0, STR:RC; bne >5
| checknil CARG2; beq >4 // Key found, but nil value?
@ -3895,8 +3885,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| b ->vmeta_tsets
|
|5: // Follow hash chain.
| lwz NODE:TMP2, NODE:TMP2->next
| cmplwi NODE:TMP2, 0
| cmplwi NODE:TMP1, 0
| mr NODE:TMP2, NODE:TMP1
| bne <1
| // End of hash chain: key not found, add a new one.
|
@ -4470,7 +4460,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
}
| lfd f1, FORL_IDX*8(RA)
| crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt
| lfd f3, FORL_STEP*8(RA)
| crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
| lfd f2, FORL_STOP*8(RA)
| bge ->vmeta_for
@ -4625,7 +4614,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
}
|2:
| cmplw NARGS8:RC, TMP1 // Check for missing parameters.
| ble >3
| blt >3
if (op == BC_JFUNCF) {
| decode_RD8 RD, INS
| b =>BC_JLOOP

File diff suppressed because it is too large Load Diff