Don't emit UnboxPtr when doing a SetProp with a RAT that's a Cell.

Summary: We already do this for CGetProp, but not SetProp.

Reviewed By: @jdelong

Differential Revision: D1396123
merge in missing LIBJSONC_LIBRARY

This was in our internal repo but not open source for some reason.
sync test changes
Added Twital test suite

Summary: Twital is a small "plugin" for Twig that adds some sugar syntax, which makes its templates similar to PHPTal or AngularJS.
Closes #3067

Reviewed By: @fredemmott

Differential Revision: D1411056

Pulled By: @LiraNuna
Move sucessful tests from zend/bad to zend/good

Summary: This diff is the result of executing two scripts in combination with the output from D1385647.
This script is moving a single file:

  <?php
  $test = $argv[1];
  $dest = str_replace('zend/bad', 'zend/good', dirname($test)) . '/';

  system('git mv ' . $test . '* ' . $dest);

This script simply runs the above script in a loop over the success-list file generated by executing `./hphp/test/run hphp/test/zend/bad`:

  while read test;
  do echo $test
    move_passing $test
  done < ~/passing

Reviewed By: fredemmott, joelm

Differential Revision: D1386355
Merge IndexedMemoryRef into MemoryRef for x64

Summary: This generally simplifies the x86-64 api by reducing
overloaded methods. As a result, a number emit functions
no longer need to be templated.

Reviewed By: @markw65

Differential Revision: D1410424

Revert Plan:
go for it
Facebook: [proxygen] Cleanup graceful shutdown

Summary: We don't really need specialization of shouldShutdown() for
downstream. The ConnectionManager will tell us (twice) when we should
shutdown via notifyPendingShutdown(). The other codepath through the
controller just makes shutdown harder to reason about without clear gains.

I also cleaned up the code a bit in `ConnectionManager.cpp`

Reviewed By: afrind

Differential Revision: D1399249
Fix typo in FindLibDL.cmake

Summary: spellingfail

Reviewed By: @LiraNuna

Differential Revision: D1411484
put args in backtrace

Summary: matching php5

Reviewed By: @JoelMarcey

Differential Revision: D1408391
Stop generating LdStack<Gen> after GuardStk<T> with the simplifier off.

Summary: With the simplifier off, HhbcTranslator::pop() ends up producing
LdStack<Gen> for PopR, even though we may have guarded on a known type
on the stack slot. This causes us to later emit a CheckType<BoxedCell>,
which wreaks havoc with guard relaxation as it tries to refine Str and
BoxedCell and dies on an assert.

Reviewed By: @ottoni

Differential Revision: D1406686
Fix floating-point overflow for binary, octal, and hex literals.

Summary: Literals that are hex, oct, or binary are promoted to doubles when
they set the sign bit. We were using strtoull instead of strtoll.

We also weren't calling zend_oct_strtod or zend_bin_strtod (we didn't
even have it, I pulled it in from php-src) in
ScalarExpression::getVariant().

Reviewed By: @ptarjan

Differential Revision: D1409285
Autocomplete: Rank results

Summary: Adds ranking for autocomplete results based on whether they are they type we expect or not.
Right now, this is a boolean. Eventually, this should be "how many steps away the value I want is from what I want" (with some kind of limit)

We determine whether something is the expected type by looking for the deepest fun call that we're autocompleting inside. We look at the type of that AND it's return type, and check Typing_subtype.is_subtype to decide if it's a good argument or not.

In json output mode, we include which args are good. In normal mode, we'll sort those to the top.

To achieve this:
-Instead of converting types to strings when we find results, we store results with their ty.
-When we autocomplete something, we store the position of the autocomplete and the typing_env if it's available.
-On the way up from the recursion where we checked arguments, we check the position of the autocomplete if it's inside an argument of the function we're checking. If it is, we store what type we were looking for.
-When results are requested, we take our results, the stored env, and the stored type (if we have them), and rank.

Minor stuff I did to make this work:
-new ID autocomplete hook is moved from naming to typing so that I can get an environment.
-left hint and ID autocomplete where it used to be for now but eventually, ID autocomplete needs to move to typing so global funcs get ranked.
-on new ID() completions, we now provide the constructor args to the user. (This lets us filter now too because we have a ty for it) I do some sketchy stuff here. (For new ID only) If no constructor ty exists, I make a fake one that takes no args. If a constructor does exist, I change the return type to be the class it's constructing. this make my ranking work, and otherwise, when we do typing_print, it shows void as the return type, which seems more incorrect.
-Refactored a bit as well. Stopped storing results as a Smap (more trouble than it's worth with classes/funs sharing the same name) and switched it to a list. In case we end up hitting our hooks more than once, is_autocomplete checks if we've got results yet.

More work still to do here refactoring wise and getting globals funcs ranked (in another diff)

Reviewed By: @pikatchu

Differential Revision: D1406315
Remove JIT::RuntimeType

Summary: The few remaining uses of it have been replaced with JIT::Type. I also
moved around some related struct and function definitions so they'd make more
sense. JIT::Location and JIT::DynLocation are next on the hitlist; they have
more modern replacements in RegionDesc.

Reviewed By: @bertmaher

Differential Revision: D1407922
Don't set $_SERVER['HOSTNAME'] in CLI SAPI

Summary: Matches the behavior of PHP.
Closes #2975

Reviewed By: @fredemmott

Differential Revision: D1393791

Pulled By: @LiraNuna
save licence.hdf

Summary: incase it disapears from the internet

Reviewed By: @fredemmott

Differential Revision: D1412104
remove H from regex

Summary: I thought the H was from a .h file, but it was actually the prefix of /home. We were just getting lucky that we all were building out of our home dirs. :)

Reviewed By: @fredemmott

Differential Revision: D1411950
saving any different then array or object to ArrayObject/Iterator throws InvalidArgumentException

Summary: Closes #3068

Reviewed By: @ptarjan

Differential Revision: D1411107

Pulled By: @LiraNuna
Update tested composer version

Summary: Empty clownlist, as https://github.com/composer/composer/issues/3049 is fixed

Reviewed By: @ptarjan

Differential Revision: D1410823
Fix a documentation fail in typing_enum

Summary: Actually document typing_enum in typing_enum.ml instead of documenting dynamic_yield.

Tests already failing.

Reviewed By: @jwatzman

Differential Revision: D1411795
Improve init time

Summary: Our init time has gotten somewhat out of hand -- we're up to
about 55s now. This drops it back down to 50s, still bad but it helps.

@pikatchu's intuition was that it was the autoload map, which is an hh
file instead of a php file now with hack build, but that doesn't seem to
be accurate -- deleting the autoload map did not significantly decrease
the init time. That said, I think it's a www change, since checking out
an old Hack build didn't help either.

Reviewed By: @elgenie

Differential Revision: D1409316