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

« back to all changes in this revision

Viewing changes to src/buildvm_x86.dasc

  • 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:
2623
2623
  |.endif
2624
2624
  |  lea FCARG1, [DISPATCH+GG_DISP2J]
2625
2625
  |  call extern lj_trace_exit@8        // (jit_State *J, ExitState *ex)
2626
 
  |  // Error code returned in eax (RD).
 
2626
  |  // MULTRES or negated error code returned in eax (RD).
2627
2627
  |  mov RAa, L:RB->cframe
2628
2628
  |  and RAa, CFRAME_RAWMASK
2629
2629
  |.if X64WIN
2638
2638
  |  mov PC, [RAa+CFRAME_OFS_PC]        // Get SAVE_PC.
2639
2639
  |.if X64
2640
2640
  |  jmp >1
2641
 
  |.else
2642
 
  |  test RD, RD; jnz >2                // Check for error from exit.
2643
2641
  |.endif
2644
2642
#endif
2645
2643
  |->vm_exit_interp:
 
2644
  |  // RD = MULTRES or negated error code, BASE, PC and DISPATCH set.
2646
2645
#if LJ_HASJIT
2647
2646
  |.if X64
2648
 
  |  xor RD, RD
2649
2647
  |  // Restore additional callee-save registers only used in compiled code.
2650
2648
  |.if X64WIN
2651
2649
  |  lea RAa, [rsp+9*16+4*8]
2669
2667
  |.endif
2670
2668
  |  mov r13, TMPa
2671
2669
  |  mov r12, TMPQ
2672
 
  |  test RD, RD; jnz >2                // Check for error from exit.
2673
2670
  |.endif
 
2671
  |  test RD, RD; js >2                 // Check for error from exit.
 
2672
  |  mov MULTRES, RD
2674
2673
  |  mov LFUNC:KBASE, [BASE-8]
2675
2674
  |  mov KBASE, LFUNC:KBASE->pc
2676
2675
  |  mov KBASE, [KBASE+PC2PROTO(k)]
2679
2678
  |  ins_next
2680
2679
  |
2681
2680
  |2:  // Rethrow error from the right C frame.
 
2681
  |  neg RD
2682
2682
  |  mov FCARG1, L:RB
2683
2683
  |  mov FCARG2, RD
2684
2684
  |  call extern lj_err_throw@8         // (lua_State *L, int errcode)
4284
4284
    |  ins_AD   // RA = base (table at base-1), RD = num const (start index)
4285
4285
    |  mov TMP1, KBASE                  // Need one more free register.
4286
4286
    if (sse) {
4287
 
      |  movsd xmm0, qword [KBASE+RD*8]
 
4287
      |  cvtsd2si KBASE, qword [KBASE+RD*8]
4288
4288
    } else {
4289
4289
      |.if not X64
4290
4290
      |  fld qword [KBASE+RD*8]
4291
4291
      |  fistp ARG4                     // Const is guaranteed to be an int.
 
4292
      |  mov KBASE, ARG4
4292
4293
      |.endif
4293
4294
    }
4294
4295
    |1:
4298
4299
    |  jnz >7
4299
4300
    |2:
4300
4301
    |  mov RD, MULTRES
4301
 
    if (sse) {
4302
 
      |  cvtsd2si KBASE, xmm0           // Const is guaranteed to be an int.
4303
 
    } else {
4304
 
      |.if not X64
4305
 
      |  mov KBASE, ARG4
4306
 
      |.endif
4307
 
    }
4308
4302
    |  sub RD, 1
4309
4303
    |  jz >4                            // Nothing to copy?
4310
4304
    |  add RD, KBASE                    // Compute needed size.