immunio 1.2.1 → 2.0.2

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 (291) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -5
  3. data/ext/immunio/Rakefile +14 -6
  4. data/lib/immunio/context.rb +2 -0
  5. data/lib/immunio/plugins/action_view.rb +7 -668
  6. data/lib/immunio/plugins/action_view/action_view.rb +22 -0
  7. data/lib/immunio/plugins/action_view/active_support_hash.rb +29 -0
  8. data/lib/immunio/plugins/action_view/cache_store.rb +24 -0
  9. data/lib/immunio/plugins/action_view/erubi.rb +38 -0
  10. data/lib/immunio/plugins/action_view/erubis.rb +39 -0
  11. data/lib/immunio/plugins/action_view/fragment_caching.rb +29 -0
  12. data/lib/immunio/plugins/action_view/haml.rb +46 -0
  13. data/lib/immunio/plugins/action_view/slim.rb +42 -0
  14. data/lib/immunio/plugins/action_view/template.rb +431 -0
  15. data/lib/immunio/plugins/action_view/template_rendering.rb +45 -0
  16. data/lib/immunio/plugins/http_tracker.rb +2 -0
  17. data/lib/immunio/plugins/io.rb +34 -0
  18. data/lib/immunio/version.rb +1 -1
  19. data/lua-hooks/Makefile +36 -9
  20. data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
  21. data/lua-hooks/ext/luajit/Makefile +22 -15
  22. data/lua-hooks/ext/luajit/README +2 -2
  23. data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
  24. data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
  25. data/lua-hooks/ext/luajit/doc/changes.html +69 -3
  26. data/lua-hooks/ext/luajit/doc/contact.html +10 -3
  27. data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
  28. data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
  29. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
  30. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +3 -4
  31. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
  32. data/lua-hooks/ext/luajit/doc/ext_jit.html +3 -3
  33. data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
  34. data/lua-hooks/ext/luajit/doc/extensions.html +47 -20
  35. data/lua-hooks/ext/luajit/doc/faq.html +2 -2
  36. data/lua-hooks/ext/luajit/doc/install.html +74 -45
  37. data/lua-hooks/ext/luajit/doc/luajit.html +5 -5
  38. data/lua-hooks/ext/luajit/doc/running.html +3 -3
  39. data/lua-hooks/ext/luajit/doc/status.html +13 -8
  40. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
  41. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1 -1
  42. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
  43. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1 -1
  44. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +8 -5
  45. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +66 -11
  46. data/lua-hooks/ext/luajit/dynasm/dasm_mips64.lua +12 -0
  47. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
  48. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1 -1
  49. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +1 -1
  50. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
  51. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +1 -1
  52. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +5 -1
  53. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +2 -2
  54. data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
  55. data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
  56. data/lua-hooks/ext/luajit/src/Makefile +15 -11
  57. data/lua-hooks/ext/luajit/src/Makefile.dep +16 -16
  58. data/lua-hooks/ext/luajit/src/host/buildvm.c +2 -2
  59. data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
  60. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +9 -4
  61. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +2 -2
  62. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
  63. data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +14 -3
  64. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +27 -3
  65. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
  66. data/lua-hooks/ext/luajit/src/host/genminilua.lua +6 -5
  67. data/lua-hooks/ext/luajit/src/host/minilua.c +1 -1
  68. data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
  69. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +8 -8
  70. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +2 -2
  71. data/lua-hooks/ext/luajit/src/jit/dis_arm64.lua +1216 -0
  72. data/lua-hooks/ext/luajit/src/jit/dis_arm64be.lua +12 -0
  73. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +35 -20
  74. data/lua-hooks/ext/luajit/src/jit/dis_mips64.lua +17 -0
  75. data/lua-hooks/ext/luajit/src/jit/dis_mips64el.lua +17 -0
  76. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
  77. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +2 -2
  78. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
  79. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +7 -4
  80. data/lua-hooks/ext/luajit/src/jit/dump.lua +17 -12
  81. data/lua-hooks/ext/luajit/src/jit/p.lua +3 -2
  82. data/lua-hooks/ext/luajit/src/jit/v.lua +2 -2
  83. data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
  84. data/lua-hooks/ext/luajit/src/lauxlib.h +14 -20
  85. data/lua-hooks/ext/luajit/src/lib_aux.c +38 -27
  86. data/lua-hooks/ext/luajit/src/lib_base.c +12 -5
  87. data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
  88. data/lua-hooks/ext/luajit/src/lib_debug.c +5 -5
  89. data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -2
  90. data/lua-hooks/ext/luajit/src/lib_init.c +16 -16
  91. data/lua-hooks/ext/luajit/src/lib_io.c +6 -7
  92. data/lua-hooks/ext/luajit/src/lib_jit.c +14 -4
  93. data/lua-hooks/ext/luajit/src/lib_math.c +1 -5
  94. data/lua-hooks/ext/luajit/src/lib_os.c +1 -1
  95. data/lua-hooks/ext/luajit/src/lib_package.c +14 -23
  96. data/lua-hooks/ext/luajit/src/lib_string.c +1 -5
  97. data/lua-hooks/ext/luajit/src/lib_table.c +21 -1
  98. data/lua-hooks/ext/luajit/src/lj.supp +3 -3
  99. data/lua-hooks/ext/luajit/src/lj_alloc.c +174 -83
  100. data/lua-hooks/ext/luajit/src/lj_api.c +97 -18
  101. data/lua-hooks/ext/luajit/src/lj_arch.h +54 -22
  102. data/lua-hooks/ext/luajit/src/lj_asm.c +172 -53
  103. data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
  104. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +19 -16
  105. data/lua-hooks/ext/luajit/src/lj_asm_arm64.h +2022 -0
  106. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +564 -158
  107. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +19 -18
  108. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +578 -92
  109. data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
  110. data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
  111. data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
  112. data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
  113. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
  114. data/lua-hooks/ext/luajit/src/lj_buf.c +1 -1
  115. data/lua-hooks/ext/luajit/src/lj_buf.h +1 -1
  116. data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
  117. data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
  118. data/lua-hooks/ext/luajit/src/lj_ccall.c +172 -7
  119. data/lua-hooks/ext/luajit/src/lj_ccall.h +21 -5
  120. data/lua-hooks/ext/luajit/src/lj_ccallback.c +71 -17
  121. data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
  122. data/lua-hooks/ext/luajit/src/lj_cconv.c +4 -2
  123. data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
  124. data/lua-hooks/ext/luajit/src/lj_cdata.c +7 -5
  125. data/lua-hooks/ext/luajit/src/lj_cdata.h +1 -1
  126. data/lua-hooks/ext/luajit/src/lj_clib.c +5 -5
  127. data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
  128. data/lua-hooks/ext/luajit/src/lj_cparse.c +11 -6
  129. data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
  130. data/lua-hooks/ext/luajit/src/lj_crecord.c +70 -14
  131. data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
  132. data/lua-hooks/ext/luajit/src/lj_ctype.c +1 -1
  133. data/lua-hooks/ext/luajit/src/lj_ctype.h +8 -8
  134. data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
  135. data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
  136. data/lua-hooks/ext/luajit/src/lj_def.h +6 -9
  137. data/lua-hooks/ext/luajit/src/lj_dispatch.c +3 -3
  138. data/lua-hooks/ext/luajit/src/lj_dispatch.h +2 -1
  139. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +5 -4
  140. data/lua-hooks/ext/luajit/src/lj_emit_arm64.h +419 -0
  141. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +100 -20
  142. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +4 -4
  143. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +116 -25
  144. data/lua-hooks/ext/luajit/src/lj_err.c +34 -13
  145. data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
  146. data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
  147. data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
  148. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +58 -49
  149. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
  150. data/lua-hooks/ext/luajit/src/lj_frame.h +33 -6
  151. data/lua-hooks/ext/luajit/src/lj_func.c +4 -2
  152. data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
  153. data/lua-hooks/ext/luajit/src/lj_gc.c +16 -7
  154. data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
  155. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +31 -1
  156. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
  157. data/lua-hooks/ext/luajit/src/lj_ir.c +69 -96
  158. data/lua-hooks/ext/luajit/src/lj_ir.h +29 -18
  159. data/lua-hooks/ext/luajit/src/lj_ircall.h +24 -30
  160. data/lua-hooks/ext/luajit/src/lj_iropt.h +9 -9
  161. data/lua-hooks/ext/luajit/src/lj_jit.h +67 -9
  162. data/lua-hooks/ext/luajit/src/lj_lex.c +1 -1
  163. data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
  164. data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
  165. data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
  166. data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
  167. data/lua-hooks/ext/luajit/src/lj_mcode.c +11 -10
  168. data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
  169. data/lua-hooks/ext/luajit/src/lj_meta.c +1 -1
  170. data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
  171. data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
  172. data/lua-hooks/ext/luajit/src/lj_obj.h +7 -3
  173. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
  174. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +84 -17
  175. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
  176. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +3 -3
  177. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +24 -22
  178. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +11 -6
  179. data/lua-hooks/ext/luajit/src/lj_opt_split.c +11 -2
  180. data/lua-hooks/ext/luajit/src/lj_parse.c +9 -7
  181. data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
  182. data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
  183. data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
  184. data/lua-hooks/ext/luajit/src/lj_record.c +201 -117
  185. data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
  186. data/lua-hooks/ext/luajit/src/lj_snap.c +72 -26
  187. data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
  188. data/lua-hooks/ext/luajit/src/lj_state.c +6 -6
  189. data/lua-hooks/ext/luajit/src/lj_state.h +2 -2
  190. data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
  191. data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
  192. data/lua-hooks/ext/luajit/src/lj_strfmt.c +7 -3
  193. data/lua-hooks/ext/luajit/src/lj_strfmt.h +1 -1
  194. data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +4 -3
  195. data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
  196. data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
  197. data/lua-hooks/ext/luajit/src/lj_tab.c +1 -2
  198. data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
  199. data/lua-hooks/ext/luajit/src/lj_target.h +3 -3
  200. data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
  201. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +239 -7
  202. data/lua-hooks/ext/luajit/src/lj_target_mips.h +111 -22
  203. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
  204. data/lua-hooks/ext/luajit/src/lj_target_x86.h +21 -4
  205. data/lua-hooks/ext/luajit/src/lj_trace.c +63 -18
  206. data/lua-hooks/ext/luajit/src/lj_trace.h +2 -1
  207. data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -1
  208. data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
  209. data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
  210. data/lua-hooks/ext/luajit/src/lj_vm.h +5 -1
  211. data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
  212. data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
  213. data/lua-hooks/ext/luajit/src/lj_vmmath.c +1 -1
  214. data/lua-hooks/ext/luajit/src/ljamalg.c +1 -1
  215. data/lua-hooks/ext/luajit/src/lua.h +9 -1
  216. data/lua-hooks/ext/luajit/src/luaconf.h +3 -7
  217. data/lua-hooks/ext/luajit/src/luajit.c +69 -54
  218. data/lua-hooks/ext/luajit/src/luajit.h +4 -4
  219. data/lua-hooks/ext/luajit/src/lualib.h +1 -1
  220. data/lua-hooks/ext/luajit/src/msvcbuild.bat +12 -4
  221. data/lua-hooks/ext/luajit/src/vm_arm.dasc +1 -1
  222. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +255 -32
  223. data/lua-hooks/ext/luajit/src/vm_mips.dasc +26 -23
  224. data/lua-hooks/ext/luajit/src/vm_mips64.dasc +5062 -0
  225. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +1 -1
  226. data/lua-hooks/ext/luajit/src/vm_x64.dasc +24 -25
  227. data/lua-hooks/ext/luajit/src/vm_x86.dasc +77 -4
  228. data/lua-hooks/libluahooks.darwin.a +0 -0
  229. data/lua-hooks/libluahooks.linux.a +0 -0
  230. data/lua-hooks/options.mk +1 -1
  231. metadata +37 -77
  232. data/lua-hooks/ext/all.c +0 -69
  233. data/lua-hooks/ext/libinjection/COPYING +0 -37
  234. data/lua-hooks/ext/libinjection/libinjection.h +0 -65
  235. data/lua-hooks/ext/libinjection/libinjection_html5.c +0 -847
  236. data/lua-hooks/ext/libinjection/libinjection_html5.h +0 -54
  237. data/lua-hooks/ext/libinjection/libinjection_sqli.c +0 -2301
  238. data/lua-hooks/ext/libinjection/libinjection_sqli.h +0 -295
  239. data/lua-hooks/ext/libinjection/libinjection_sqli_data.h +0 -9349
  240. data/lua-hooks/ext/libinjection/libinjection_xss.c +0 -531
  241. data/lua-hooks/ext/libinjection/libinjection_xss.h +0 -21
  242. data/lua-hooks/ext/libinjection/lualib.c +0 -145
  243. data/lua-hooks/ext/libinjection/module.mk +0 -5
  244. data/lua-hooks/ext/lpeg/HISTORY +0 -96
  245. data/lua-hooks/ext/lpeg/lpcap.c +0 -537
  246. data/lua-hooks/ext/lpeg/lpcap.h +0 -56
  247. data/lua-hooks/ext/lpeg/lpcode.c +0 -1014
  248. data/lua-hooks/ext/lpeg/lpcode.h +0 -40
  249. data/lua-hooks/ext/lpeg/lpeg-128.gif +0 -0
  250. data/lua-hooks/ext/lpeg/lpeg.html +0 -1445
  251. data/lua-hooks/ext/lpeg/lpprint.c +0 -244
  252. data/lua-hooks/ext/lpeg/lpprint.h +0 -36
  253. data/lua-hooks/ext/lpeg/lptree.c +0 -1303
  254. data/lua-hooks/ext/lpeg/lptree.h +0 -82
  255. data/lua-hooks/ext/lpeg/lptypes.h +0 -149
  256. data/lua-hooks/ext/lpeg/lpvm.c +0 -364
  257. data/lua-hooks/ext/lpeg/lpvm.h +0 -58
  258. data/lua-hooks/ext/lpeg/makefile +0 -55
  259. data/lua-hooks/ext/lpeg/module.mk +0 -6
  260. data/lua-hooks/ext/lpeg/re.html +0 -498
  261. data/lua-hooks/ext/lua-cmsgpack/.gitignore +0 -13
  262. data/lua-hooks/ext/lua-cmsgpack/CMakeLists.txt +0 -45
  263. data/lua-hooks/ext/lua-cmsgpack/README.md +0 -115
  264. data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +0 -970
  265. data/lua-hooks/ext/lua-cmsgpack/module.mk +0 -2
  266. data/lua-hooks/ext/lua-cmsgpack/test.lua +0 -570
  267. data/lua-hooks/ext/lua-snapshot/LICENSE +0 -7
  268. data/lua-hooks/ext/lua-snapshot/Makefile +0 -12
  269. data/lua-hooks/ext/lua-snapshot/README.md +0 -18
  270. data/lua-hooks/ext/lua-snapshot/dump.lua +0 -15
  271. data/lua-hooks/ext/lua-snapshot/module.mk +0 -2
  272. data/lua-hooks/ext/lua-snapshot/snapshot.c +0 -462
  273. data/lua-hooks/ext/luautf8/README.md +0 -152
  274. data/lua-hooks/ext/luautf8/lutf8lib.c +0 -1274
  275. data/lua-hooks/ext/luautf8/module.mk +0 -2
  276. data/lua-hooks/ext/luautf8/unidata.h +0 -3064
  277. data/lua-hooks/ext/module.mk +0 -15
  278. data/lua-hooks/ext/modules.h +0 -17
  279. data/lua-hooks/ext/perf/luacpu.c +0 -114
  280. data/lua-hooks/ext/perf/lualoadavg.c +0 -40
  281. data/lua-hooks/ext/perf/luameminfo.c +0 -38
  282. data/lua-hooks/ext/perf/luaoslib.c +0 -203
  283. data/lua-hooks/ext/perf/module.mk +0 -5
  284. data/lua-hooks/ext/sha1/luasha1.c +0 -74
  285. data/lua-hooks/ext/sha1/module.mk +0 -5
  286. data/lua-hooks/ext/sha1/sha1.c +0 -145
  287. data/lua-hooks/ext/sha2/luasha256.c +0 -77
  288. data/lua-hooks/ext/sha2/module.mk +0 -5
  289. data/lua-hooks/ext/sha2/sha256.c +0 -196
  290. data/lua-hooks/ext/sysutils/lua_utils.c +0 -56
  291. data/lua-hooks/ext/sysutils/module.mk +0 -2
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Trace recorder (bytecode -> SSA IR).
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_RECORD_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Snapshot handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_snap_c
@@ -68,10 +68,22 @@ static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots)
68
68
  for (s = 0; s < nslots; s++) {
69
69
  TRef tr = J->slot[s];
70
70
  IRRef ref = tref_ref(tr);
71
+ #if LJ_FR2
72
+ if (s == 1) { /* Ignore slot 1 in LJ_FR2 mode, except if tailcalled. */
73
+ if ((tr & TREF_FRAME))
74
+ map[n++] = SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL);
75
+ continue;
76
+ }
77
+ if ((tr & (TREF_FRAME | TREF_CONT)) && !ref) {
78
+ cTValue *base = J->L->base - J->baseslot;
79
+ tr = J->slot[s] = (tr & 0xff0000) | lj_ir_k64(J, IR_KNUM, base[s].u64);
80
+ ref = tref_ref(tr);
81
+ }
82
+ #endif
71
83
  if (ref) {
72
84
  SnapEntry sn = SNAP_TR(s, tr);
73
85
  IRIns *ir = &J->cur.ir[ref];
74
- if (!(sn & (SNAP_CONT|SNAP_FRAME)) &&
86
+ if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) &&
75
87
  ir->o == IR_SLOAD && ir->op1 == s && ref > retf) {
76
88
  /* No need to snapshot unmodified non-inherited slots. */
77
89
  if (!(ir->op2 & IRSLOAD_INHERIT))
@@ -90,34 +102,51 @@ static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots)
90
102
  }
