immunio 1.1.2 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immunio/version.rb +1 -1
  3. data/lua-hooks/Makefile +56 -109
  4. data/lua-hooks/ext/all.c +3 -14
  5. data/lua-hooks/ext/libinjection/module.mk +5 -0
  6. data/lua-hooks/ext/lpeg/module.mk +6 -0
  7. data/lua-hooks/ext/lua-cmsgpack/module.mk +2 -0
  8. data/lua-hooks/ext/lua-snapshot/module.mk +2 -0
  9. data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
  10. data/lua-hooks/ext/luajit/Makefile +2 -2
  11. data/lua-hooks/ext/luajit/README +2 -2
  12. data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
  13. data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
  14. data/lua-hooks/ext/luajit/doc/changes.html +15 -2
  15. data/lua-hooks/ext/luajit/doc/contact.html +3 -3
  16. data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
  17. data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
  18. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
  19. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +4 -2
  20. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
  21. data/lua-hooks/ext/luajit/doc/ext_jit.html +2 -2
  22. data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
  23. data/lua-hooks/ext/luajit/doc/extensions.html +9 -2
  24. data/lua-hooks/ext/luajit/doc/faq.html +2 -2
  25. data/lua-hooks/ext/luajit/doc/install.html +22 -18
  26. data/lua-hooks/ext/luajit/doc/luajit.html +3 -3
  27. data/lua-hooks/ext/luajit/doc/running.html +2 -2
  28. data/lua-hooks/ext/luajit/doc/status.html +2 -2
  29. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
  30. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +4 -4
  31. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
  32. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +4 -4
  33. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +1 -1
  34. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +4 -4
  35. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
  36. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +4 -4
  37. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +3 -3
  38. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
  39. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +34 -7
  40. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +427 -102
  41. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +5 -5
  42. data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
  43. data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
  44. data/lua-hooks/ext/luajit/src/Makefile +36 -21
  45. data/lua-hooks/ext/luajit/src/Makefile.dep +3 -1
  46. data/lua-hooks/ext/luajit/src/host/buildvm.c +1 -1
  47. data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
  48. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +10 -1
  49. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +1 -1
  50. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
  51. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +1 -1
  52. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
  53. data/lua-hooks/ext/luajit/src/host/genminilua.lua +1 -1
  54. data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
  55. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +2 -2
  56. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +1 -1
  57. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +1 -1
  58. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
  59. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +1 -1
  60. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
  61. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +163 -73
  62. data/lua-hooks/ext/luajit/src/jit/dump.lua +2 -1
  63. data/lua-hooks/ext/luajit/src/jit/p.lua +1 -1
  64. data/lua-hooks/ext/luajit/src/jit/v.lua +1 -1
  65. data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
  66. data/lua-hooks/ext/luajit/src/lib_aux.c +1 -1
  67. data/lua-hooks/ext/luajit/src/lib_base.c +4 -5
  68. data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
  69. data/lua-hooks/ext/luajit/src/lib_debug.c +1 -1
  70. data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -5
  71. data/lua-hooks/ext/luajit/src/lib_init.c +1 -1
  72. data/lua-hooks/ext/luajit/src/lib_io.c +2 -3
  73. data/lua-hooks/ext/luajit/src/lib_jit.c +1 -1
  74. data/lua-hooks/ext/luajit/src/lib_math.c +1 -1
  75. data/lua-hooks/ext/luajit/src/lib_os.c +2 -2
  76. data/lua-hooks/ext/luajit/src/lib_package.c +1 -1
  77. data/lua-hooks/ext/luajit/src/lib_string.c +1 -1
  78. data/lua-hooks/ext/luajit/src/lib_table.c +1 -1
  79. data/lua-hooks/ext/luajit/src/lj.supp +15 -0
  80. data/lua-hooks/ext/luajit/src/lj_alloc.c +1 -1
  81. data/lua-hooks/ext/luajit/src/lj_api.c +4 -1
  82. data/lua-hooks/ext/luajit/src/lj_arch.h +33 -7
  83. data/lua-hooks/ext/luajit/src/lj_asm.c +12 -5
  84. data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
  85. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +3 -13
  86. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +337 -71
  87. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2 -2
  88. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2 -2
  89. data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
  90. data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
  91. data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
  92. data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
  93. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
  94. data/lua-hooks/ext/luajit/src/lj_buf.c +2 -4
  95. data/lua-hooks/ext/luajit/src/lj_buf.h +1 -3
  96. data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
  97. data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
  98. data/lua-hooks/ext/luajit/src/lj_ccall.c +37 -14
  99. data/lua-hooks/ext/luajit/src/lj_ccall.h +3 -3
  100. data/lua-hooks/ext/luajit/src/lj_ccallback.c +16 -7
  101. data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
  102. data/lua-hooks/ext/luajit/src/lj_cconv.c +1 -1
  103. data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
  104. data/lua-hooks/ext/luajit/src/lj_cdata.c +10 -1
  105. data/lua-hooks/ext/luajit/src/lj_cdata.h +3 -1
  106. data/lua-hooks/ext/luajit/src/lj_clib.c +1 -1
  107. data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
  108. data/lua-hooks/ext/luajit/src/lj_cparse.c +27 -6
  109. data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
  110. data/lua-hooks/ext/luajit/src/lj_crecord.c +1 -1
  111. data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
  112. data/lua-hooks/ext/luajit/src/lj_ctype.c +10 -8
  113. data/lua-hooks/ext/luajit/src/lj_ctype.h +1 -1
  114. data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
  115. data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
  116. data/lua-hooks/ext/luajit/src/lj_def.h +1 -1
  117. data/lua-hooks/ext/luajit/src/lj_dispatch.c +1 -1
  118. data/lua-hooks/ext/luajit/src/lj_dispatch.h +21 -4
  119. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +1 -1
  120. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +7 -5
  121. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +1 -1
  122. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +1 -1
  123. data/lua-hooks/ext/luajit/src/lj_err.c +69 -31
  124. data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
  125. data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
  126. data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
  127. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +10 -40
  128. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
  129. data/lua-hooks/ext/luajit/src/lj_frame.h +12 -1
  130. data/lua-hooks/ext/luajit/src/lj_func.c +1 -1
  131. data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
  132. data/lua-hooks/ext/luajit/src/lj_gc.c +2 -2
  133. data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
  134. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +1 -1
  135. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
  136. data/lua-hooks/ext/luajit/src/lj_ir.c +31 -15
  137. data/lua-hooks/ext/luajit/src/lj_ir.h +1 -1
  138. data/lua-hooks/ext/luajit/src/lj_ircall.h +29 -1
  139. data/lua-hooks/ext/luajit/src/lj_iropt.h +2 -1
  140. data/lua-hooks/ext/luajit/src/lj_jit.h +2 -1
  141. data/lua-hooks/ext/luajit/src/lj_lex.c +28 -1
  142. data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
  143. data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
  144. data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
  145. data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
  146. data/lua-hooks/ext/luajit/src/lj_mcode.c +1 -1
  147. data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
  148. data/lua-hooks/ext/luajit/src/lj_meta.c +8 -8
  149. data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
  150. data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
  151. data/lua-hooks/ext/luajit/src/lj_obj.h +1 -1
  152. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
  153. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +1 -1
  154. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
  155. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +1 -1
  156. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +1 -1
  157. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +1 -1
  158. data/lua-hooks/ext/luajit/src/lj_opt_split.c +10 -5
  159. data/lua-hooks/ext/luajit/src/lj_parse.c +1 -1
  160. data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
  161. data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
  162. data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
  163. data/lua-hooks/ext/luajit/src/lj_record.c +13 -5
  164. data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
  165. data/lua-hooks/ext/luajit/src/lj_snap.c +20 -23
  166. data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
  167. data/lua-hooks/ext/luajit/src/lj_state.c +1 -1
  168. data/lua-hooks/ext/luajit/src/lj_state.h +1 -1
  169. data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
  170. data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
  171. data/lua-hooks/ext/luajit/src/lj_strfmt.c +12 -98
  172. data/lua-hooks/ext/luajit/src/lj_strfmt.h +4 -4
  173. data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +591 -0
  174. data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
  175. data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
  176. data/lua-hooks/ext/luajit/src/lj_tab.c +1 -1
  177. data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
  178. data/lua-hooks/ext/luajit/src/lj_target.h +1 -1
  179. data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
  180. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +1 -1
  181. data/lua-hooks/ext/luajit/src/lj_target_mips.h +30 -2
  182. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
  183. data/lua-hooks/ext/luajit/src/lj_target_x86.h +1 -1
  184. data/lua-hooks/ext/luajit/src/lj_trace.c +7 -2
  185. data/lua-hooks/ext/luajit/src/lj_trace.h +1 -1
  186. data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -3
  187. data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
  188. data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
  189. data/lua-hooks/ext/luajit/src/lj_vm.h +5 -3
  190. data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
  191. data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
  192. data/lua-hooks/ext/luajit/src/lj_vmmath.c +15 -15
  193. data/lua-hooks/ext/luajit/src/ljamalg.c +2 -1
  194. data/lua-hooks/ext/luajit/src/lua.h +1 -0
  195. data/lua-hooks/ext/luajit/src/luaconf.h +2 -2
  196. data/lua-hooks/ext/luajit/src/luajit.c +1 -1
  197. data/lua-hooks/ext/luajit/src/luajit.h +4 -4
  198. data/lua-hooks/ext/luajit/src/lualib.h +1 -1
  199. data/lua-hooks/ext/luajit/src/msvcbuild.bat +1 -1
  200. data/lua-hooks/ext/luajit/src/ps4build.bat +26 -6
  201. data/lua-hooks/ext/luajit/src/vm_arm.dasc +17 -9
  202. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +1 -1
  203. data/lua-hooks/ext/luajit/src/vm_mips.dasc +1562 -656
  204. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +3 -7
  205. data/lua-hooks/ext/luajit/src/vm_x64.dasc +10 -2
  206. data/lua-hooks/ext/luajit/src/vm_x86.dasc +5 -8
  207. data/lua-hooks/ext/luautf8/module.mk +2 -0
  208. data/lua-hooks/ext/module.mk +15 -0
  209. data/lua-hooks/ext/modules.h +17 -0
  210. data/lua-hooks/ext/perf/luacpu.c +1 -1
  211. data/lua-hooks/ext/perf/lualoadavg.c +1 -1
  212. data/lua-hooks/ext/perf/luameminfo.c +1 -1
  213. data/lua-hooks/ext/perf/luaoslib.c +124 -2
  214. data/lua-hooks/ext/perf/module.mk +5 -0
  215. data/lua-hooks/ext/sha1/luasha1.c +4 -2
  216. data/lua-hooks/ext/sha1/module.mk +5 -0
  217. data/lua-hooks/ext/sha2/luasha256.c +4 -2
  218. data/lua-hooks/ext/sha2/module.mk +5 -0
  219. data/lua-hooks/ext/sysutils/lua_utils.c +56 -0
  220. data/lua-hooks/ext/sysutils/module.mk +2 -0
  221. data/lua-hooks/lib/boot.lua +2 -1
  222. data/lua-hooks/lib/hooks/module.mk +31 -0
  223. data/lua-hooks/lib/hooks/xss/module.mk +4 -0
  224. data/lua-hooks/lib/lexers/module.mk +10 -0
  225. data/lua-hooks/lib/module.mk +38 -0
  226. data/lua-hooks/lib/schema/module.mk +3 -0
  227. data/lua-hooks/options.mk +59 -0
  228. metadata +21 -2
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Fast function call recorder.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_FFRECORD_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Stack frames.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_FRAME_H
@@ -218,6 +218,7 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */
218
218
  #define CFRAME_SHIFT_MULTRES 3
