Răsfoiți Sursa

Minor tweaks to integration of assembler part.

Remove unneeded PC restore in vm_growstack_*.
Don't declare symbols that are unused in interpreter-only builds.
Don't embed lj_vm_foldfpm in interpreter-only builds.
Add 2nd temporary TValue in lua_State.
Mike Pall 15 ani în urmă
părinte
comite
e1efd0d871
6 a modificat fișierele cu 1828 adăugiri și 1811 ștergeri
  1. 654 655
      src/buildvm_x64.h
  2. 583 580
      src/buildvm_x64win.h
  3. 3 2
      src/buildvm_x86.dasc
  4. 576 573
      src/buildvm_x86.h
  5. 1 1
      src/lj_obj.h
  6. 11 0
      src/lj_vm.h

Fișier diff suprimat deoarece este prea mare
+ 654 - 655
src/buildvm_x64.h


Fișier diff suprimat deoarece este prea mare
+ 583 - 580
src/buildvm_x64win.h


+ 3 - 2
src/buildvm_x86.dasc

@@ -574,11 +574,10 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
   |  mov BASE, L:RB->base
   |  mov RD, L:RB->top
   |  mov LFUNC:RB, [BASE-8]
-  |  mov PC, [BASE-4]
   |  sub RD, BASE
   |  shr RD, 3
   |  add NARGS:RD, 1
-  |  // BASE = new base, RB = LFUNC, RD = nargs+1, PC restored.
+  |  // BASE = new base, RB = LFUNC, RD = nargs+1
   |  ins_callt				// Just retry the call.
   |
   |//-----------------------------------------------------------------------
@@ -3079,6 +3078,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
   |// Callable from C: double lj_vm_foldfpm(double x, int fpm)
   |// Computes fpm(x) for extended math functions. ORDER FPM.
   |->vm_foldfpm:
+#if LJ_HASJIT
   if (sse) {
     |.if X64
     |
@@ -3174,6 +3174,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
     |1: ; fptan; fpop; ret
   }
   |9: ; int3					// Bad fpm.
+#endif
   |
   |// Callable from C: double lj_vm_foldarith(double x, double y, int op)
   |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -)

Fișier diff suprimat deoarece este prea mare
+ 576 - 573
src/buildvm_x86.h


+ 1 - 1
src/lj_obj.h

@@ -480,7 +480,7 @@ typedef struct global_State {
   uint8_t vmevmask;	/* VM event mask. */
   GCRef mainthref;	/* Link to main thread. */
   TValue registrytv;	/* Anchor for registry. */
-  TValue tmptv;		/* Temporary TValue. */
+  TValue tmptv, tmptv2;	/* Temporary TValues. */
   GCupval uvhead;	/* Head of double-linked list of all open upvalues. */
   int32_t hookcount;	/* Instruction hook countdown. */
   int32_t hookcstart;	/* Start count for instruction hook counter. */

+ 11 - 0
src/lj_vm.h

@@ -25,7 +25,9 @@ LJ_ASMF void lj_vm_unwind_ff_eh(void);
 LJ_ASMF int lj_vm_cpuid(uint32_t f, uint32_t res[4]);
 #endif
 LJ_ASMF double lj_vm_foldarith(double x, double y, int op);
+#if LJ_HASJIT
 LJ_ASMF double lj_vm_foldfpm(double x, int op);
+#endif
 
 /* Dispatch targets for recording and hooks. */
 LJ_ASMF void lj_vm_record(void);
@@ -38,6 +40,8 @@ LJ_ASMF void lj_vm_exit_handler(void);
 LJ_ASMF void lj_vm_exit_interp(void);
 
 /* Handlers callable from compiled code. */
+#if LJ_HASJIT
+#if LJ_TARGET_X86ORX64
 LJ_ASMF void lj_vm_floor_sse(void);
 LJ_ASMF void lj_vm_ceil_sse(void);
 LJ_ASMF void lj_vm_trunc_sse(void);
@@ -45,6 +49,13 @@ LJ_ASMF void lj_vm_exp(void);
 LJ_ASMF void lj_vm_exp2(void);
 LJ_ASMF void lj_vm_pow_sse(void);
 LJ_ASMF void lj_vm_powi_sse(void);
+#else
+LJ_ASMF void lj_vm_floor(void);
+LJ_ASMF void lj_vm_ceil(void);
+LJ_ASMF void lj_vm_trunc(void);
+LJ_ASMF void lj_vm_powi(void);
+#endif
+#endif
 
 /* Continuations for metamethods. */
 LJ_ASMF void lj_cont_cat(void);  /* Continue with concatenation. */

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff