Improve HHBBC's interp for SetOpL and SetOpM

Summary: It currently produces TInitCell as the output type of both bytecodes,
regardless of what the inputs are. We can feed the input types to
type-arith to get a better result type.

Reviewed By: @jdelong

Differential Revision: D1360824
Add a more useful constructor to NormalizedInstruction

Summary: It was bugging me that we create a "blank" NI and then fill
in some fields that pretty much have to be there (SrcKey, Func, and
Unit).

Reviewed By: @swtaarrs

Differential Revision: D1378297
Share event hooks between async functions and async generators

Summary: Async generators need the same type of hooks as async functions. Let's
move them to ResumableWaitHandle -- their common parent class.

Reviewed By: @billf

Differential Revision: D1378731
Typecheck parameters in PHP constructor invocations

Summary: NOTE: I assume there's something wrong with this fix since it was basically
the fix from D750432 which was reverted in
rHACK49fd0c13388ec40fe57b5793e301ccb61ba3b742 - but I'm not sure why.
Raising as an RFC; this bug bit me in www code today so there's
something to fix and probably a better way :-) .

Parameters weren't always checked in constructor invocations.

Specifically: calling ##new DerivedClass(...)##, where ##DerivedClass##
is a Hack class that extends a PHP class but inherits the constructor
from the PHP class. In that case the arguments are never visited.

Reviewed By: @pikatchu

Differential Revision: D1374187
Fix null byte in LDAP bindings

Summary: A backport of https://github.com/php/php-src/commit/9af0756dd563d4eef7ce9492a6abb1b99ef74637

Reviewed By: @JoelMarcey

Differential Revision: D1377456
Declare Bash dependency in shebang

Summary: BASH_SOURCE is obviously Bash specific and so the shebang should tell
the system to use Bash.

Also while I was there I used env to get the Bash in the user's PATH
instead of just the system's Bash.
Closes #2915

Reviewed By: @fredemmott

Differential Revision: D1378977

Pulled By: @JoelMarcey
Tidy up hhbc-translator.h

Summary: @mxw's work on code cleanliness inspired me to do some
spring cleaning on hhbc-translator.h.  It wasn't in too bad a shape,
but moving some implementation to the .cpp and grouping the public and
private parts makes it a bit easier to look through.

Reviewed By: @alexmalyshev

Differential Revision: D1378739
Abstract inotify into fsnotify

Summary: In preperation for the FSEvents port of dfind, our inotify service, I
have abstracted out inotify from dfind. Now, dfind use FSNotify, which will be
implemented with inotify on linux and FSEvents on OS X

Reviewed By: @jwatzman

Differential Revision: D1377709
Disable flaky zend test

Reviewed By: @bertmaher
Speed up refcount-opts

Summary: We were spending a lot of time copying the State struct, which had 4
smart::hash_maps in it. I converted two of the three sites to move instead of
copy and switched to smart::flat_map. flat_map is significantly faster to copy
and move, and isn't much slower to insert/look up at the relatively small sizes
these maps tend to be. The net effect is that optimizeRefcounts() is down to
~31% of time in optimize(), from ~35%. It's also no longer the most expensive
optimizatin - that title now belongs to reoptimize().

collectLdStacks has been dead since we removed the simplifier optimization that
replaced some of SpillStack/Call's sources with None so I removed it.

Reviewed By: @jdelong

Differential Revision: D1378844
Script to generate top-down perf-annotated call graphs

Summary: See the script itself for documentation. This is similar to what you
can get from "perf report -s parent -G", but it makes it easier to focus on
specific functions.

Reviewed By: @bertmaher

Differential Revision: D1378984
Make <?hh files in hphp/tools actually pass the typechecker

Summary: onelessclown

Reviewed By: @jwatzman

Differential Revision: D1378486
Implemented xdebug configuration options

Summary: This adds the skeleton required for all the defined xdebug configuration options.
All options are bound to and set to the default values defined at
http://xdebug.org/docs/all_settings.

Since xdebug by default overloads some functions, I added a custom setting
"hhvm.xdebug-not-done.enable", that only registers xdebug functions when
set to true. By default it's false.

Since there are so many different options, I made heavy use of macros to
avoid repetitive code- I hope the style is acceptable?

I also moved some of the xdebug definitions into a header, to reduce the
size of the cpp file a bit.

Reviewed By: @ptarjan

Differential Revision: D1378660
Reorganize func.h

Summary: Reorganize func.h by "grouping similar functionalities" and "separating
interface from implementation".  Also add "documentation" to help people
decipher obscure naming conventions and PHP semantics.

Functions that are not called by anyone are removed.  I've yet to remove
the m_id property of Func::SharedData, although it appears not to
actually be used by anyone, at least through the Func::id() method.  (I
removed the method, though.)

Also turn ParamInfo into a public struct rather than a private one which
does absolutely nothing except implement getters and setters.  If anyone
feels strongly about not doing this, I can just revert the changes to
the non-func.* files, but these info structs are pretty much just meant
to be bags of data, so I don't see what the methods buy us but clutter.

This reorganization and refactor is not done (see the "Junk" section at
the bottom of Func, and the FuncEmitter which ought to be separated
out), but it's ~most of the work and I want to get it in as fast as I
can before I get merge conflicts.

Reviewed By: @jdelong

Differential Revision: D1379054
Revert "Implemented xdebug configuration options"

Summary: Revert D1378660. The new tests are broken in repo mode.

Reviewed By: @swtaarrs

Differential Revision: D1380346
Make hphp/test/frameworks hack, and pass the typechecker

Summary: I want to add fbmake support; to do this cleanly needs some major refactoring. I want the typechecker's help doing this.

Also:
 - fix several bugs the typechecker found
 - fix stale references in frameworks.yaml needed to test this diff

One caveat: You need to symlink hphp/tools/command_line_lib.php into here to use the type checker

Reviewed By: @JoelMarcey

Differential Revision: D1380363
always let the first character through for camelcase searching

Summary: For the camelcase capital letter searching, filtering capital letters for class names is insufficient.

There's some clases in www with names like osapiAddress. They'd get indexed starting with a instead of oa.

Reviewed By: @jwatzman

Differential Revision: D1380188
verbose(string, bool) => multiple foo(string) functions

Summary: verbose() was used a generic conditional print function. Make separate functions for each of the use cases.

This cleanup will make it easier to add JSON output by reducing the number of places that check $csv_only.

Reviewed By: @JoelMarcey

Differential Revision: D1380624
call strip_ns for autocompleting globals in js autocomplete

Reviewed By: @jwatzman

Differential Revision: D1380031
When we get a php ast, don't do anything with it so it doesn't taint the model

Summary: I stopped sending this stuff in the backend, but a user could still open these files up and get them added to the model. So, we won't do anything with these files. Should be okay for www. I'm not concerned about not parsing stuff in <?php.

Reviewed By: @jwatzman

Differential Revision: D1379044