Use MM for ZendNormalResourceDataHolder allocs

Reviewed By: @edwinsmith

Differential Revision: D1740036
Switch Find Refs to use Hooks

Summary: Cleaned up Find References to use Typing_hooks, instead of global/references. Motivation is I want to reuse those hooks.

There's still some stuff to clean up (in another diff) to do with the 'identify symbol at position', before find_refs.ml can be deleted.

Reviewed By: @jwatzman

Differential Revision: D1744206

Signature: t1:1744206:1418781424:b32979558ad4245b187cd77d252167d7feacd7da
Fix use-after-free in CacheClient

Summary: It was being used like this:

 const auto& key = Controller::mapKeyAsString(Controller::mapKey(it))

Which would bind key to a reference to a temporary which was immediately
destroyed. Now it gets bound to an explicit temporary, which gets the
lifetime of the reference.

Reviewed By: @​zhuohuang

Differential Revision: D1746309

Signature: t1:1746309:1418850925:b21b002005dbdb685136a08b1466ff5e23b6c9a2
Faster UnitCache

Summary: This tries to put things back the way they used to be. The
assumption is that in the steady state, all the files are already
in the UnitCache, so look them up there first. If we don't find
them there, then we do the slow things like realpath, and creating
StaticStrings. If the realpath is different from the request path,
we store the unit under both paths.

Reviewed By: @jdelong

Differential Revision: D1744202
Fix benchy clean step

Summary: fbmake clean is too eager. Just remove the _build symlink
instead. Also changes the fbmake build step to work around some issues.

Reviewed By: @jdelong

Differential Revision: D1743685
Misc fixes for LLVM.

Summary: - Update with LLVM build containing !locrec fixes.
- Do not assert when call instruction is not found for !locrec.
- Allow .rodata sections to be allocated at 16-byte boundary.

Reviewed By: @swtaarrs

Differential Revision: D1744740
Fix count_chars return value for empty strings

Summary: Closes #4395.
Closes https://github.com/facebook/hhvm/pull/4396

Reviewed By: @paulbiss

Differential Revision: D1721933

Signature: t1:1721933:1418866089:96ae64eefbcdd099751c2abaa9c35666c7066d40
Update third-party hash for libmbfl cmake fix

Summary: See: https://github.com/hhvm/hhvm-third-party/commit/1d387ce2a33fc75d25c7ee3318537296387d8799

Reviewed By: @paulbiss

Differential Revision: D1747030

Signature: t1:1747030:1418864344:44cf2ea827cccd2c2fd4a926352855ce7bc975b9
Fix Memcached::setOption for OPT_LIBKETAMA_COMPATIBLE

Summary: The current implementation is missing an if-statement which causes
the option to be unset even when a truthy value is passed in. The comment
directly above this block describes the correct behavior. See the original PHP
implementation for reference: http://goo.gl/7p7WqP. A new constant
Memcached::DISTRIBUTION_CONSISTENT_KETAMA is added for the sake of testing.

Closes https://github.com/facebook/hhvm/pull/4364

Reviewed By: @paulbiss

Differential Revision: D1710109

Signature: t1:1710109:1418880558:9a97113ad941927c06ca0ed8389f2208b18eca86
Actually get the realpath first thing when searching for a file.

Summary: D1729338 fixed a subtle bug, but not completely. We didn't handle the case where
the test runner was run in the exact same directory as the test in question. If we
did, it would still come in as `.` if `dirname()` was used beforehand, which is
probably not desired behavior. So move the call to `realpath()` to before the
`while()` loop and all cases should now be handled.

{sync, type="child", parent="internal", parentrevid="1742941", parentrevfbid="866765913387291", parentdiffid="5964829"}

Reviewed By: @paulbiss

Differential Revision: D1742941

Signature: t1:1742941:1418878079:1499d0d009589f7a47a1f1a04e08619c2813b673
Explicitly narrow Bool dests when appropriate in vasm

Summary: This ensures that the destination register for instructions like
t5:Bool = AssertType<Bool> t4:Cell will have the right type (i8) in llvm, and
it shouldn't affect the code generated by vasm-x64.

Reviewed By: @jasone

Differential Revision: D1746194

Signature: t1:1746194:1418849552:9c866c2c7ff77fc6333af6576687c96a13ebcc7f
Rename Vunit::cpool to constants

Reviewed By: @alexmalyshev

Differential Revision: D1746483
All test skips shouldn't be clowntown

Summary: The tests exist; it is just that we skip them. That is different than
trying to run the runner on no tests at all.

{sync, type="child", parent="internal", parentrevid="1747947", parentrevfbid="1634072033486914", parentdiffid="5989133"}

Reviewed By: @fredemmott

Differential Revision: D1747947

Signature: t1:1747947:1418907361:4bf41aab6ec48a15de6fa2acb21ab49734c6f037
Add PHP lang spec tests to HHVM test suite

Summary: We have wanted to do this for a while, so now I am. These are
the PHP lang spec tests. I used the PHP 5.x import script
as a model to get the tests. But we don't have `good`, `bad`, etc.
Instead we have a global `config.skipif` with the tests that are failing
and we put a comment as to why they are failing.

Key file changes (other than new tests and expect files):

```
hphp/test/README.md
hphp/test/run
hphp/test/spec/.gitattributes
hphp/test/spec/.gitignore
hphp/test/tools/find_non_ascii_files.php
hphp/test/tools/import_spec_test.py
hphp/test/spec/config.skipif  (autogenerated by import_spec_test.py)
```

Reviewed By: @paulbiss

Differential Revision: D1718437
fix typo in fastlz library cmake variable

Summary: i guess my console font didn't help me notice this one :(
Closes https://github.com/facebook/hhvm/pull/4475

Reviewed By: @paulbiss

Differential Revision: D1745333

Signature: t1:1745333:1418921775:14f4f9664b8e905394f432396081ef90e4528fc5
(Cleanup) fb_thrift_unserialize

Summary: Discovered while typing `i fb_unserialize` in `hphpd`. This function
doesn't exist. TAO has more lovely references to it, and to files that
don't exist. Fun.

Reviewed By: @markw65

Differential Revision: D1747154

Signature: t1:1747154:1418922414:ba13c725d7341bb493acc67c1398a0c3401a4808
Manually inline unserializeKey

Summary: This just bounces execution from type-variant to variable-unserializer
and back for no really good reason.  It's only used in two places, so just do
it inline.

Reviewed By: @jdelong, @alexmalyshev

Differential Revision: D1747600

Signature: t1:1747600:1418869968:22e2abe342d2cd4730fb58a953096b25144da6ff
codemod: merge folly/wangle and folly/experimental/wangle

Summary: Various TARGETS could definitely use some rearranging but I'd rather wait until we're cut over to the new repo

Reviewed By: @djwatson

Differential Revision: D1740858
Allow user to wait forever for server initialization

Reviewed By: @elgenie

Differential Revision: D1746433

Signature: t1:1746433:1418934482:d386ea7f8dbf44f33d99b4c94816605b1427c541
Update third-party hash from lz4, pcre and timelib (license) updates

Summary: 3 pull request updates for third-party integrated now.

Reviewed By: @paulbiss

Differential Revision: D1748723

Signature: t1:1748723:1418933268:286afa61c6d01a3d78e62aff40ac1d4849efd435