Branch: Tag:

2001-06-23

2001-06-23 10:33:11 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

avoid generating tail recursion inside catch()

Rev: src/docode.c:1.121
Rev: src/interpret.c:1.208
Rev: src/opcodes.h:1.17
Rev: src/peep.c:1.47
Rev: src/peep.in:1.53
Rev: src/testsuite.in:1.427

1:   // - // $Id: peep.in,v 1.52 2001/06/19 23:59:33 hubbe Exp $ + // $Id: peep.in,v 1.53 2001/06/23 10:33:11 hubbe Exp $   //      NOP :
66:   CONST_1 XOR: COMPL   CONST0 RETURN: RETURN_0   CONST1 RETURN: RETURN_1 + CONST0 VOLATILE_RETURN: RETURN_0 + CONST1 VOLATILE_RETURN: RETURN_1   INC POP_VALUE: INC_AND_POP   POST_INC POP_VALUE: INC_AND_POP   DEC POP_VALUE: DEC_AND_POP
84:    [op != F_LABEL && op != F_SYNCH_MARK && op != F_POP_SYNCH_MARK]   BRANCH ? DeadCodeEndCond($2o) : BRANCH($1a)   RETURN ? DeadCodeEndCond($2o) : RETURN + VOLATILE_RETURN ? DeadCodeEndCond($2o) : VOLATILE_RETURN   RETURN_0 ? DeadCodeEndCond($2o) : RETURN_0   RETURN_1 ? DeadCodeEndCond($2o) : RETURN_1   RETURN_LOCAL ? DeadCodeEndCond($2o) : RETURN_LOCAL($1a)
100:   DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)   POST_DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)    - ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN: ASSIGN_LOCAL($1a) RETURN + ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN: ASSIGN_LOCAL($1a) + ASSIGN_LOCAL_AND_POP LOCAL ($1a) VOLATILE_RETURN: ASSIGN_LOCAL($1a)   ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: RETURN -  + ASSIGN_LOCAL_AND_POP LOCAL ($1a) VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: VOLATILE_RETURN      ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a) -  + ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) VOLATILE_RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a)      ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a) [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)] : RETURN_IF_TRUE ASSIGN_LOCAL($1a) LABEL($2a) -  + ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) VOLATILE_RETURN LABEL($2a) [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)] : RETURN_IF_TRUE ASSIGN_LOCAL($1a) LABEL($2a)      ASSIGN_GLOBAL BRANCH_WHEN_ZERO GLOBAL($1a) RETURN LABEL($2a): ASSIGN_GLOBAL($1a) RETURN_IF_TRUE LABEL($2a) -  + ASSIGN_GLOBAL BRANCH_WHEN_ZERO GLOBAL($1a) VOLATILE_RETURN LABEL($2a): ASSIGN_GLOBAL($1a) RETURN_IF_TRUE LABEL($2a)         GLOBAL_LVALUE INC_AND_POP GLOBAL($1a): GLOBAL_LVALUE($1a) INC
222:   LOCAL CONST_1 ADD_TO_AND_POP : DEC_LOCAL_AND_POP($1a)      LOCAL RETURN : RETURN_LOCAL($1a) + LOCAL VOLATILE_RETURN : RETURN_LOCAL($1a)   #ifdef EAT_STACK   APPLY ASSIGN_LOCAL_AND_POP : APPLY_ASSIGN_LOCAL_AND_POP($1a,$2a)   #endif
365:      #define LOW_MKCALLOPTS(A) \   A POP_VALUE: A##_AND_POP($1a); \ - A [ check_tailrecursion() ] RETURN : A##_AND_RETURN($1a); \ - A##_AND_RETURN ? DeadCodeEndCond($2o) : A##_AND_RETURN($1a) + A [ check_tailrecursion() ] RETURN : A##_AND_RETURN($1a) ; \ + A##_AND_RETURN ? DeadCodeEndCond($2o) : A##_AND_RETURN($1a) ;      #define MKCALLOPTS(A) \   MARK A: MARK_##A($2a) ; \