91
103
 
92
104
  /* Add frame links at the end of the snapshot. */
93
- static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
105
+ static MSize snapshot_framelinks(jit_State *J, SnapEntry *map, uint8_t *topslot)
94
106
  {
95
107
  cTValue *frame = J->L->base - 1;
96
- cTValue *lim = J->L->base - J->baseslot;
108
+ cTValue *lim = J->L->base - J->baseslot + LJ_FR2;
97
109
  GCfunc *fn = frame_func(frame);
98
110
  cTValue *ftop = isluafunc(fn) ? (frame+funcproto(fn)->framesize) : J->L->top;
111
+ #if LJ_FR2
112
+ uint64_t pcbase = (u64ptr(J->pc) << 8) | (J->baseslot - 2);
113
+ lua_assert(2 <= J->baseslot && J->baseslot <= 257);
114
+ memcpy(map, &pcbase, sizeof(uint64_t));
115
+ #else
99
116
  MSize f = 0;
100
- lua_assert(!LJ_FR2); /* TODO_FR2: store 64 bit PCs. */
101
117
  map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */
118
+ #endif
102
119
  while (frame > lim) { /* Backwards traversal of all frames above base. */
103
120
  if (frame_islua(frame)) {
121
+ #if !LJ_FR2
104
122
  map[f++] = SNAP_MKPC(frame_pc(frame));
123
+ #endif
105
124
  frame = frame_prevl(frame);
106
125
  } else if (frame_iscont(frame)) {
126
+ #if !LJ_FR2
107
127
  map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
108
128
  map[f++] = SNAP_MKPC(frame_contpc(frame));
129
+ #endif
109
130
  frame = frame_prevd(frame);
110
131
  } else {
111
132
  lua_assert(!frame_isc(frame));
133
+ #if !LJ_FR2
112
134
  map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
135
+ #endif
113
136
  frame = frame_prevd(frame);
114
137
  continue;
115
138
  }
116
139
  if (frame + funcproto(frame_func(frame))->framesize > ftop)
117
140
  ftop = frame + funcproto(frame_func(frame))->framesize;
118
141
  }
142
+ *topslot = (uint8_t)(ftop - lim);
143
+ #if LJ_FR2
144
+ lua_assert(sizeof(SnapEntry) * 2 == sizeof(uint64_t));
145
+ return 2;
146
+ #else
119
147
  lua_assert(f == (MSize)(1 + J->framedepth));
120
- return (BCReg)(ftop - lim);
148
+ return f;
149
+ #endif
121
150
  }
