Changeset 12993


Ignore:
Timestamp:
Oct 10, 2009, 2:46:42 PM (10 years ago)
Author:
gz
Message:

Cleanup finish_function_entry() (r12744)

Location:
branches/working-0711/ccl/lisp-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lisp-kernel/x86-constants32.h

    r12988 r12993  
    9797#define node_size 4
    9898#define node_shift 2
     99#define nargregs 2
    99100
    100101#define tag_fixnum 0
  • branches/working-0711/ccl/lisp-kernel/x86-constants64.h

    r12988 r12993  
    129129#define node_size 8L
    130130#define node_shift 3L
    131 
     131#define nargregs 3L
    132132
    133133#define tag_fixnum 0L
  • branches/working-0711/ccl/lisp-kernel/x86-exceptions.c

    r12990 r12993  
    320320finish_function_entry(ExceptionInformation *xp)
    321321{
    322 #ifdef X8664
    323   natural nargs = (xpGPR(xp,Inargs)&0xffff)>> fixnumshift;
    324 #else
    325322  natural nargs = xpGPR(xp,Inargs)>>fixnumshift;
    326 #endif
    327   signed_natural disp;
     323  signed_natural disp = nargs - nargregs;
    328324  LispObj *vsp =  (LispObj *) xpGPR(xp,Isp), ra = *vsp++;
    329325   
    330326  xpGPR(xp,Isp) = (LispObj) vsp;
    331327
     328  if (disp > 0) {               /* implies that nargs > nargregs */
     329    vsp[disp] = xpGPR(xp,Ifp);
     330    vsp[disp+1] = ra;
     331    xpGPR(xp,Ifp) = (LispObj)(vsp+disp);
    332332#ifdef X8664
    333   disp = nargs - 3;
    334 #endif
    335 #ifdef X8632
    336   disp = nargs - 2;
    337 #endif
    338 
    339 #ifdef X8664
    340   if (disp > 0) {               /* implies that nargs > 3 */
    341     vsp[disp] = xpGPR(xp,Irbp);
    342     vsp[disp+1] = ra;
    343     xpGPR(xp,Irbp) = (LispObj)(vsp+disp);
    344333    push_on_lisp_stack(xp,xpGPR(xp,Iarg_x));
     334#endif
    345335    push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
    346336    push_on_lisp_stack(xp,xpGPR(xp,Iarg_z));
    347337  } else {
    348338    push_on_lisp_stack(xp,ra);
    349     push_on_lisp_stack(xp,xpGPR(xp,Irbp));
    350     xpGPR(xp,Irbp) = xpGPR(xp,Isp);
     339    push_on_lisp_stack(xp,xpGPR(xp,Ifp));
     340    xpGPR(xp,Ifp) = xpGPR(xp,Isp);
     341#ifdef X8664
    351342    if (nargs == 3) {
    352343      push_on_lisp_stack(xp,xpGPR(xp,Iarg_x));
    353344    }
     345#endif
    354346    if (nargs >= 2) {
    355347      push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
     
    359351    }
    360352  }
    361 #endif
    362 #ifdef X8632
    363   if (disp > 0) {               /* implies that nargs > 2 */
    364     vsp[disp] = xpGPR(xp,Iebp);
    365     vsp[disp+1] = ra;
    366     xpGPR(xp,Iebp) = (LispObj)(vsp+disp);
    367     xpGPR(xp,Isp) = (LispObj)vsp;
    368     push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
    369     push_on_lisp_stack(xp,xpGPR(xp,Iarg_z));
    370   } else {
    371     push_on_lisp_stack(xp,ra);
    372     push_on_lisp_stack(xp,xpGPR(xp,Iebp));
    373     xpGPR(xp,Iebp) = xpGPR(xp,Isp);
    374     if (nargs == 2) {
    375       push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
    376     }
    377     if (nargs >= 1) {
    378       push_on_lisp_stack(xp,xpGPR(xp,Iarg_z));
    379     }
    380   }
    381 #endif
    382353}
    383354
Note: See TracChangeset for help on using the changeset viewer.