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
fix hhvm_wrapper

Summary: This scares me.

Reviewed By: @JoelMarcey

Differential Revision: D1380743
Fix linking libelf when building hack tools

Summary: Fixes errors when building hack tools which introduced in the commit facebook/hhvmb3b564d8e1d31c0676440ffe75d48bbf2b36271d

```
[ 32%] Built target hphp_analysis
hhi/libhhi.a(hhi_elf.o): In function `get_embedded_hhi_data':
hphp/hack/src/hhi/hhi_elf.c:41: undefined reference to `elf_version'
hphp/hack/src/hhi/hhi_elf.c:50: undefined reference to `elf_begin'
hphp/hack/src/hhi/hhi_elf.c:51: undefined reference to `elf_kind'
hphp/hack/src/hhi/hhi_elf.c:57: undefined reference to `elf_getshdrstrndx'
hphp/hack/src/hhi/hhi_elf.c:66: undefined reference to `elf_nextscn'
hphp/hack/src/hhi/hhi_elf.c:68: undefined reference to `gelf_getshdr'
hphp/hack/src/hhi/hhi_elf.c:72: undefined reference to `elf_strptr'
hphp/hack/src/hhi/hhi_elf.c:79: undefined reference to `gelf_getshdr'
hphp/hack/src/hhi/hhi_elf.c:101: undefined reference to `elf_end'
hphp/hack/src/hhi/hhi_elf.c:86: undefined reference to `elf_end'
collect2: error: executing ld finished with return code 1
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
make[4]: *** [hh_single.opt] Error 2
make[3]: *** [opt] Error 2
make[2]: *** [hphp/hack/CMakeFiles/hack] Error 2
make[1]: *** [hphp/hack/CMakeFiles/hack.dir/all] Error 2
make: *** [all] Error 2
```
Closes #2912

Reviewed By: ptarjan, jwatzman

Differential Revision: D1378971

Pulled By: @JoelMarcey
Supports getting compressed value using memcache extension.

Summary: Fixes #2674
Closes #2904

Reviewed By: @ptarjan

Differential Revision: D1379612

Pulled By: @JoelMarcey
Comma-separate list of side exiting blocks

Summary: This list of IDs was running together

Reviewed By: @ottoni

Differential Revision: D1379339
Remove to_file option from error_and_exit

Summary: - reduces usage of $csv_only
 - inconsistently used anyway
 - I don't think the behavior's actually desireable, especially since changing it a while back to output to stderr instead of stdout

Reviewed By: @JoelMarcey

Differential Revision: D1380862
SplFileObject::fseek should default second arg

Summary: SplFileObject should default second arg to SEEK_SET

Closes #2896

Reviewed By: @JoelMarcey

Differential Revision: D1380328
Use retFromInterpretedFrame in emitBindCall

Summary: First, there's currently a bug in the relocation code which
fails to fix up the immediate (even though we're explicitly
flagging it for fixup). That's being fixed separately, but this
is simpler

Second, it seems more correct anyway. Nothing but the unwinder
ever uses the return address in this "fake" ActRec.

Third, it gets rid of the only remaining use of StoreImmPatcher.

Reviewed By: @jdelong

Differential Revision: D1380126
Disable flaky test

Summary: It's relying on timeouts firing or not firing for correct behavior so
it's inherently flaky. I've already made one pass at improving it but it's
still being flaky.

Reviewed By: @bertmaher

Differential Revision: D1380934