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

Unity master sync il2cpp #1115

Merged
merged 23 commits into from
Jan 4, 2019
Merged

Unity master sync il2cpp #1115

merged 23 commits into from
Jan 4, 2019

Conversation

joncham
Copy link
Member

@joncham joncham commented Jan 2, 2019

Merge IL2CPP changes up through commit aebcd0f844270d5f407ec3d22f20a066d7028d36

@joncham joncham requested a review from joshpeterson January 2, 2019 18:52
@joncham joncham force-pushed the unity-master-sync-il2cpp branch from eb6f95e to 53db8e7 Compare January 2, 2019 19:29
juj and others added 23 commits January 3, 2019 08:36
…d, so we can use barriers on both mono and il2cpp
…g sequence point until actually needed.

Brings use from ~20x slower to ~5x slower when debugger codegen is enabled vs no debugger codegen.
… per assembly table rather than in metadata binary file.

This is step towards per assembly conversion.
The Suspend debugger test was hanging intermittently on most platforms.
These seemed to occur because the codegen checks for
`g_Il2CppDebuggerCheckPointEnabled` were not getting the proper value,
and assuming the check point was not set, so the VM would not suspend.

This meant that the main thread could not be suspended when the debugger
was trying to exit, so the main thread kept looping forever, with out
allowing the debugger to exit it.
The Mono implementation of mono_runtime_try_shutdown does not actually
shut down the VM. Instead, it sets the flags to indicate the VM is
shutting down. The VM should actually shutdown in mono_runtime_quit.

In some cases, we see this code path taken when processing the
CMD_VM_EXIT command. This seems unlikely, but can happen when the code
above cannot find a suspended managed thread. If
mono_runtime_try_shutdown actually waits for managed threads to
complete, it will hang, as the main thread won't be suspended because
resume_vm is called just above mono_runtime_try_shutdown.

So for IL2CPP mono_runtime_try_shutdown doesn't do anything, but
mono_runtime_quit will actually shutdown the VM.
Since we run the Tiny profile on the libil2cpp backend, we don't need
any differences in this file.
* Ignoring the EventSets test because it tests exceptions.
* Fixing the vm.Exit() path that doesn't use System.Environment.Exit().
This reverts part of 78cc586d935f2009058602f2bd9adedca1442442, now that
`mono_runtime_try_shutdown` does not actually shut down, but instead
does nothing with IL2CPP.
The Mono implementation of mono_runtime_try_shutdown does not actually
shut down the VM. Instead, it sets the flags to indicate the VM is
shutting down. The VM should actually shutdown in mono_runtime_quit.

In some cases, we see this code path taken when processing the
CMD_VM_EXIT command. This seems unlikely, but can happen when the code
above cannot find a suspended managed thread. If
mono_runtime_try_shutdown actually waits for managed threads to
complete, it will hang, as the main thread won't be suspended because
resume_vm is called just above mono_runtime_try_shutdown.

So for IL2CPP mono_runtime_try_shutdown doesn't do anything, but
mono_runtime_quit will actually shutdown the VM.
Collect sequence points per assembly
Retrieve sequence point information per image
Write all debugger structures to a single file for each assembly
Write codegen and debugger structures as C code. This saves ~40% compile time on MSVC
Defines in the IL2CPP code should not be named for UNITY, as we want
IL2CPP to work independently. Clean up the names of the `UNITY_TINY`
defines then by renaming them.

This change should have no impact on runtime behavior or code size.
With IL2CPP, we don't have a good way to stop managed threads. So let's
just ignore that and exit the process.

This won't clean up and run finalizers, but the process it ending
anyway, so we don't care too much.
… macro invocation instead of looking up from index; hard code sequence point type into macro invocation
@joncham joncham force-pushed the unity-master-sync-il2cpp branch from 96a6b12 to 46ed83e Compare January 3, 2019 13:37
@joncham joncham merged commit 14c1736 into unity-master Jan 4, 2019
@joncham joncham deleted the unity-master-sync-il2cpp branch January 4, 2019 18:11
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.

4 participants