~ubuntu-branches/ubuntu/natty/luajit/natty

« back to all changes in this revision

Viewing changes to src/lj_trace.c

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2010-03-29 11:28:36 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100329112836-jyl39c159mh294kc
Tags: 2.0.0~beta4+dfsg-1
* new upstream release
* bumped stsandards version to 3.8.4, no changes 
* switch to source format 3 + quilt 

Show diffs side-by-side

added added

removed removed

Lines of Context:
666
666
  ExitDataCP exd;
667
667
  int errcode;
668
668
  const BCIns *pc;
 
669
  void *cf;
669
670
  exd.J = J;
670
671
  exd.exptr = exptr;
671
672
  errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp);
672
673
  if (errcode)
673
 
    return errcode;
 
674
    return -errcode;  /* Return negated error code. */
674
675
 
675
676
  lj_vmevent_send(L, TEXIT,
676
677
    ExitState *ex = (ExitState *)exptr;
692
693
 
693
694
  pc = exd.pc;
694
695
  trace_hotside(J, pc);
 
696
  cf = cframe_raw(L->cframe);
695
697
  if (bc_op(*pc) == BC_JLOOP) {
696
698
    BCIns *retpc = &J->trace[bc_d(*pc)]->startins;
697
699
    if (bc_isret(bc_op(*retpc))) {
704
706
      }
705
707
    }
706
708
  }
707
 
  setcframe_pc(cframe_raw(L->cframe), pc);
708
 
  return 0;
 
709
  setcframe_pc(cf, pc);
 
710
  /* Return MULTRES or 0. */
 
711
  switch (bc_op(*pc)) {
 
712
  case BC_CALLM: case BC_CALLMT:
 
713
    return (int)((BCReg)(L->top - L->base) - bc_a(*pc) - bc_c(*pc));
 
714
  case BC_RETM:
 
715
    return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc) - bc_d(*pc));
 
716
  case BC_TSETM:
 
717
    return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc));
 
718
  default:
 
719
    return 0;
 
720
  }
709
721
}
710
722
 
711
723
#endif