219
219
  #endif
220
220
  #elif LJ_TARGET_MIPS
221
+ #if LJ_ARCH_HASFPU
221
222
  #define CFRAME_OFS_ERRF 124
222
223
  #define CFRAME_OFS_NRES 120
223
224
  #define CFRAME_OFS_PREV 116
@@ -227,6 +228,16 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */
227
228
  #define CFRAME_SIZE 112
228
229
  #define CFRAME_SHIFT_MULTRES 3
229
230
  #else
231
+ #define CFRAME_OFS_ERRF 76
232
+ #define CFRAME_OFS_NRES 72
233
+ #define CFRAME_OFS_PREV 68
234
+ #define CFRAME_OFS_L 64
235
+ #define CFRAME_OFS_PC 20
236
+ #define CFRAME_OFS_MULTRES 16
237
+ #define CFRAME_SIZE 64
238
+ #define CFRAME_SHIFT_MULTRES 3
239
+ #endif
240
+ #else
230
241
  #error "Missing CFRAME_* definitions for this architecture"
231
242
  #endif
232
243
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Function handling (prototypes, functions and upvalues).
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  **
5
5
  ** Portions taken verbatim or adapted from the Lua interpreter.
6
6
  ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Function handling (prototypes, functions and upvalues).
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_FUNC_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Garbage collector.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  **
5
5
  ** Major portions taken verbatim or adapted from the Lua interpreter.
