Branch: Tag:

2004-08-24

2004-08-24 16:58:01 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added some optimizations pertaining to global variables.
Added some optimizations for ~.

Rev: src/peep.in:1.73

2:   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information. - // $Id: peep.in,v 1.72 2004/08/24 14:15:21 grubba Exp $ + // $Id: peep.in,v 1.73 2004/08/24 16:58:01 grubba Exp $      NOP :   POP_N_ELEMS (0) :
121:   DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)   POST_DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)    + ASSIGN_GLOBAL_AND_POP GLOBAL_LVALUE($1a) INC_AND_POP : ADD_INT(1) ASSIGN_GLOBAL_AND_POP($1a) + ASSIGN_GLOBAL_AND_POP GLOBAL_LVALUE($1a) DEC_AND_POP : ADD_NEG_INT(1) ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE INC_AND_POP GLOBAL($1a) : GLOBAL_LVALUE($1a) INC + GLOBAL_LVALUE DEC_AND_POP GLOBAL($1a) : GLOBAL_LVALUE($1a) DEC +    ASSIGN_LOCAL RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: RETURN   ASSIGN_LOCAL VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: VOLATILE_RETURN   
472:   IDENTIFIER POP_VALUE :   TRAMPOLINE POP_VALUE :    -  +    RECUR RETURN [check_tailrecursion()] : TAIL_RECUR ($1a)      // This doesn't really work
524:   #endif      // Move lvalues up on the stack. - NUMBER ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) - NEG_NUMBER ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) NEG_NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) - CONST0 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CLEAR_LOCAL($2a) - CONST1 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CONST1 ASSIGN_LOCAL_AND_POP($2a) - CONST_1 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CONST_1 ASSIGN_LOCAL_AND_POP($2a) + #define MOVE_LVAL(L_G1, L_G2) \ +  NUMBER ASSIGN_##L_G1##_AND_POP L_G2##_LVALUE: L_G2##_LVALUE($3a) NUMBER($1a) ASSIGN_##L_G1##_AND_POP($2a); \ +  NEG_NUMBER ASSIGN_##L_G1##_AND_POP L_G2##_LVALUE: L_G2##_LVALUE($3a) NEG_NUMBER($1a) ASSIGN_##L_G1##_AND_POP($2a); \ +  CONST1 ASSIGN_##L_G1##_AND_POP L_G2##_LVALUE: L_G2##_LVALUE($3a) CONST1 ASSIGN_##L_G1##_AND_POP($2a); \ +  CONST_1 ASSIGN_##L_G1##_AND_POP L_G2##_LVALUE: L_G2##_LVALUE($3a) CONST_1 ASSIGN_##L_G1##_AND_POP($2a);    -  + MOVE_LVAL(LOCAL,LOCAL) + MOVE_LVAL(GLOBAL,LOCAL) + MOVE_LVAL(LOCAL,GLOBAL) + MOVE_LVAL(GLOBAL,GLOBAL) +  + CLEAR_LOCAL LOCAL_LVALUE: LOCAL_LVALUE($2a) CLEAR_LOCAL($1a) + CLEAR_LOCAL GLOBAL_LVALUE: GLOBAL_LVALUE($2a) CLEAR_LOCAL($1a) + CONST0 ASSIGN_GLOBAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CONST0 ASSIGN_GLOBAL_AND_POP($2a) + CONST0 ASSIGN_GLOBAL_AND_POP GLOBAL_LVALUE: GLOBAL_LVALUE($3a) CONST0 ASSIGN_GLOBAL_AND_POP($2a) +  + GLOBAL_LVALUE CONST0 ASSIGN_GLOBAL_AND_POP($1a) INC_AND_POP : CONST1 ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE CONST0 ASSIGN_GLOBAL_AND_POP($1a) DEC_AND_POP : CONST_1 ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE CONST_1 ASSIGN_GLOBAL_AND_POP($1a) INC_AND_POP : CONST0 ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE CONST1 ASSIGN_GLOBAL_AND_POP($1a) DEC_AND_POP : CONST0 ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE NUMBER ASSIGN_GLOBAL_AND_POP($1a) INC_AND_POP : NUMBER($2a) ADD_INT(1) ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE NUMBER ASSIGN_GLOBAL_AND_POP($1a) DEC_AND_POP : NUMBER($2a) ADD_NEG_INT(1) ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE NEG_NUMBER ASSIGN_GLOBAL_AND_POP($1a) INC_AND_POP : NEG_NUMBER($2a) ADD_INT(1) ASSIGN_GLOBAL_AND_POP($1a) + GLOBAL_LVALUE NEG_NUMBER ASSIGN_GLOBAL_AND_POP($1a) DEC_AND_POP : NEG_NUMBER($2a) ADD_NEG_INT(1) ASSIGN_GLOBAL_AND_POP($1a) +    // Move marks to where they're relevant.   MARK CLEAR_LOCAL: CLEAR_LOCAL($2a) MARK   MARK NUMBER ASSIGN_LOCAL_AND_POP: NUMBER($2a) ASSIGN_LOCAL_AND_POP($3a) MARK
541:   MARK CONST_1 ASSIGN_LOCAL_AND_POP: CONST_1 ASSIGN_LOCAL_AND_POP($3a) MARK   MARK CONST_1 ASSIGN_GLOBAL_AND_POP: CONST_1 ASSIGN_GLOBAL_AND_POP($3a) MARK    + CONST_1 COMPL : CONST0 + CONST_1 ASSIGN_LOCAL COMPL : CONST_1 ASSIGN_LOCAL_AND_POP($2a) CONST0 + CONST_1 ASSIGN_GLOBAL COMPL : CONST_1 ASSIGN_GLOBAL_AND_POP($2a) CONST0 +  + CONST0 COMPL : CONST_1 + CONST0 ASSIGN_LOCAL COMPL : CLEAR_LOCAL($2a) CONST_1 + CONST0 ASSIGN_GLOBAL COMPL : CONST0 ASSIGN_GLOBAL_AND_POP($2a) CONST_1