122
151
 
123
152
  /* Take a snapshot of the current stack. */
@@ -127,16 +156,16 @@ static void snapshot_stack(jit_State *J, SnapShot *snap, MSize nsnapmap)
127
156
  MSize nent;
128
157
  SnapEntry *p;
129
158
  /* Conservative estimate. */
130
- lj_snap_grow_map(J, nsnapmap + nslots + (MSize)J->framedepth+1);
159
+ lj_snap_grow_map(J, nsnapmap + nslots + (MSize)(LJ_FR2?2:J->framedepth+1));
131
160
  p = &J->cur.snapmap[nsnapmap];
132
161
  nent = snapshot_slots(J, p, nslots);
133
- snap->topslot = (uint8_t)snapshot_framelinks(J, p + nent);
162
+ snap->nent = (uint8_t)nent;
163
+ nent += snapshot_framelinks(J, p + nent, &snap->topslot);
134
164
  snap->mapofs = (uint16_t)nsnapmap;
135
165
  snap->ref = (IRRef1)J->cur.nins;
136
- snap->nent = (uint8_t)nent;
137
166
  snap->nslots = (uint8_t)nslots;
138
167
  snap->count = 0;
139
- J->cur.nsnapmap = (uint16_t)(nsnapmap + nent + 1 + J->framedepth);
168
+ J->cur.nsnapmap = (uint16_t)(nsnapmap + nent);
140
169
  }
