Inline-Lua

 view release on metacpan or  search on metacpan

ffi/target/release/build/mlua-sys-6a99a2ae50f12319/out/luajit-build/build/src/host/buildvm_arch.h  view on Meta::CPAN

  GLOB_vm_call_dispatch_f,
  GLOB_vm_cpcall,
  GLOB_cont_ffi_callback,
  GLOB_vm_call_tail,
  GLOB_cont_cat,
  GLOB_cont_ra,
  GLOB_BC_CAT_Z,
  GLOB_vmeta_tgets,
  GLOB_vmeta_tgetb,
  GLOB_vmeta_tgetv,
  GLOB_vmeta_tgetr,
  GLOB_BC_TGETR_Z,
  GLOB_BC_TGETR2_Z,
  GLOB_vmeta_tsets,
  GLOB_vmeta_tsetb,
  GLOB_vmeta_tsetv,
  GLOB_cont_nop,
  GLOB_vmeta_tsetr,
  GLOB_BC_TSETR_Z,
  GLOB_vmeta_comp,
  GLOB_vmeta_binop,
  GLOB_cont_condt,
  GLOB_cont_condf,
  GLOB_vmeta_equal,
  GLOB_vmeta_equal_cd,
  GLOB_vmeta_istype,
  GLOB_vmeta_arith_vno,
  GLOB_vmeta_arith_vn,
  GLOB_vmeta_arith_nvo,
  GLOB_vmeta_arith_nv,
  GLOB_vmeta_unm,
  GLOB_vmeta_arith_vvo,
  GLOB_vmeta_arith_vv,
  GLOB_vmeta_len,
  GLOB_BC_LEN_Z,
  GLOB_vmeta_call_ra,
  GLOB_BC_CALLT_Z,
  GLOB_vmeta_for,
  GLOB_ff_assert,
  GLOB_fff_fallback,
  GLOB_fff_res_,
  GLOB_ff_type,
  GLOB_fff_res1,
  GLOB_ff_getmetatable,
  GLOB_ff_setmetatable,
  GLOB_ff_rawget,
  GLOB_ff_tonumber,
  GLOB_ff_tostring,
  GLOB_fff_fallback_1,
  GLOB_fff_gcstep,
  GLOB_ff_next,
  GLOB_fff_res2,
  GLOB_fff_fallback_2,
  GLOB_ff_pairs,
  GLOB_fff_res,
  GLOB_ff_ipairs_aux,
  GLOB_fff_res0,
  GLOB_ff_ipairs,
  GLOB_ff_pcall,
  GLOB_ff_xpcall,
  GLOB_ff_coroutine_resume,
  GLOB_ff_coroutine_wrap_aux,
  GLOB_ff_coroutine_yield,
  GLOB_ff_math_abs,
  GLOB_ff_math_sqrt,
  GLOB_fff_resxmm0,
  GLOB_ff_math_floor,
  GLOB_vm_floor_sse,
  GLOB_ff_math_ceil,
  GLOB_vm_ceil_sse,
  GLOB_ff_math_log,
  GLOB_ff_math_log10,
  GLOB_ff_math_exp,
  GLOB_ff_math_sin,
  GLOB_ff_math_cos,
  GLOB_ff_math_tan,
  GLOB_ff_math_asin,
  GLOB_ff_math_acos,
  GLOB_ff_math_atan,
  GLOB_ff_math_sinh,
  GLOB_ff_math_cosh,
  GLOB_ff_math_tanh,
  GLOB_ff_math_pow,
  GLOB_ff_math_atan2,
  GLOB_ff_math_fmod,
  GLOB_ff_math_ldexp,
  GLOB_ff_math_frexp,
  GLOB_ff_math_modf,
  GLOB_ff_math_min,
  GLOB_ff_math_max,
  GLOB_ff_string_byte,
  GLOB_ff_string_char,
  GLOB_fff_newstr,
  GLOB_fff_resstr,
  GLOB_ff_string_sub,
  GLOB_fff_emptystr,
  GLOB_ff_string_reverse,
  GLOB_ff_string_lower,
  GLOB_ff_string_upper,
  GLOB_ff_bit_tobit,
  GLOB_fff_resbit,
  GLOB_ff_bit_band,
  GLOB_fff_fallback_bit_op,
  GLOB_ff_bit_bor,
  GLOB_ff_bit_bxor,
  GLOB_ff_bit_bswap,
  GLOB_ff_bit_bnot,
  GLOB_ff_bit_lshift,
  GLOB_ff_bit_rshift,
  GLOB_ff_bit_arshift,
  GLOB_ff_bit_rol,
  GLOB_ff_bit_ror,
  GLOB_vm_record,
  GLOB_vm_rethook,
  GLOB_vm_inshook,
  GLOB_cont_hook,
  GLOB_vm_hotloop,
  GLOB_vm_callhook,
  GLOB_vm_hotcall,
  GLOB_cont_stitch,
  GLOB_vm_profhook,
  GLOB_vm_exit_handler,
  GLOB_vm_exit_interp,

