fixed an error in the hphpize.cmake file

Summary: LIBDIR was repeated twice. The first one should have been PREFIX

Reviewed By: @ptarjan

Differential Revision: D1471149
gperftools include file don't find

Summary: google/profiler.h don't find

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

Reviewed By: @ptarjan

Differential Revision: D1470627

Pulled By: svcscm
Add LibGMP extension

Summary: I've recreated the PHP gmp extension with HNI.  I believe it to be working well, but this is the first extension I've written so any and all criticism of my C-code is encouraged.

This extensions supports all GMP functions, and constants, with the exception of gmp_random.

I have submitted a CLA in the past; it might be under "ian@ my github username" (CA -> .ca); I had to submit it a few times last time around, so hopefully it's properly on record this time; if it's not, let me know.

Cheers

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

Reviewed By: @ptarjan

Differential Revision: D1470423

Pulled By: @sgolemon
Print current approx typechecking position on SIGUSR1

Summary: When some code being typechecked causes pathological behavior
in the typechecker, it can be useful to figure out approximately where
in the codebase we are checking. Right now, this involves a lot of
one-off logging being manually added, so let's do something a little
more clever. Every time we typecheck an expression, record its position,
and then on SIGUSR1, print that out. The envisoned use case is to attach
to a runaway proccess with gdb, look at the backtrace, and kill it with
SIGUSR1 to try and figure out WTF is going on.

We may ultimately want to expand this into something more general,
notably including things other than typing, but this is good enough for
now -- the 3-4 cases of runaway workers I've seen have all been in
typing.

This also kills `Typing.debug` since it was only used in one place, was
potentially confusing with the new data I'm adding, and was of dubious
utility (blocking `hh_show` in server mode).

Reviewed By: @elgenie

Differential Revision: D1467911
Fix usage of field_key/value in yield

Summary: This wasn't morally doing the right thing, even though the
current usages of `field_key` and `field_value` don't let you trigger
it. The type of an array field key and a `yield $x => $y` field key are
different mechanics, and the logic in the latter to determine whether a
missing `$x` is implicitly null or an int doesn't apply to arrays.

Reviewed By: @jano

Differential Revision: D1471174
Add useful test file for loops.

Summary: Saved my life several times now.

Reviewed By: @bertmaher

Differential Revision: D1470875
Revert "Prototype of general host health monitor."

Summary: This reverts commit e29c52bace619495459fa887cc7001fec794aa89. It's
breaking the OSS version of hhvm.

Reviewed By: @alexmalyshev

Differential Revision: D1472677
Fixed tempnam() creates paths with '//'

Summary: Sync with PHP's implementation

Closes #3313

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

Reviewed By: @ptarjan

Differential Revision: D1470642

Pulled By: svcscm
Fix bug with HashCollection::shrink()

Summary: This fixes a crashing bug related to HashCollection::shrink() where in some
cases it was allocating insufficient capacity and overrunning the buffer.

Reviewed By: @elgenie

Differential Revision: D1472072
Find and move good zend tests in the bad folder

Summary: This script finds good test in the zend/bad folder and moves them to zend/good

I ran it and included the moved tests in here.

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

Reviewed By: @sgolemon

Differential Revision: D1444261

Pulled By: svcscm
Remove reflection hacks for primitive typehints

Summary: When updating how primitive typehints worked, some hacks were done to strip
the "HH\" prefix from the output of various refleciton methods. These hacks
shouldn't be needed anymore. This diff removes the hacks and fixes up
ReflectionParameter::getClass() to be aware of the 'num', 'resource',
'mixed', and 'void' typehints.

Reviewed By: @elgenie

Differential Revision: D1253815
Changed grammar mistakes @rkulagowski found in --help

Summary: Fixes #3334

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

Reviewed By: sgolemon, ptarjan

Differential Revision: D1471012

Pulled By: svcscm
Improve readability of comments for lookupMethodCtx()

Reviewed By: @edwinsmith

Differential Revision: D1473040
Clean up lint in move_good_tests.py

Summary: Apply suggestions from https://reviews.facebook.net/D20205

Reviewed By: @LiraNuna

Differential Revision: D1473059
Fix GMP test

Summary: This didn't make it into the last pull; sorry!

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

Reviewed By: @ptarjan

Differential Revision: D1472912

Pulled By: svcscm
Move readfile_variation6.php to flaky

Summary: Move readfile_variation6.php to flaky/ since it uses files used by other tests

Reviewed By: @fredemmott

Differential Revision: D1473626
Imported needed xdebug files

Summary: This diff directly imports some xdebug code in the directory
`runtime/ext/xdebug/php5_xdebug` as well as in
`runtime/ext/xdebug/xdebug_utils.*`.  Right now, this includes the files
for xdebug strings, xdebug xml, and xdebug memory allocation. I've modified
it to compile in c++, I've removed and replaced dependencies, and I've changed
the style enough to get the linter to stop complaining.

I've written TODOs in each of these files to abstract and refactor
these files. This is low-pri, but I do think it's worth being on the list of
things to do for maintainablity purposes. As I'm sure you will see, the code is
hard to follow, it's verbose, and malloc and free are used worryingly liberally.

The threat of creating potential memory leaks due to the required manual
mallocing/freeing when modifying code is probably my biggest worry. I don't think
cleaning these up will be a huge task, as I've ensured they're as modularized as
possible.

Reviewed By: @ptarjan

Differential Revision: D1471865
Add norepo file if test does not pass

Summary: The test runner only added .norepo files if the tests pass. This diff changes the behavior to keep the .norepo file even if the tests fail or are flaky.

Reviewed By: @ptarjan

Differential Revision: D1473808
Added function imagepalettecopy to ext_gd

Summary: Closes #3338

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

Reviewed By: @sgolemon

Differential Revision: D1474062

Pulled By: svcscm
fix mb_convert_case when encoding set other than default

Summary: Closes https://github.com/facebook/hhvm/pull/3245

Reviewed By: @ptarjan

Differential Revision: D1447241

Pulled By: @sgolemon