[interp] Error handling refactor (optimize non-exception path) (helps clang save...
commit00c1ec421a3d47931bd9ad719faec62e60277837
authorJay Krell <jaykrell@microsoft.com>
Tue, 27 Aug 2019 13:31:10 +0000 (27 06:31 -0700)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 27 Aug 2019 13:31:10 +0000 (27 15:31 +0200)
treea1b2bac69ceac9c988cc18a70fe95010f4d70853
parentfa1288794b5a38fa717d0f8db459386c3d4b3ad3
[interp] Error handling refactor (optimize non-exception path) (helps clang save stack) (#16371)

While working on stack reduction, I believe I found that
the compiler could not tell how THROW_EX and/or NULL_CHECK terminate.

That is, essentially, the success paths preserve volatile registers.
They do not have to be spilled/filled.
This tweak should make it clearer to the compiler, optimized common paths, and not slow down uncommon paths.

This also cleans it up a little and reduces macro expansion, and then possibly should allow for reinlining what is now used only once.

Also add some const so it can be casted away less.

Believed to save 32 bytes of stack with Linux/amd64/clang, nothing for gcc.
And a nice cleanup.
mono/mini/interp/interp-internals.h
mono/mini/interp/interp.c