6
6
  ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
@@ -69,7 +69,7 @@ static void gc_mark(global_State *g, GCobj *o)
69
69
  gray2black(o); /* Closed upvalues are never gray. */
70
70
  } else if (gct != ~LJ_TSTR && gct != ~LJ_TCDATA) {
71
71
  lua_assert(gct == ~LJ_TFUNC || gct == ~LJ_TTAB ||
72
- gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO);
72
+ gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO || gct == ~LJ_TTRACE);
73
73
  setgcrefr(o->gch.gclist, g->gc.gray);
74
74
  setgcref(g->gc.gray, o);
75
75
  }
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Garbage collector.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_GC_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Client for the GDB JIT API.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_gdbjit_c
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Client for the GDB JIT API.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_GDBJIT_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** SSA IR (Intermediate Representation) emitter.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_ir_c
@@ -209,24 +209,13 @@ void lj_ir_k64_freeall(jit_State *J)
209
209
  lj_mem_free(J2G(J), k, sizeof(K64Array));
210
210
  k = next;
211
211
  }
212
+ setmref(J->k64, NULL);
212
213
  }
213
214
 
214
- /* Find 64 bit constant in chained array or add it. */
215
- cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64)
215
+ /* Get new 64 bit constant slot. */
216
+ static TValue *ir_k64_add(jit_State *J, K64Array *kp, uint64_t u64)
216
217
  {
217
- K64Array *k, *kp = NULL;
218
218
  TValue *ntv;
219
- MSize idx;
220
- /* Search for the constant in the whole chain of arrays. */
221
- for (k = mref(J->k64, K64Array); k; k = mref(k->next, K64Array)) {
222
- kp = k; /* Remember previous element in list. */
223
- for (idx = 0; idx < k->numk; idx++) { /* Search one array. */
224
- TValue *tv = &k->k[idx];
225
- if (tv->u64 == u64) /* Needed for +-0/NaN/absmask. */
226
- return tv;
227
- }
228
- }
229
- /* Constant was not found, need to add it. */
230
219
  if (!(kp && kp->numk < LJ_MIN_K64SZ)) { /* Allocate a new array. */
231
220
  K64Array *kn = lj_mem_newt(J->L, sizeof(K64Array), K64Array);
232
221
  setmref(kn->next, NULL);
@@ -242,6 +231,33 @@ cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64)
242
231
  return ntv;
243
232
  }