ffi/target/release/build/mlua-sys-6a99a2ae50f12319/out/luajit-build/build/src/host/buildvm_arch.h  view on Meta::CPAN

  "vm_call_dispatch_f",
  "vm_cpcall",
  "cont_ffi_callback",
  "vm_call_tail",
  "cont_cat",
  "cont_ra",
  "BC_CAT_Z",
  "vmeta_tgets",
  "vmeta_tgetb",
  "vmeta_tgetv",
  "vmeta_tgetr",
  "BC_TGETR_Z",
  "BC_TGETR2_Z",
  "vmeta_tsets",
  "vmeta_tsetb",
  "vmeta_tsetv",
  "cont_nop",
  "vmeta_tsetr",
  "BC_TSETR_Z",
  "vmeta_comp",
  "vmeta_binop",
  "cont_condt",
  "cont_condf",
  "vmeta_equal",
  "vmeta_equal_cd",
  "vmeta_istype",
  "vmeta_arith_vno",
  "vmeta_arith_vn",
  "vmeta_arith_nvo",
  "vmeta_arith_nv",
  "vmeta_unm",
  "vmeta_arith_vvo",
  "vmeta_arith_vv",
  "vmeta_len",
  "BC_LEN_Z",
  "vmeta_call_ra",
  "BC_CALLT_Z",
  "vmeta_for",
  "ff_assert",
  "fff_fallback",
  "fff_res_",
  "ff_type",
  "fff_res1",
  "ff_getmetatable",
  "ff_setmetatable",
  "ff_rawget",
  "ff_tonumber",
  "ff_tostring",
  "fff_fallback_1",
  "fff_gcstep",
  "ff_next",
  "fff_res2",
  "fff_fallback_2",
  "ff_pairs",
  "fff_res",
  "ff_ipairs_aux",
  "fff_res0",
  "ff_ipairs",
  "ff_pcall",
  "ff_xpcall",
  "ff_coroutine_resume",
  "ff_coroutine_wrap_aux",
  "ff_coroutine_yield",
  "ff_math_abs",
  "ff_math_sqrt",
  "fff_resxmm0",
  "ff_math_floor",
  "vm_floor_sse",
  "ff_math_ceil",
  "vm_ceil_sse",
  "ff_math_log",
  "ff_math_log10",
  "ff_math_exp",
  "ff_math_sin",
  "ff_math_cos",
  "ff_math_tan",
  "ff_math_asin",
  "ff_math_acos",
  "ff_math_atan",
  "ff_math_sinh",
  "ff_math_cosh",
  "ff_math_tanh",
  "ff_math_pow",
  "ff_math_atan2",
  "ff_math_fmod",
  "ff_math_ldexp",
  "ff_math_frexp",
  "ff_math_modf",
  "ff_math_min",
  "ff_math_max",
  "ff_string_byte",
  "ff_string_char",
  "fff_newstr",
  "fff_resstr",
  "ff_string_sub",
  "fff_emptystr",
  "ff_string_reverse",
  "ff_string_lower",
  "ff_string_upper",
  "ff_bit_tobit",
  "fff_resbit",
  "ff_bit_band",
  "fff_fallback_bit_op",
  "ff_bit_bor",
  "ff_bit_bxor",
  "ff_bit_bswap",
  "ff_bit_bnot",
  "ff_bit_lshift",
  "ff_bit_rshift",
  "ff_bit_arshift",
  "ff_bit_rol",
  "ff_bit_ror",
  "vm_record",
  "vm_rethook",
  "vm_inshook",
  "cont_hook",
  "vm_hotloop",
  "vm_callhook",
  "vm_hotcall",
  "cont_stitch",
  "vm_profhook",
  "vm_exit_handler",
  "vm_exit_interp",
  "vm_floor",
  "vm_ceil",
  "vm_trunc",
  "vm_trunc_sse",
  "vm_mod",
  "vm_cpuid",
  "vm_next",
  "assert_bad_for_arg_type",
  "vm_ffi_callback",
  "vm_ffi_call",
  "BC_MODVN_Z",
  "BC_TGETS_Z",
  "BC_TSETS_Z",
  "vm_IITERN",
  (const char *)0
};
#line 11 "vm_x64.dasc"
//|.externnames extnames
static const char *const extnames[] = {
  "lj_state_growstack",
  "lj_err_throw",
  "lj_meta_tget",
  "lj_tab_getinth",
  "lj_meta_tset",
  "lj_tab_setinth",
  "lj_meta_comp",
  "lj_meta_equal",
  "lj_meta_equal_cd",
  "lj_meta_istype",
  "lj_meta_arith",
  "lj_meta_len",
  "lj_meta_call",
  "lj_meta_for",
  "lj_tab_get",
  "lj_strfmt_num",
  "lj_tab_next",
  "lj_ffh_coroutine_wrap_err",
  "log",
  "log10",
  "exp",
  "sin",
  "cos",
  "tan",
  "asin",
  "acos",
  "atan",
  "sinh",
  "cosh",
  "tanh",
  "pow",
  "atan2",
  "fmod",
  "frexp",
  "modf",
  "lj_str_new",
  "lj_buf_putstr_reverse",
  "lj_buf_tostr",
  "lj_buf_putstr_lower",
  "lj_buf_putstr_upper",
  "lj_gc_step",
  "lj_dispatch_ins",
  "lj_trace_hot",
  "lj_dispatch_call",
  "lj_dispatch_stitch",
  "lj_dispatch_profile",
  "lj_trace_exit",
  "lj_err_trace",
  "lj_ccallback_enter",
  "lj_ccallback_leave",
  "lj_tab_len",
  "lj_meta_cat",
  "lj_gc_barrieruv",
  "lj_func_closeuv",
  "lj_func_newL_gc",
  "lj_tab_new",
  "lj_gc_step_fixtop",
  "lj_tab_dup",
  "lj_tab_newkey",
  "lj_tab_reasize",
  (const char *)0
};
#line 12 "vm_x64.dasc"
//|
//|//-----------------------------------------------------------------------
//|
//|.if WIN
//|.define X64WIN, 1			// Windows/x64 calling conventions.
//|.endif
//|
//|// Fixed register assignments for the interpreter.
//|// This is very fragile and has many dependencies. Caveat emptor.
//|.define BASE,		rdx		// Not C callee-save, refetched anyway.
//|.if X64WIN
//|.define KBASE,		rdi		// Must be C callee-save.
//|.define PC,		rsi		// Must be C callee-save.
//|.define DISPATCH,	rbx		// Must be C callee-save.
//|.define KBASEd,	edi

