Reduce TLS accesses. (#11487)
commitf57ceafa106cea841113e526b2dc3ef6b884a6c9
authorJay Krell <jay.krell@cornell.edu>
Thu, 1 Nov 2018 03:49:29 +0000 (31 20:49 -0700)
committerGitHub <noreply@github.com>
Thu, 1 Nov 2018 03:49:29 +0000 (31 20:49 -0700)
tree2bc512a431ed6ef09fd86706bb58501a34c33a3b
parentd28db369f1b6db313c19bc2ae40ed366cdb25f52
Reduce TLS accesses. (#11487)

* Reduce TLS accesses.
Functions with HANDLE_FUNCTION_ENTER, only call mono_thread_info_current once,
instead of 1 + per-MONO_HANDL_NEW.

This can be extended in future in multiple potential ways.
 1 Macro split from HANDLE_FUNCTION_ENTER.
   This is easiest/no downside, i.e. for functions that do not HANDLE_FUNCTION_ENTER
   but that do multiple MONO_HANDLE_NEW, call other macro
   just to mono_thread_info_current () into local.
 2 Pass TLS as seperate parameter. Probably not actually, see 4.
 3 Store TLS in handles -- too large? Probably not actually, see next.
 4 Store TLS in MonoError. i.e. MonoError is "call context", chained
   up to "thread context".
mono/metadata/handle.c
mono/metadata/handle.h