141
170
 
142
171
  /* Add or merge a snapshot. */
@@ -284,8 +313,8 @@ void lj_snap_shrink(jit_State *J)
284
313
  MSize n, m, nlim, nent = snap->nent;
285
314
  uint8_t udf[SNAP_USEDEF_SLOTS];
286
315
  BCReg maxslot = J->maxslot;
287
- BCReg minslot = snap_usedef(J, udf, snap_pc(map[nent]), maxslot);
288
316
  BCReg baseslot = J->baseslot;
317
+ BCReg minslot = snap_usedef(J, udf, snap_pc(&map[nent]), maxslot);
289
318
  maxslot += baseslot;
290
319
  minslot += baseslot;
291
320
  snap->nslots = (uint8_t)maxslot;
@@ -371,8 +400,8 @@ static TRef snap_replay_const(jit_State *J, IRIns *ir)
371
400
  case IR_KPRI: return TREF_PRI(irt_type(ir->t));
372
401
  case IR_KINT: return lj_ir_kint(J, ir->i);
373
402
  case IR_KGC: return lj_ir_kgc(J, ir_kgc(ir), irt_t(ir->t));
374
- case IR_KNUM: return lj_ir_k64(J, IR_KNUM, ir_knum(ir));
375
- case IR_KINT64: return lj_ir_k64(J, IR_KINT64, ir_kint64(ir));
403
+ case IR_KNUM: case IR_KINT64:
404
+ return lj_ir_k64(J, (IROp)ir->o, ir_k64(ir)->u64);
376
405
  case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir)); /* Continuation. */
