Functions that call vm_map_splay_merge sometimes set data fields (e.g. root->left = NULL) to affect the behavior of that function. This change stops that data manipulation, and instead calls a pair of functions, one for the left direction and the other for the right, with the function called depending whether or not we currently null the root child in that direction to control the behavior of vm_map_splay_merge.
Small running-time improvements are visible in my usual vm_map nano-benchmarks.
Before
Test1 sec dc-misses Test2 sec dc-misses
17.402387 696208819 16.695700 756675325
17.488991 702202446 16.695138 744614537
17.460239 734025345 16.569006 729289000
17.512725 743791615 16.580101 723884448
17.569991 763269763 16.628956 721604744
After
17.112856 702574892 16.159560 674984912
17.166679 706461437 16.136775 678707722
17.122392 707339253 16.148504 679940515
17.111229 701338010 16.162141 680050685
17.687890 701092368 16.152907 673210370