ffi/target/release/build/mlua-sys-6a99a2ae50f12319/out/luajit-build/build/src/host/buildvm_arch.h  view on Meta::CPAN

  dasm_put(Dst, 3120, Dt6(->metatable));
#line 1446 "vm_x64.dasc"
#endif
  //|  mov CFUNC:RD, [BASE-16]
  //|  cleartp CFUNC:RD
  //|  mov CFUNC:RD, CFUNC:RD->upvalue[0]
  //|  settp CFUNC:RD, LJ_TFUNC
  //|  mov PC, [BASE-8]
  //|  mov [BASE-16], CFUNC:RD
  //|  mov [BASE-8], TMPR
  //|.if DUALNUM
  //|  mov64 RD, ((uint64_t)LJ_TISNUM<<47)
  //|  mov [BASE], RD
  //|.else
  //|  mov qword [BASE], 0
  //|.endif
  //|  mov RDd, 1+3
  //|  jmp ->fff_res
  //|
  //|//-- Base library: catch errors ----------------------------------------
  //|
  //|.ffunc_1 pcall
  //|  mov L:RB, SAVE_L
  //|  lea RA, [BASE+NARGS:RD*8]
  //|  cmp RA, L:RB->maxstack; ja ->fff_fallback
  //|  lea RA, [BASE+16]
  //|  sub NARGS:RDd, 1
  //|  mov PCd, 16+FRAME_PCALL
  //|1:
  //|  movzx RBd, byte [DISPATCH+DISPATCH_GL(hookmask)]
  //|  shr RB, HOOK_ACTIVE_SHIFT
  //|  and RB, 1
  //|  add PC, RB				// Remember active hook before pcall.
  //|  // Note: this does a (harmless) copy of the function to the PC slot, too.
  //|  mov KBASE, RD
  //|2:
  //|  mov RB, [RA+KBASE*8-24]
  //|  mov [RA+KBASE*8-16], RB
  //|  sub KBASE, 1
  //|  ja <2
  //|  jmp ->vm_call_dispatch
  dasm_put(Dst, 3404, Dt8(->upvalue[0]), (unsigned int)(((uint64_t)LJ_TFUNC<<47)), (unsigned int)((((uint64_t)LJ_TFUNC<<47))>>32), 1+3, 1+1, Dt1(->maxstack), 16+FRAME_PCALL, DISPATCH_GL(hookmask), HOOK_ACTIVE_SHIFT);