377
406
  default: lua_assert(0); return TREF_NIL; break;
378
407
  }
@@ -445,7 +474,11 @@ void lj_snap_replay(jit_State *J, GCtrace *T)
445
474
  goto setslot;
446
475
  bloomset(seen, ref);
447
476
  if (irref_isk(ref)) {
448
- tr = snap_replay_const(J, ir);
477
+ /* See special treatment of LJ_FR2 slot 1 in snapshot_slots() above. */
478
+ if (LJ_FR2 && (sn == SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL)))
479
+ tr = 0;
480
+ else
481
+ tr = snap_replay_const(J, ir);
449
482
  } else if (!regsp_used(ir->prev)) {
450
483
  pass23 = 1;
451
484
  lua_assert(s != 0);
@@ -459,7 +492,7 @@ void lj_snap_replay(jit_State *J, GCtrace *T)
459
492
  }
460
493
  setslot:
461
494
  J->slot[s] = tr | (sn&(SNAP_CONT|SNAP_FRAME)); /* Same as TREF_* flags. */
462
- J->framedepth += ((sn & (SNAP_CONT|SNAP_FRAME)) && s);
495
+ J->framedepth += ((sn & (SNAP_CONT|SNAP_FRAME)) && (s != LJ_FR2));
463
496
  if ((sn & SNAP_FRAME))
