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

Add MVMROOT around more reentrantmutex acquires #741

Closed
wants to merge 21 commits into from

Conversation

ugexe
Copy link
Contributor

@ugexe ugexe commented Oct 28, 2017

See: 9ad1f5f

ugexe and others added 21 commits October 28, 2017 01:03
Fixes "Unknown lexical type encountered while building context iterator"
error when MVM_iter() tries to handle unsigned integers.
The mutex acquire may GC block and thus trigger GC, moving objects.
The mutex acquire may GC block and thus trigger GC, moving objects.
Strings are unboxed and the resulting pointers stored in the scratch space
on the stack so both the actual C call and the MVM_free call afterwards can
access them. The scratch space is 0x40=64 bytes large and we already need
8 bytes for the native function's return value, leaving us with space for
7 string pointers.
Passing a pointer to an integer instead of the integer itself to the native
function is easy. Getting the changed value back to the HLL code is the hard
part. Since the native function writes to the register that's passed in the
args buffer, the HLL code needs to read the value back from the args buffer.
That's what the new getarg_* ops are for.
Spesh currently does not retain all facts when inlining calls. This then
blocks JIT compilation of native sub bodies. Benchmarks show that JIT
compilation is more important for performance than inlining of native
subs, so mark the nativeinvoke* ops :noinline until spesh's restriction
is lifted.
@ugexe
Copy link
Contributor Author

ugexe commented Oct 28, 2017

Will reopen in new PR

@ugexe ugexe closed this Oct 28, 2017
@ugexe ugexe mentioned this pull request Oct 28, 2017
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.

None yet

7 participants