Branch: Tag:

2012-06-20

2012-06-20 04:43:06 by Per Hedbor <ph@opera.com>

[compiler][amd64] Cleaned up code somewhat and faster branches

Added FAST_BRANCH_WHEN{_,_NOT_}ZERO that knows that sp[-1] is an
integer. It can thus avoid doing any checking of types and the normal
pop_stack checks.

Also inlined the normal BRANCH_WHEN{_,_NON_}ZERO.

There is now a common function that is used to generate
modrm+sib+offset for the *mem* family of functions.

Also removed frame init/stack cleaning for Functions that just return
a constant.

1178:    });   });    + OPCODE0_BRANCH(F_QUICK_BRANCH_WHEN_ZERO, "(Q) branch if zero", I_UPDATE_SP, { +  if(Pike_sp[-1].u.integer) +  { +  DONT_BRANCH(); +  }else{ +  DO_BRANCH(); +  } +  pop_stack(); +  });    -  + OPCODE0_BRANCH(F_QUICK_BRANCH_WHEN_NON_ZERO, "(Q) branch if not zero", I_UPDATE_SP, { +  if(Pike_sp[-1].u.integer) +  { +  DO_BRANCH(); +  }else{ +  DONT_BRANCH(); +  } +  pop_stack(); + }); +    OPCODE0_BRANCH(F_BRANCH_WHEN_NON_ZERO, "branch if not zero", I_UPDATE_SP, {    if(UNSAFE_IS_ZERO(Pike_sp-1))    { -  /* write_to_stderr("foreach\n", 8); */ +     DONT_BRANCH();    }else{    DO_BRANCH();