464
497
  J->baseslot = s+1;
465
498
  }
@@ -555,8 +588,7 @@ void lj_snap_replay(jit_State *J, GCtrace *T)
555
588
  if (irref_isk(irs->op2) && irref_isk((irs+1)->op2)) {
556
589
  uint64_t k = (uint32_t)T->ir[irs->op2].i +
557
590
  ((uint64_t)T->ir[(irs+1)->op2].i << 32);
558
- val = lj_ir_k64(J, t == IRT_I64 ? IR_KINT64 : IR_KNUM,
559
- lj_ir_k64_find(J, k));
591
+ val = lj_ir_k64(J, t == IRT_I64 ? IR_KINT64 : IR_KNUM, k);
560
592
  } else {
561
593
  val = emitir_raw(IRT(IR_HIOP, t), val,
562
594
  snap_pref(J, T, map, nent, seen, (irs+1)->op2));
@@ -599,7 +631,6 @@ static void snap_restoreval(jit_State *J, GCtrace *T, ExitState *ex,
599
631
  }
600
632
  if (LJ_UNLIKELY(bloomtest(rfilt, ref)))
601
633
  rs = snap_renameref(T, snapno, ref, rs);
602
- lua_assert(!LJ_GC64); /* TODO_GC64: handle 64 bit references. */
603
634
  if (ra_hasspill(regsp_spill(rs))) { /* Restore from spill slot. */
604
635
  int32_t *sps = &ex->spill[regsp_spill(rs)];
605
636
  if (irt_isinteger(t)) {
@@ -608,9 +639,11 @@ static void snap_restoreval(jit_State *J, GCtrace *T, ExitState *ex,
608
639
  } else if (irt_isnum(t)) {
609
640
  o->u64 = *(uint64_t *)sps;
610
641
  #endif
611
- } else if (LJ_64 && irt_islightud(t)) {
642
+ #if LJ_64 && !LJ_GC64
643
+ } else if (irt_islightud(t)) {
612
644
  /* 64 bit lightuserdata which may escape already has the tag bits. */
613
645
  o->u64 = *(uint64_t *)sps;
646
+ #endif
614
647
  } else {
615
648
  lua_assert(!irt_ispri(t)); /* PRI refs never have a spill slot. */
616
649
  setgcV(J->L, o, (GCobj *)(uintptr_t)*(GCSize *)sps, irt_toitype(t));
@@ -628,9 +661,11 @@ static void snap_restoreval(jit_State *J, GCtrace *T, ExitState *ex,
628
661
  } else if (irt_isnum(t)) {
629
662
  setnumV(o, ex->fpr[r-RID_MIN_FPR]);
630
663
  #endif
631
- } else if (LJ_64 && irt_is64(t)) {
664
+ #if LJ_64 && !LJ_GC64
665
+ } else if (irt_is64(t)) {
632
666
  /* 64 bit values that already have the tag bits. */
633
667
  o->u64 = ex->gpr[r-RID_MIN_GPR];
668
+ #endif
634
669
  } else if (irt_ispri(t)) {
635
670
  setpriV(o, irt_toitype(t));
636
671
  } else {
@@ -651,7 +686,7 @@ static void snap_restoredata(GCtrace *T, ExitState *ex,
651
686
  uint64_t tmp;
652
687
  if (irref_isk(ref)) {
653
688
  if (ir->o == IR_KNUM || ir->o == IR_KINT64) {
654
- src = mref(ir->ptr, int32_t);
689
+ src = (int32_t *)&ir[1];
655
690
  } else if (sz == 8) {
656
691
  tmp = (uint64_t)(uint32_t)ir->i;
657
692
  src = (int32_t *)&tmp;
@@ -688,8 +723,9 @@ static void snap_restoredata(GCtrace *T, ExitState *ex,
688
723
  #else
689
724
  if (LJ_BE && sz == 4) src++;
690
725
  #endif
691
- }
726
+ } else
692
727
  #endif
728
+ if (LJ_64 && LJ_BE && sz == 4) src++;
693
729
  }
694
730
  }
695
731
  lua_assert(sz == 1 || sz == 2 || sz == 4 || sz == 8);
@@ -795,11 +831,15 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
795
831
  SnapShot *snap = &T->snap[snapno];
796
832
  MSize n, nent = snap->nent;
797
833
  SnapEntry *map = &T->snapmap[snap->mapofs];
798
- SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1];
834
+ #if !LJ_FR2 || defined(LUA_USE_ASSERT)
835
+ SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1-LJ_FR2];
836
+ #endif
837
+ #if !LJ_FR2
799
838
  ptrdiff_t ftsz0;
839
+ #endif
800
840
  TValue *frame;
801
841
  BloomFilter rfilt = snap_renamefilter(T, snapno);
802
- const BCIns *pc = snap_pc(map[nent]);
842
+ const BCIns *pc = snap_pc(&map[nent]);
803
843
  lua_State *L = J->L;
804
844
 
805
845
  /* Set interpreter PC to the next PC to get correct error messages. */
@@ -812,8 +852,10 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
812
852
  }
813
853
 
814
854
  /* Fill stack slots with data from the registers and spill slots. */
815
- frame = L->base-1;
855
+ frame = L->base-1-LJ_FR2;
856
+ #if !LJ_FR2
816
857
  ftsz0 = frame_ftsz(frame); /* Preserve link to previous frame in slot #0. */
858
+ #endif
817
859
  for (n = 0; n < nent; n++) {
818
860
  SnapEntry sn = map[n];
819
861
  if (!(sn & SNAP_NORESTORE)) {
@@ -836,14 +878,18 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
836
878
  TValue tmp;
837
879
  snap_restoreval(J, T, ex, snapno, rfilt, ref+1, &tmp);
838
880
  o->u32.hi = tmp.u32.lo;
881
+ #if !LJ_FR2
839
882
  } else if ((sn & (SNAP_CONT|SNAP_FRAME))) {
840
- lua_assert(!LJ_FR2); /* TODO_FR2: store 64 bit PCs. */
841
883
  /* Overwrite tag with frame link. */
842
884
  setframe_ftsz(o, snap_slot(sn) != 0 ? (int32_t)*flinks-- : ftsz0);
843
885
  L->base = o+1;
886
+ #endif
844
887
  }
845
888
  }
846
889
  }
890
+ #if LJ_FR2
891
+ L->base += (map[nent+LJ_BE] & 0xff);
892
+ #endif
847
893
  lua_assert(map + nent == flinks);
848
894
 
849
895
  /* Compute current stack top. */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Snapshot handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_SNAP_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** State and stack handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 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
@@ -180,7 +180,7 @@ static void close_state(lua_State *L)
180
180
  g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0);