244
233
 
234
+ /* Find 64 bit constant in chained array or add it. */
235
+ cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64)
236
+ {
237
+ K64Array *k, *kp = NULL;
238
+ MSize idx;
239
+ /* Search for the constant in the whole chain of arrays. */
240
+ for (k = mref(J->k64, K64Array); k; k = mref(k->next, K64Array)) {
241
+ kp = k; /* Remember previous element in list. */
242
+ for (idx = 0; idx < k->numk; idx++) { /* Search one array. */
243
+ TValue *tv = &k->k[idx];
244
+ if (tv->u64 == u64) /* Needed for +-0/NaN/absmask. */
245
+ return tv;
246
+ }
247
+ }
248
+ /* Otherwise add a new constant. */
249
+ return ir_k64_add(J, kp, u64);
250
+ }
251
+
252
+ TValue *lj_ir_k64_reserve(jit_State *J)
253
+ {
254
+ K64Array *k, *kp = NULL;
255
+ lj_ir_k64_find(J, 0); /* Intern dummy 0 to protect the reserved slot. */
256
+ /* Find last K64Array, if any. */
257
+ for (k = mref(J->k64, K64Array); k; k = mref(k->next, K64Array)) kp = k;
258
+ return ir_k64_add(J, kp, 0); /* Set to 0. Final value is set later. */
259
+ }
260
+
245
261
  /* Intern 64 bit constant, given by its address. */
246
262
  TRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv)
