Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge LuaJIT/LuaJIT/v2.1 with v2.1-agentzh #104

Merged
merged 59 commits into from
Oct 2, 2020
Merged

Merge LuaJIT/LuaJIT/v2.1 with v2.1-agentzh #104

merged 59 commits into from
Oct 2, 2020

Conversation

siddhesh
Copy link
Collaborator

@siddhesh siddhesh commented Sep 29, 2020

This is an initial merge of the LuaJIT/LuaJIT v2.1 branch into luajit2/v2.1-agentzh. This should bring in all of the bug fixes that were made in LuaJIT/LuaJIT. Some notes on the merge:

jit.prngstate

jit.prngstate now takes (and returns) an array of 8 32-bit integers since the PRNG state has expanded in LuaJIT/LuaJIT.

Regressions

The fixes for LuaJIT/LuaJIT#603 cause a regression in stackov.lua in luajit2-test-suite because a stack overflow prints error in error handling instead of stack overflow. I haven't been able to figure out a fix (looks like a breakage in unwinding but I'm not sure), but I didn't revert the patches because the bug it fixes is worse.

String hashes

The upstream hashing scheme has been reworked to have multilevel hashes and there are now two hash functions, hash_sparse and hash_dense, the former being the function luajit2 overrode with the crc32 variant. I'll propose a solution to merge the CRC32 functions with this scheme in a separate PR; in summary the solution will be to split the crc32 implementation so that the 128-byte random hashing scheme is used to override only hash_dense and not hash_sparse so that hash_sparse has minimal slowdown.

Fixes #101

Mike Pall added 30 commits May 18, 2020 22:06
Thanks to Javier Guerra Giraldez.
It's rarely used and properly compiling it would be difficult.
10x faster on loop with t[#t+1] = x idiom. Also used by table.insert.
Up to 40% faster on hash-intensive benchmarks.
With some ideas from Sokolov Yura.
Thanks to Stefan Hett.
Reported by jnozsc.
Mike Pall and others added 23 commits August 9, 2020 18:08
Reported by Arseny Vakhrushev.
Analysis and fix contributed by Peter Cawley.
Reported by Jason Carr.
An unused guarded CONV int.num cannot be omitted in general.
This reverts commit 3ad7e2e.

This issue has already been fixed in LuaJIT/LuaJIT.
…r_fastcmp() when macro LUAJIT_USE_VALGRIND is defined."

This reverts commit 4e9ce0f.

The fuction str_fastcmp has been dropped in LuaJIT/LuaJIT.  Also
remove note about this fix from README.md.
…`__attribute((aligned(N)))` and `#pragma`."

This reverts commit 2d33927.

Reverts state back to LuaJIT/v2.1 way of parsing attributes.
… crc32 when -msse4.2 is specified."

This reverts commit 7923c63.
…the full string comparison on hash collisions. thanks Shuxin Yang for the patch."

This reverts commit 0089509.
…ed."

This partially reverts commit 6315a75
since lj_str_new no longer has the fast path.
This merge makes jit.prngstate unusable since the prng usage has
changed in LuaJIT/LuaJIT.

TODO:

- Make jit.prngstate usable with the new prng functionality
- Reinstate the string hashing optimisations
This change splits out the PRNG so that the PRNG used by the JIT
compiler can be overridden without affecting the PRNG for the
allocator.

The API is changed to reflect the wider PRNG data, which is now 256
bits.  jit.prngstate returns an array with 8 32-bit integers and
similarly, it can be overridden with an array of up to 8 32-bit
integers.

Tests and README.md have been updated to reflect this change.
@siddhesh siddhesh requested a review from agentzh September 29, 2020 10:42
@siddhesh
Copy link
Collaborator Author

FYI, the failing check is due to the fix for LuaJIT/LuaJIT#603 that I mentioned in the description.

@siddhesh
Copy link
Collaborator Author

I have created openresty/luajit2-test-suite#8 that fixes up the stackov test case to expect "error in error handling". As Mike mentioned in LuaJIT/LuaJIT#618, it is hard to avoid and hence won't be fixed. That should fix the one failing test.

@agentzh agentzh merged commit 7c03b05 into openresty:v2.1-agentzh Oct 2, 2020
@agentzh
Copy link
Member

agentzh commented Oct 2, 2020

We found serious regressions on ARMv7 after merging this PR:

#106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mike Pall fix some issues
2 participants