Avoid unnecessary arguments copying inside GenericHashTraits methods
https://bugs.webkit.org/show_bug.cgi?id=115733

Reviewed by Darin Adler.

Before the change both WTF::GenericHashTraits::passOut and WTF::GenericHashTraits::passOut
used to return the given argument always by value and that caused implicit extra
copying of the argument. It was OK as long as argument type T was POD, as compiler
could optimize it, but in case T was a class having non-trivial copy constructor the
extra copying of the argument could not have been obviated.

The proposed solution is to provide overloaded functions that accept non-temporary
values and return them by reference thus avoiding extra copying.

The proposed solution made an impact on the size of libjavascriptcore_efl.so (EFL
release build): the size decreased from 6554992 bytes to 6554560 bytes.

* wtf/HashTraits.h:
(WTF::GenericHashTraits::passOut):
(WTF::GenericHashTraits::peek):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HashTraits<RefPtr<P> >::peek should consider empty value
https://bugs.webkit.org/show_bug.cgi?id=115799

Reviewed by Darin Adler.

HashTraits<RefPtr<P> >::peek() should consider passing of empty value which is
raw pointer equal to '0', and return it right away instead of converting it to RefPtr
and invoking get().

* wtf/HashTraits.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149739 268f45cc-cd09-0410-ab3c-d52691b4dbfc