erts: Optimize maps:merge
erts: Optimize maps:merge

to be better at reusing entire hashmap sub-trees.

Sub-tree reuse is detected in three cases:

1. The sub-tree top node does not exist at all in the other map.
   Already implemented before this commit.

2. The exact same sub-tree exist in both maps.
   Must calculate nr of keys in tree to get total size right.

3. We detect that a sub-tree only contains stuff from one of the maps.

There is still one case we don't detect. If A and B leafs have equal
keys we could also compare the values. If values are equal, further
node reuse could propagate up toward the root (by 'mix'==0).
The downside would be potentially expensive value comparisons.

RJ/otp,jj1bdx/otp,weisslj/otp,psyeugenic/otp,legoscia/otp,tuncer/otp,hairyhum/otp,mikpe/otp,marquisthunder/otp,klarna/otp,basho/otp,ader1990/otp,psyeugenic/otp,neeraj9/otp,basho/otp,ader1990/otp,jinshana/otp,platinumthinker/otp,paladim/otp,VincentHHL/otp,legoscia/otp,derek121/otp,c-rack/otp,emile/otp,potatosalad/otp,electricimp/otp,massemanet/otp,Teino1978-Corp/erlang-otp,rlipscombe/otp,lemenkov/otp,RGafiyatullin/otp,legoscia/otp,lrascao/otp,neeraj9/otp,weisslj/otp,g-andrade/otp,fenollp/otp,legoscia/otp,msantos/otp,ahmedshafeeq/otp,fenollp/otp,vladdu/otp,basho/otp,jinshana/otp,goertzenator/otp,vic/otp,lianghaivv/otp,theom/otp,paladim/otp,lhslll/otp,emile/otp,Teino1978-Corp/otp,enikki/otp,weisslj/otp,massemanet/otp,weisslj/otp,NOMORECOFFEE/otp,ader1990/otp,rlipscombe/otp,isvilen/otp,neeraj9/otp,g-andrade/otp,lrascao/otp,RoadRunnr/otp,goertzenator/otp,palas/otp,lightcyphers/otp,saleyn/otp,benoitc/otp-1,krishnakumar4a4/otp,massemanet/otp,sdebnath/otp,stolen/otp,bsmr-erlang/otp,emile/otp,beni55/otp,RGafiyatullin/otp,lhslll/otp,klarna/otp,lucafavatella/otp,theom/otp,goertzenator/otp,jamesruan/otp,cobusc/otp,lantti/otp,matwey/otp,emile/otp,bsmr-erlang/otp,bjorng/otp,erlang/otp,aboroska/otp,falkevik/otp,matwey/otp,lhslll/otp,ferd/otp,benoitc/otp-1,bsmr-erlang/otp,electricimp/otp,hairyhum/otp,awetzel/otp,emacsmirror/erlang,yangchengjian/otp,enikki/otp,schlagert/otp,fenollp/otp,potatosalad/otp,paulcager/otp,vladdu/otp,mikpe/otp,bugs-erlang-org/otp,klarna/otp,RJ/otp,bernardd/otp,lantti/otp,bjorng/otp,ferd/otp,paulcager/otp,RaimoNiskanen/otp,bernardd/otp,rlipscombe/otp,paladim/otp,c-rack/otp,kvakvs/otp,emile/otp,c-rack/otp,cobusc/otp,sdebnath/otp,lianghaivv/otp,fenollp/otp,schlagert/otp,sammoth-wazoku/otp,mujiatong/otp,stolen/otp,lemenkov/otp,RGafiyatullin/otp,palas/otp,krishnakumar4a4/otp,isvilen/otp,entropiae/otp,sitexa/otp,weisslj/otp,bugs-erlang-org/otp,uabboli/otp,kvakvs/otp,vic/otp,RGafiyatullin/otp,RichMorin/otp,mujiatong/otp,emacsmirror/erlang,haguenau/otp,aboroska/otp,rlipscombe/otp,msantos/otp,ferd/otp,Teino1978-Corp/erlang-otp,ahmedshafeeq/otp,RoadRunnr/otp,johanclaesson/otp,matwey/otp,rlipscombe/otp,haguenau/otp,stolen/otp,hairyhum/otp,lianghaivv/otp,bernardd/otp,potatosalad/otp,marquisthunder/otp,jj1bdx/otp,potatosalad/otp,riverrun/otp,cobusc/otp,lightcyphers/otp,aboroska/otp,NOMORECOFFEE/otp,vinoski/otp,RGafiyatullin/otp,tuncer/otp,emile/otp,msantos/otp,tuncer/otp,release-project/otp,erlang/otp,tuncer/otp,palas/otp,Teino1978-Corp/erlang-otp,benoitc/otp-1,Teino1978-Corp/otp,ahmedshafeeq/otp,vinoski/otp,klarna/otp,Teino1978-Corp/otp,kvakvs/otp,lhslll/otp,platinumthinker/otp,schlagert/otp,saleyn/otp,g-andrade/otp,cobusc/otp,potatosalad/otp,fenollp/otp,msantos/otp,schlagert/otp,goertzenator/otp,isvilen/otp,gjaldon/otp,lucafavatella/otp,paulcager/otp,vinoski/otp,erlang/otp,paladim/otp,mikpe/otp,sitexa/otp,falkevik/otp,fenollp/otp,g-andrade/otp,RaimoNiskanen/otp,VincentHHL/otp,Teino1978-Corp/erlang-otp,lightcyphers/otp,yangchengjian/otp,legoscia/otp,riverrun/otp,isvilen/otp,kvakvs/otp,uabboli/otp,cnbin/otp,rlipscombe/otp,erlang/otp,ahmedshafeeq/otp,jj1bdx/otp,marquisthunder/otp,lemenkov/otp,isvilen/otp,vinoski/otp,erlang/otp,gjaldon/otp,jamesruan/otp,jamesruan/otp,sammoth-wazoku/otp,emacsmirror/erlang,vinoski/otp,jemsbhai/otp,release-project/otp,lianghaivv/otp,sdebnath/otp,NOMORECOFFEE/otp,ahmedshafeeq/otp,vic/otp,bernardd/otp,lemenkov/otp,msantos/otp,massemanet/otp,neeraj9/otp,tuncer/otp,bsmr-erlang/otp,bugs-erlang-org/otp,emacsmirror/erlang,stolen/otp,falkevik/otp,vinoski/otp,saleyn/otp,lantti/otp,dgud/otp,bernardd/otp,vic/otp,RJ/otp,cnbin/otp,lightcyphers/otp,awetzel/otp,bjorng/otp,emacsmirror/erlang,platinumthinker/otp,dumbbell/otp,rlipscombe/otp,getong/otp,RaimoNiskanen/otp,yangchengjian/otp,paulcager/otp,mikpe/otp,platinumthinker/otp,vladdu/otp,tuncer/otp,RichMorin/otp,uabboli/otp,mujiatong/otp,RaimoNiskanen/otp,cnbin/otp,paulcager/otp,massemanet/otp,getong/otp,NOMORECOFFEE/otp,benoitc/otp-1,yangchengjian/otp,kvakvs/otp,dgud/otp,bsmr-erlang/otp,sitexa/otp,emile/otp,bsmr-erlang/otp,hairyhum/otp,jemsbhai/otp,RaimoNiskanen/otp,falkevik/otp,gjaldon/otp,riverrun/otp,c-rack/otp,enikki/otp,vladdu/otp,klarna/otp,ader1990/otp,sdebnath/otp,yangchengjian/otp,cobusc/otp,jinshana/otp,bjorng/otp,sitexa/otp,lrascao/otp,entropiae/otp,potatosalad/otp,bugs-erlang-org/otp,VincentHHL/otp,RichMorin/otp,gjaldon/otp,emacsmirror/erlang,bugs-erlang-org/otp,bjorng/otp,schlagert/otp,beni55/otp,erlang/otp,mujiatong/otp,tuncer/otp,GinjaNinja32/otp,kvakvs/otp,bernardd/otp,cobusc/otp,lantti/otp,marquisthunder/otp,weisslj/otp,jj1bdx/otp,klarna/otp,g-andrade/otp,haguenau/otp,RoadRunnr/otp,NOMORECOFFEE/otp,derek121/otp,paladim/otp,sdebnath/otp,RichMorin/otp,derek121/otp,enikki/otp,erlang/otp,Teino1978-Corp/erlang-otp,dgud/otp,entropiae/otp,matwey/otp,lightcyphers/otp,ader1990/otp,johanclaesson/otp,lhslll/otp,stolen/otp,release-project/otp,yangchengjian/otp,platinumthinker/otp,Teino1978-Corp/erlang-otp,mujiatong/otp,rlipscombe/otp,johanclaesson/otp,platinumthinker/otp,c-rack/otp,cnbin/otp,theom/otp,beni55/otp,bjorng/otp,lianghaivv/otp,bsmr-erlang/otp,dumbbell/otp,benoitc/otp-1,lantti/otp,falkevik/otp,lantti/otp,benoitc/otp-1,lrascao/otp,jamesruan/otp,yangchengjian/otp,jemsbhai/otp,dgud/otp,fenollp/otp,dumbbell/otp,fenollp/otp,goertzenator/otp,derek121/otp,lightcyphers/otp,VincentHHL/otp,cnbin/otp,bsmr-erlang/otp,ader1990/otp,beni55/otp,RichMorin/otp,falkevik/otp,jj1bdx/otp,sammoth-wazoku/otp,lantti/otp,hairyhum/otp,basho/otp,RoadRunnr/otp,GinjaNinja32/otp,GinjaNinja32/otp,krishnakumar4a4/otp,palas/otp,matwey/otp,getong/otp,c-rack/otp,johanclaesson/otp,RoadRunnr/otp,dgud/otp,derek121/otp,psyeugenic/otp,lrascao/otp,dumbbell/otp,aboroska/otp,jemsbhai/otp,erlang/otp,getong/otp,lhslll/otp,bugs-erlang-org/otp,GinjaNinja32/otp,krishnakumar4a4/otp,riverrun/otp,getong/otp,uabboli/otp,basho/otp,marquisthunder/otp,gjaldon/otp,riverrun/otp,vinoski/otp,vladdu/otp,release-project/otp,msantos/otp,RaimoNiskanen/otp,bsmr-erlang/otp,jj1bdx/otp,bernardd/otp,jinshana/otp,beni55/otp,mikpe/otp,bernardd/otp,bjorng/otp,lrascao/otp,aboroska/otp,dgud/otp,haguenau/otp,matwey/otp,NOMORECOFFEE/otp,schlagert/otp,potatosalad/otp,NOMORECOFFEE/otp,g-andrade/otp,RaimoNiskanen/otp,bugs-erlang-org/otp,psyeugenic/otp,hairyhum/otp,benoitc/otp-1,marquisthunder/otp,GinjaNinja32/otp,jamesruan/otp,ahmedshafeeq/otp,uabboli/otp,neeraj9/otp,potatosalad/otp,entropiae/otp,saleyn/otp,lucafavatella/otp,NOMORECOFFEE/otp,ferd/otp,dumbbell/otp,emacsmirror/erlang,falkevik/otp,mujiatong/otp,Teino1978-Corp/otp,RJ/otp,lucafavatella/otp,c-rack/otp,palas/otp,entropiae/otp,lianghaivv/otp,legoscia/otp,beni55/otp,jinshana/otp,ferd/otp,VincentHHL/otp,kvakvs/otp,goertzenator/otp,isvilen/otp,enikki/otp,saleyn/otp,emile/otp,sdebnath/otp,saleyn/otp,ferd/otp,tuncer/otp,Teino1978-Corp/otp,goertzenator/otp,RichMorin/otp,theom/otp,c-rack/otp,lemenkov/otp,erlang/otp,klarna/otp,RJ/otp,uabboli/otp,erlang/otp,marquisthunder/otp,platinumthinker/otp,Teino1978-Corp/otp,getong/otp,potatosalad/otp,platinumthinker/otp,RGafiyatullin/otp,lrascao/otp,kvakvs/otp,haguenau/otp,dgud/otp,lianghaivv/otp,saleyn/otp,vladdu/otp,mujiatong/otp,g-andrade/otp,benoitc/otp-1,dgud/otp,jamesruan/otp,msantos/otp,jj1bdx/otp,awetzel/otp,ferd/otp,sammoth-wazoku/otp,gjaldon/otp,Teino1978-Corp/erlang-otp,dumbbell/otp,beni55/otp,dumbbell/otp,johanclaesson/otp,lemenkov/otp,enikki/otp,paladim/otp,cnbin/otp,ader1990/otp,krishnakumar4a4/otp,jemsbhai/otp,mikpe/otp,stolen/otp,GinjaNinja32/otp,lemenkov/otp,mikpe/otp,Teino1978-Corp/otp,vladdu/otp,electricimp/otp,johanclaesson/otp,theom/otp,electricimp/otp,vinoski/otp,RoadRunnr/otp,theom/otp,jinshana/otp,klarna/otp,isvilen/otp,bjorng/otp,lhslll/otp,sitexa/otp,lucafavatella/otp,legoscia/otp,psyeugenic/otp,paulcager/otp,bugs-erlang-org/otp,msantos/otp,rlipscombe/otp,basho/otp,paulcager/otp,derek121/otp,RGafiyatullin/otp,jemsbhai/otp,vinoski/otp,lightcyphers/otp,VincentHHL/otp,neeraj9/otp,electricimp/otp,sammoth-wazoku/otp,johanclaesson/otp,ader1990/otp,haguenau/otp,paulcager/otp,RoadRunnr/otp,mikpe/otp,electricimp/otp,isvilen/otp,g-andrade/otp,legoscia/otp,jinshana/otp,lhslll/otp,dumbbell/otp,cnbin/otp,g-andrade/otp,lrascao/otp,RoadRunnr/otp,RoadRunnr/otp,VincentHHL/otp,lemenkov/otp,VincentHHL/otp,cobusc/otp,electricimp/otp,bjorng/otp,release-project/otp,getong/otp,stolen/otp,matwey/otp,RichMorin/otp,basho/otp,sammoth-wazoku/otp,palas/otp,RichMorin/otp,uabboli/otp,marquisthunder/otp,dgud/otp,johanclaesson/otp,emacsmirror/erlang,awetzel/otp,bjorng/otp,neeraj9/otp,potatosalad/otp,weisslj/otp,matwey/otp,lucafavatella/otp,psyeugenic/otp,release-project/otp,vic/otp,Teino1978-Corp/erlang-otp,aboroska/otp,goertzenator/otp,weisslj/otp,dumbbell/otp,lantti/otp,haguenau/otp,entropiae/otp,getong/otp,aboroska/otp,jamesruan/otp,lianghaivv/otp,emacsmirror/erlang,bernardd/otp,RJ/otp,jj1bdx/otp,falkevik/otp,sdebnath/otp,awetzel/otp,sitexa/otp,jj1bdx/otp,neeraj9/otp,RaimoNiskanen/otp,electricimp/otp,basho/otp,lrascao/otp,theom/otp,paladim/otp,RGafiyatullin/otp,massemanet/otp,derek121/otp,palas/otp,massemanet/otp,riverrun/otp,schlagert/otp,riverrun/otp,matwey/otp,falkevik/otp,GinjaNinja32/otp,jinshana/otp,awetzel/otp,goertzenator/otp,massemanet/otp,sitexa/otp,vinoski/otp,enikki/otp,dumbbell/otp,cnbin/otp,basho/otp,jemsbhai/otp,dgud/otp,paladim/otp,jemsbhai/otp,getong/otp,cobusc/otp,sdebnath/otp,gjaldon/otp,stolen/otp,isvilen/otp,RJ/otp,RJ/otp,krishnakumar4a4/otp,theom/otp,enikki/otp,riverrun/otp,derek121/otp,uabboli/otp,psyeugenic/otp,g-andrade/otp,ferd/otp,hairyhum/otp,vic/otp,haguenau/otp,electricimp/otp,vic/otp,saleyn/otp,mikpe/otp,entropiae/otp,hairyhum/otp,awetzel/otp,jj1bdx/otp,release-project/otp,rlipscombe/otp,krishnakumar4a4/otp,yangchengjian/otp,palas/otp,sammoth-wazoku/otp,tuncer/otp,uabboli/otp,RaimoNiskanen/otp,schlagert/otp,mikpe/otp,vladdu/otp,Teino1978-Corp/otp,GinjaNinja32/otp,lightcyphers/otp,kvakvs/otp,ahmedshafeeq/otp,entropiae/otp,legoscia/otp,aboroska/otp,ahmedshafeeq/otp,ferd/otp,lucafavatella/otp,release-project/otp,emacsmirror/erlang,weisslj/otp,massemanet/otp,fenollp/otp,mujiatong/otp,aboroska/otp,ahmedshafeeq/otp,getong/otp,gjaldon/otp,emile/otp,lucafavatella/otp,isvilen/otp,vladdu/otp,release-project/otp,krishnakumar4a4/otp,sammoth-wazoku/otp,jamesruan/otp,awetzel/otp,saleyn/otp,psyeugenic/otp,beni55/otp,sitexa/otp,vic/otp