247
263
  {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** SSA IR (Intermediate Representation) format.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_IR_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** IR CALL* instruction definitions.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_IRCALL_H
@@ -78,6 +78,12 @@ typedef struct CCallInfo {
78
78
  #define IRCALLCOND_SOFTFP_FFI(x) NULL
79
79
  #endif
80
80
 
81
+ #if LJ_SOFTFP && LJ_TARGET_MIPS
82
+ #define IRCALLCOND_SOFTFP_MIPS(x) x
83
+ #else
84
+ #define IRCALLCOND_SOFTFP_MIPS(x) NULL
85
+ #endif
86
+
81
87
  #define LJ_NEED_FP64 (LJ_TARGET_ARM || LJ_TARGET_PPC || LJ_TARGET_MIPS)
82
88
 
83
89
  #if LJ_HASFFI && (LJ_SOFTFP || LJ_NEED_FP64)
@@ -189,6 +195,8 @@ typedef struct CCallInfo {
189
195
  _(SOFTFP, softfp_cmp, 4, N, NIL, 0) \
190
196
  _(SOFTFP, softfp_i2d, 1, N, NUM, 0) \
191
197
  _(SOFTFP, softfp_d2i, 2, N, INT, 0) \
198
+ _(SOFTFP_MIPS, lj_vm_sfmin, 4, N, NUM, 0) \
199
+ _(SOFTFP_MIPS, lj_vm_sfmax, 4, N, NUM, 0) \
192
200
  _(SOFTFP_FFI, softfp_ui2d, 1, N, NUM, 0) \
193
201
  _(SOFTFP_FFI, softfp_f2d, 1, N, NUM, 0) \
194
202
  _(SOFTFP_FFI, softfp_d2ui, 2, N, INT, 0) \
@@ -270,6 +278,22 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
270
278
  #define fp64_f2l __aeabi_f2lz
271
279
  #define fp64_f2ul __aeabi_f2ulz
272
280
  #endif
281
+ #elif LJ_TARGET_MIPS
282
+ #define softfp_add __adddf3
283
+ #define softfp_sub __subdf3
284
+ #define softfp_mul __muldf3
285
+ #define softfp_div __divdf3
286
+ #define softfp_cmp __ledf2
287
+ #define softfp_i2d __floatsidf
288
+ #define softfp_d2i __fixdfsi
289
+ #define softfp_ui2d __floatunsidf
290
+ #define softfp_f2d __extendsfdf2
291
+ #define softfp_d2ui __fixunsdfsi
292
+ #define softfp_d2f __truncdfsf2
293
+ #define softfp_i2f __floatsisf
294
+ #define softfp_ui2f __floatunsisf
295
+ #define softfp_f2i __fixsfsi
296
+ #define softfp_f2ui __fixunssfsi
273
297
  #else
274
298
  #error "Missing soft-float definitions for target architecture"
275
299
  #endif
@@ -290,6 +314,10 @@ extern float softfp_ui2f(uint32_t a);
290
314
  extern int32_t softfp_f2i(float a);
291
315
  extern uint32_t softfp_f2ui(float a);
292
316
  #endif
317
+ #if LJ_TARGET_MIPS
318
+ extern double lj_vm_sfmin(double a, double b);
319
+ extern double lj_vm_sfmax(double a, double b);
320
+ #endif
293
321
  #endif
294
322
 
295
323
  #if LJ_HASFFI && LJ_NEED_FP64 && !(LJ_TARGET_ARM && LJ_SOFTFP)
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Common header for IR emitter and optimizations.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_IROPT_H
@@ -40,6 +40,7 @@ static LJ_AINLINE IRRef lj_ir_nextins(jit_State *J)
40
40
  LJ_FUNC TRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k);
41
41
  LJ_FUNC void lj_ir_k64_freeall(jit_State *J);
42
42
  LJ_FUNC TRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv);
43
+ LJ_FUNC TValue *lj_ir_k64_reserve(jit_State *J);
43
44
  LJ_FUNC cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64);
44
45
  LJ_FUNC TRef lj_ir_knum_u64(jit_State *J, uint64_t u64);
45
46
  LJ_FUNC TRef lj_ir_knumint(jit_State *J, lua_Number n);
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Common definitions for the JIT compiler.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_JIT_H
@@ -381,6 +381,7 @@ typedef struct jit_State {
381
381
  GCRef *trace; /* Array of traces. */
382
382
  TraceNo freetrace; /* Start of scan for next free trace. */
383
383
  MSize sizetrace; /* Size of trace array. */
384
+ TValue *ktracep; /* Pointer to K64Array slot with GCtrace pointer. */
384
385
 
385
386
  IRRef1 chain[IR__MAX]; /* IR instruction skip-list chain anchors. */
386
387
  TRef slot[LJ_MAX_JSLOTS+LJ_STACK_EXTRA]; /* Stack slot map. */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Lexical analyzer.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  **
5
5
  ** Major portions taken verbatim or adapted from the Lua interpreter.
6
6
  ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
@@ -214,6 +214,33 @@ static void lex_string(LexState *ls, TValue *tv)
214
214
  c += 9;
215
215
  }