#line 1485 "vm_x64.dasc"
  //|
  //|.ffunc_2 xpcall
  //|  mov L:RB, SAVE_L
  //|  lea RA, [BASE+NARGS:RD*8]
  //|  cmp RA, L:RB->maxstack; ja ->fff_fallback
  //|  mov LFUNC:RA, [BASE+8]
  //|  checktp_nc LFUNC:RA, LJ_TFUNC, ->fff_fallback
  //|  mov LFUNC:RB, [BASE]		// Swap function and traceback.
  //|  mov [BASE], LFUNC:RA
  //|  mov [BASE+8], LFUNC:RB
  //|  lea RA, [BASE+24]
  //|  sub NARGS:RDd, 2
  //|  mov PCd, 24+FRAME_PCALL
  //|  jmp <1
  //|
  //|//-- Coroutine library --------------------------------------------------
  //|
  //|.macro coroutine_resume_wrap, resume
  //|.if resume
  //|.ffunc_1 coroutine_resume
  //|  mov L:RB, [BASE]
  //|  cleartp L:RB
  //|.else
  //|.ffunc coroutine_wrap_aux
  //|  mov CFUNC:RB, [BASE-16]
  //|  cleartp CFUNC:RB
  //|  mov L:RB, CFUNC:RB->upvalue[0].gcr
  //|  cleartp L:RB
  //|.endif
  //|  mov PC, [BASE-8]
  //|  mov SAVE_PC, PC
  //|  mov TMP1, L:RB
  //|.if resume
  //|  checktptp [BASE], LJ_TTHREAD, ->fff_fallback
  //|.endif
  //|  cmp aword L:RB->cframe, 0; jne ->fff_fallback
  //|  cmp byte L:RB->status, LUA_YIELD;  ja ->fff_fallback
  //|  mov RA, L:RB->top
  //|  je >1				// Status != LUA_YIELD (i.e. 0)?
  //|  cmp RA, L:RB->base			// Check for presence of initial func.
  //|  je ->fff_fallback
  //|  mov PC, [RA-8]			// Move initial function up.
  //|  mov [RA], PC
  //|  add RA, 8
  //|1:
  //|.if resume
  //|  lea PC, [RA+NARGS:RD*8-16]		// Check stack space (-1-thread).
  //|.else
  //|  lea PC, [RA+NARGS:RD*8-8]		// Check stack space (-1).
  //|.endif
  //|  cmp PC, L:RB->maxstack; ja ->fff_fallback
  //|  mov L:RB->top, PC
  //|
  //|  mov L:RB, SAVE_L
  //|  mov L:RB->base, BASE
  //|.if resume
  //|  add BASE, 8			// Keep resumed thread in stack for GC.
  //|.endif
  //|  mov L:RB->top, BASE
  //|.if resume
  //|  lea RB, [BASE+NARGS:RD*8-24]	// RB = end of source for stack move.
  //|.else
  //|  lea RB, [BASE+NARGS:RD*8-16]	// RB = end of source for stack move.
  //|.endif
  //|  sub RB, PC			// Relative to PC.
  //|
  //|  cmp PC, RA
  //|  je >3
  //|2:  // Move args to coroutine.
  //|  mov RC, [PC+RB]
  //|  mov [PC-8], RC
  //|  sub PC, 8
  //|  cmp PC, RA
  //|  jne <2
  //|3:
  //|  mov CARG2, RA
  //|  mov CARG1, TMP1
  //|  call ->vm_resume			// (lua_State *L, TValue *base, 0, 0)
  //|
  //|  mov L:RB, SAVE_L
  //|  mov L:PC, TMP1
  //|  mov BASE, L:RB->base
  //|  mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB
  //|  set_vmstate INTERP
  //|
  //|  cmp eax, LUA_YIELD
  //|  ja >8
  //|4:
  //|  mov RA, L:PC->base
  //|  mov KBASE, L:PC->top
  //|  mov L:PC->top, RA			// Clear coroutine stack.
  //|  mov PC, KBASE
  //|  sub PC, RA
  //|  je >6				// No results?
  //|  lea RD, [BASE+PC]
  //|  shr PCd, 3
  //|  cmp RD, L:RB->maxstack
  //|  ja >9				// Need to grow stack?
  //|
  //|  mov RB, BASE
  //|  sub RB, RA
  //|5:  // Move results from coroutine.
  //|  mov RD, [RA]
  //|  mov [RA+RB], RD
  //|  add RA, 8
  //|  cmp RA, KBASE
  //|  jne <5
  //|6:
  //|.if resume
  //|  lea RDd, [PCd+2]			// nresults+1 = 1 + true + results.
  //|  mov_true ITYPE			// Prepend true to results.
  //|  mov [BASE-8], ITYPE
  //|.else
  //|  lea RDd, [PCd+1]			// nresults+1 = 1 + results.
  //|.endif
  //|7:
  //|  mov PC, SAVE_PC
  //|  mov MULTRES, RDd
  //|.if resume
  //|  mov RA, -8
  //|.else
  //|  xor RAd, RAd
  //|.endif
  //|  test PCd, FRAME_TYPE
  //|  jz ->BC_RET_Z
  //|  jmp ->vm_return
  //|
  //|8:  // Coroutine returned with error (at co->top-1).
  //|.if resume
  //|  mov_false ITYPE			// Prepend false to results.
  //|  mov [BASE-8], ITYPE
  //|  mov RA, L:PC->top
  //|  sub RA, 8
  //|  mov L:PC->top, RA			// Clear error from coroutine stack.
  //|  // Copy error message.
  //|  mov RD, [RA]
  //|  mov [BASE], RD
  //|  mov RDd, 1+2			// nresults+1 = 1 + false + error.
  //|  jmp <7
  //|.else
  //|  mov CARG2, L:PC
  //|  mov CARG1, L:RB
  //|  call extern lj_ffh_coroutine_wrap_err  // (lua_State *L, lua_State *co)
  //|  // Error function does not return.
  //|.endif
  //|
  //|9:  // Handle stack expansion on return from yield.
  //|  mov L:RA, TMP1
  //|  mov L:RA->top, KBASE		// Undo coroutine stack clearing.
  //|  mov CARG2, PC
  //|  mov CARG1, L:RB
  //|  call extern lj_state_growstack	// (lua_State *L, int n)
  //|  mov L:PC, TMP1
  //|  mov BASE, L:RB->base
  //|  jmp <4				// Retry the stack move.
  //|.endmacro
  //|
  //|  coroutine_resume_wrap 1		// coroutine.resume
  dasm_put(Dst, 3540, 2+1, Dt1(->maxstack), LJ_TFUNC, 24+FRAME_PCALL, 1+1);
  dasm_put(Dst, 3626, LJ_TTHREAD, Dt1(->cframe), Dt1(->status), LUA_YIELD, Dt1(->top), Dt1(->base), Dt1(->maxstack));
  dasm_put(Dst, 3731, Dt1(->top), Dt1(->base), Dt1(->top), Dt1(->base), DISPATCH_GL(cur_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, LUA_YIELD);
  dasm_put(Dst, 3835, Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->maxstack), (unsigned int)((int64_t)~((uint64_t)2<<47)), (unsigned int)(((int64_t)~((uint64_t)2<<47))>>32), FRAME_TYPE, (unsigned int)((int64_t)~((uint64_t)1<<47)), (unsigned int)(((int6...
#line 1643 "vm_x64.dasc"
  //|  coroutine_resume_wrap 0		// coroutine.wrap
  dasm_put(Dst, 3955, Dt1(->top), Dt1(->top), 1+2, Dt1(->top), Dt1(->base), Dt8(->upvalue[0].gcr), Dt1(->cframe), Dt1(->status), LUA_YIELD);
  dasm_put(Dst, 4079, Dt1(->top), Dt1(->base), Dt1(->maxstack), Dt1(->top), Dt1(->base), Dt1(->top));
  dasm_put(Dst, 4182, Dt1(->base), DISPATCH_GL(cur_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, LUA_YIELD, Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->maxstack));
#line 1644 "vm_x64.dasc"
  //|
  //|.ffunc coroutine_yield
  //|  mov L:RB, SAVE_L
  //|  test aword L:RB->cframe, CFRAME_RESUME
  //|  jz ->fff_fallback
  //|  mov L:RB->base, BASE
  dasm_put(Dst, 4272, FRAME_TYPE, Dt1(->top), Dt1(->base), Dt1(->cframe), CFRAME_RESUME);
#line 1650 "vm_x64.dasc"
  //|  lea RD, [BASE+NARGS:RD*8-8]
  //|  mov L:RB->top, RD
  //|  xor RDd, RDd
  //|  mov aword L:RB->cframe, RD
  //|  mov al, LUA_YIELD
  //|  mov byte L:RB->status, al
  //|  jmp ->vm_leave_unw
  //|
  //|//-- Math library -------------------------------------------------------
  //|
  //|  .ffunc_1 math_abs
  //|  mov RB, [BASE]
  //|.if DUALNUM
  //|  checkint RB, >3
  //|  cmp RBd, 0; jns ->fff_resi
  //|  neg RBd; js >2
  //|->fff_resbit:
  //|->fff_resi:
  //|  setint RB
  //|->fff_resRB:
  //|  mov PC, [BASE-8]
  //|  mov [BASE-16], RB
  //|  jmp ->fff_res1
  //|2:
  //|  mov64 RB, U64x(41e00000,00000000)  // 2^31.
  //|  jmp ->fff_resRB
  //|3:
  //|  ja ->fff_fallback
  //|.else
  //|  checknum RB, ->fff_fallback
  //|.endif
  //|  shl RB, 1
  //|  shr RB, 1
  //|  mov PC, [BASE-8]
  //|  mov [BASE-16], RB
  //|  jmp ->fff_res1
  //|
  //|.ffunc_n math_sqrt, sqrtsd
  dasm_put(Dst, 4384, Dt1(->base), Dt1(->top), Dt1(->cframe), LUA_YIELD, Dt1(->status), 1+1, LJ_TISNUM, 1+1);
#line 1688 "vm_x64.dasc"
  //|->fff_resxmm0:
  //|  mov PC, [BASE-8]
  //|  movsd qword [BASE-16], xmm0
  //|  // fallthrough
  //|
  //|->fff_res1:
  //|  mov RDd, 1+1
  //|->fff_res:
  //|  mov MULTRES, RDd
  //|->fff_res_:
  //|  test PCd, FRAME_TYPE
  //|  jnz >7
  //|5:
  //|  cmp PC_RB, RDL			// More results expected?



( run in 0.601 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )