Reorder checks in tcmalloc.
Reorder checks in tcmalloc.

One of our local changes to tcmalloc is logic to reject all
allocations above a certain size. (At least those via malloc and so
on.)  The check for that doesn't need to be on the hot path.  Most
allocations are small and there is a special case for that already.
If that special case applies then we don't need to check if the
allocation is gigantic.

This is a performance tuning change.  It doesn't affect functionality.

To evaluate this change I ran 3 page cyclers: bloat, dhtml, and
morejs.  I used ChromeOS on the Samsung 550.  I ran 30 trials; a few
randomly failed, but I got close to 30 "before" and "after" results
for each of those 3 tests.

Results in order of p-value were:
Bloat  0.3% faster, p=0.02
DHTML  0.3% faster, p=0.46
MoreJS 0.1% faster, p=0.82

This looks like a useful gain, but it's small, as one would expect.

BTW I'm trusting the compiler to rewrite
(x < (constant0)) && (x < (constant1))
to
(x < (the smaller of the two constants))

I checked the generated code, and it looks good (at least on the
ChromeOS toolchain for Samsung 550).

BUG=111726
TEST=none
R=jar


Review URL: https://chromiumcodereview.appspot.com/12572005

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@189321 0039d316-1c4b-4281-b951-d872f2087c98

markYoungH/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,mogoweb/chromium-crosswalk,dushu1203/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,ltilve/chromium,hgl888/chromium-crosswalk-efl,ltilve/chromium,anirudhSK/chromium,M4sse/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,patrickm/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,markYoungH/chromium.src,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,dednal/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,M4sse/chromium.src,jaruba/chromium.src,patrickm/chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,Chilledheart/chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,hujiajie/pa-chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,ltilve/chromium,ondra-novak/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,littlstar/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,ltilve/chromium,axinging/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,timopulkkinen/BubbleFish,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,littlstar/chromium.src,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,jaruba/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Jonekee/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src