181
181
  }
182
182
 
183
- #if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC))
183
+ #if LJ_64 && !LJ_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC))
184
184
  lua_State *lj_state_newstate(lua_Alloc f, void *ud)
185
185
  #else
186
186
  LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
@@ -224,7 +224,7 @@ LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
224
224
  close_state(L);
225
225
  return NULL;
226
226
  }
227
- L->status = 0;
227
+ L->status = LUA_OK;
228
228
  return L;
229
229
  }
230
230
 
@@ -256,10 +256,10 @@ LUA_API void lua_close(lua_State *L)
256
256
  #endif
257
257
  for (i = 0;;) {
258
258
  hook_enter(g);
259
- L->status = 0;
259
+ L->status = LUA_OK;
260
260
  L->base = L->top = tvref(L->stack) + 1 + LJ_FR2;
261
261
  L->cframe = NULL;
262
- if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == 0) {
262
+ if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == LUA_OK) {
263
263
  if (++i >= 10) break;
264
264
  lj_gc_separateudata(g, 1); /* Separate udata again. */
265
265
  if (gcref(g->gc.mmudata) == NULL) /* Until nothing is left to do. */
@@ -274,7 +274,7 @@ lua_State *lj_state_new(lua_State *L)
274
274
  lua_State *L1 = lj_mem_newobj(L, lua_State);
275
275
  L1->gct = ~LJ_TTHREAD;
276
276
  L1->dummy_ffid = FF_C;
277
- L1->status = 0;
277
+ L1->status = LUA_OK;
278
278
  L1->stacksize = 0;
279
279
  setmref(L1->stack, NULL);
280
280
  L1->cframe = NULL;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** State and stack handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_STATE_H
@@ -28,7 +28,7 @@ static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need)
28
28
 