216
216
  break;
217
+ case 'u': /* Unicode escape '\u{XX...}'. */
218
+ if (lex_next(ls) != '{') goto err_xesc;
219
+ lex_next(ls);
220
+ c = 0;
221
+ do {
222
+ c = (c << 4) | (ls->c & 15u);
223
+ if (!lj_char_isdigit(ls->c)) {
224
+ if (!lj_char_isxdigit(ls->c)) goto err_xesc;
225
+ c += 9;
226
+ }
227
+ if (c >= 0x110000) goto err_xesc; /* Out of Unicode range. */
228
+ } while (lex_next(ls) != '}');
229
+ if (c < 0x800) {
230
+ if (c < 0x80) break;
231
+ lex_save(ls, 0xc0 | (c >> 6));
232
+ } else {
233
+ if (c >= 0x10000) {
234
+ lex_save(ls, 0xf0 | (c >> 18));
235
+ lex_save(ls, 0x80 | ((c >> 12) & 0x3f));
236
+ } else {
237
+ if (c >= 0xd800 && c < 0xe000) goto err_xesc; /* No surrogates. */
238
+ lex_save(ls, 0xe0 | (c >> 12));
239
+ }
240
+ lex_save(ls, 0x80 | ((c >> 6) & 0x3f));
241
+ }
242
+ c = 0x80 | (c & 0x3f);
243
+ break;
217
244
  case 'z': /* Skip whitespace. */
218
245
  lex_next(ls);
219
246
  while (lj_char_isspace(ls->c))
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Lexical analyzer.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_LEX_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Library function support.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_lib_c
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Library function support.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_LIB_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Load and dump code.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #include <errno.h>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Machine code management.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_mcode_c
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Machine code management.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_MCODE_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Metamethod handling.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  **
5
5
  ** Portions taken verbatim or adapted from the Lua interpreter.
6
6
  ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
@@ -278,25 +278,25 @@ TValue *lj_meta_cat(lua_State *L, TValue *top, int left)
278
278
  */
279
279
  TValue *e, *o = top;
280
280
  uint64_t tlen = tvisstr(o) ? strV(o)->len : STRFMT_MAXBUF_NUM;
281
- char *p, *buf;
281
+ SBuf *sb;
282
282
  do {
283
283
  o--; tlen += tvisstr(o) ? strV(o)->len : STRFMT_MAXBUF_NUM;
284
284
  } while (--left > 0 && (tvisstr(o-1) || tvisnumber(o-1)));
285
285
  if (tlen >= LJ_MAX_STR) lj_err_msg(L, LJ_ERR_STROV);
286
- p = buf = lj_buf_tmp(L, (MSize)tlen);
286
+ sb = lj_buf_tmp_(L);
287
+ lj_buf_more(sb, (MSize)tlen);
287
288
  for (e = top, top = o; o <= e; o++) {
288
289
  if (tvisstr(o)) {
289
290
  GCstr *s = strV(o);
290
291
  MSize len = s->len;
291
- p = lj_buf_wmem(p, strdata(s), len);
292
+ lj_buf_putmem(sb, strdata(s), len);
292
293
  } else if (tvisint(o)) {
293
- p = lj_strfmt_wint(p, intV(o));
294
+ lj_strfmt_putint(sb, intV(o));
294
295
  } else {
295
- lua_assert(tvisnum(o));
296
- p = lj_strfmt_wnum(p, o);
296
+ lj_strfmt_putfnum(sb, STRFMT_G14, numV(o));
297
297
  }
298
298
  }
299
- setstrV(L, top, lj_str_new(L, buf, (size_t)(p-buf)));
299
+ setstrV(L, top, lj_buf_str(L, sb));
300
300
  }
301
301
  } while (left >= 1);
302
302
  if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Metamethod handling.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_META_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Miscellaneous object handling.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_obj_c
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** LuaJIT VM tags, values and objects.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  **
5
5
  ** Portions taken verbatim or adapted from the Lua interpreter.
6
6
  ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_opt_dce_c