29
29
  LJ_FUNC lua_State *lj_state_new(lua_State *L);
30
30
  LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L);
31
- #if LJ_64
31
+ #if LJ_64 && !LJ_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC))
32
32
  LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud);
33
33
  #endif
34
34
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #define lj_str_c
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_STR_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String formatting.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #include <stdio.h>
@@ -98,11 +98,15 @@ char * LJ_FASTCALL lj_strfmt_wint(char *p, int32_t k)
98
98
  uint32_t u = (uint32_t)k;
99
99
  if (k < 0) { u = (uint32_t)-k; *p++ = '-'; }
100
100
  if (u < 10000) {
101
- if (u < 10) goto dig1; if (u < 100) goto dig2; if (u < 1000) goto dig3;
101
+ if (u < 10) goto dig1;
102
+ if (u < 100) goto dig2;
103
+ if (u < 1000) goto dig3;
102
104
  } else {
103
105
  uint32_t v = u / 10000; u -= v * 10000;
104
106
  if (v < 10000) {
105
- if (v < 10) goto dig5; if (v < 100) goto dig6; if (v < 1000) goto dig7;
107
+ if (v < 10) goto dig5;
108
+ if (v < 100) goto dig6;
109
+ if (v < 1000) goto dig7;
106
110
  } else {
107
111
  uint32_t w = v / 10000; v -= w * 10000;
108
112
  if (w >= 10) WINT_R(w, 10, 10)
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String formatting.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_STRFMT_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String formatting for floating-point numbers.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  ** Contributed by Peter Cawley.
5
5
  */
6
6
 
@@ -138,7 +138,7 @@ static uint32_t nd_mul2k(uint32_t* nd, uint32_t ndhi, uint32_t k,
138
138
  }
139
139
  if (carry_in) {
140
140
  nd[++ndhi] = carry_in; carry_in = 0;
141
- if(start++ == ndlo) ++ndlo;
141
+ if (start++ == ndlo) ++ndlo;
142
142
  }
143
143
  k -= ND_MUL2K_MAX_SHIFT;
144
144
  }
@@ -364,6 +364,7 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p)
364
364
  /* Precision is sufficiently low that rescaling will probably work. */
365
365
  if ((ndebias = rescale_e[e >> 6])) {
366
366
  t.n = n * rescale_n[e >> 6];
367
+ if (LJ_UNLIKELY(!e)) t.n *= 1e10, ndebias -= 10;
367
368
  t.u64 -= 2; /* Convert 2ulp below (later we convert 2ulp above). */
368
369
  nd[0] = 0x100000 | (t.u32.hi & 0xfffff);
369
370
  e = ((t.u32.hi >> 20) & 0x7ff) - 1075 - (ND_MUL2K_MAX_SHIFT < 29);
@@ -479,7 +480,7 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p)
479
480
  if ((prec | (sf & STRFMT_F_ALT))) {
480
481
  /* Emit fractional part. */
481
482
  p[1] = '.'; p += 2;
482
- prec -= (q - p); p = q; /* Account for the digits already emitted. */
483
+ prec -= (MSize)(q - p); p = q; /* Account for digits already emitted. */
483
484
  /* Then emit chunks of 9 digits (this may emit 8 digits too many). */
484
485
  for (i = ndhi; (int32_t)prec > 0 && i != ndlo; prec -= 9) {
485
486
  i = (i - 1) & 0x3f;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String scanning.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #include <math.h>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** String scanning.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_STRSCAN_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Table handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 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
@@ -28,7 +28,6 @@ static LJ_AINLINE Node *hashmask(const GCtab *t, uint32_t hash)
28
28
 
29
29
  #define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi)))
30
30
  #define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1))
31
- #define hashptr(t, p) hashlohi((t), u32ptr(p), u32ptr(p) + HASH_BIAS)
32
31
  #if LJ_GC64
33
32
  #define hashgcref(t, r) \
34
33
  hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32))