Configure Logger in a certain way in the lint mode.

Summary: There was a recent change in cli.hdf that bumped the default
log level to warning. The "No syntax errors detected" message stopped
being printed which is extremely confusing.

Configuring Logger in a specific way so we always get these errors
printed to stdout.

Reviewed By: @markw65

Differential Revision: D1411557
Fix double-inlining bug w/ singleton inlining

Summary: My singleton inlining machinery assumed that the regular inliner could
never inline singleton patterns.  If this is false, we'll sometimes
inline a function twice, which appears to be happening in practice in
perflab.

I'll try to move the singleton stuff into the new inlining machinery
that I have diffs up for now.

Reviewed By: @bertmaher

Differential Revision: D1412015
Revert "put args in backtrace"

Summary: This reverts commit 6c73c78506536f309dc2445c4b525266008b0823.

D1408391 breaks flib/storage/tao/error/__tests__/TaoClientErrorsTest.php

Reviewed By: @jdelong

Differential Revision: D1414048
JIT on OSX

Summary: As discussed with @ptarjan, these don't fix the JIT entirely (though you can now do a JITted ``echo 1`` on OSX), but these are fine to land on their own.
Closes #2945

Reviewed By: @ptarjan

Differential Revision: D1401501

Pulled By: @LiraNuna
Update runtime options.

Summary: Sync with facebook/hhvm82906a2 and facebook/hhvm6661004.
Closes #3063

Reviewed By: @fredemmott

Differential Revision: D1410400

Pulled By: @LiraNuna
add missing include in ext_stream

Summary: We need to include sys/stat.h, or we might get errors such as:
error: aggregate 'stat s' has incomplete type and cannot be defined

Fixes the OSX build.
Closes #3061

Reviewed By: @fredemmott

Differential Revision: D1410257

Pulled By: @LiraNuna
Convert ext/xsl to HNI.

Summary: Two new tests:
```zend/bad/ext/xsl/tests/bug53965.php``` failing because of missing entity loader (see https://github.com/facebook/hhvm/pull/2376)
```zend/good/ext/xsl/tests/xslt010.php``` passing, imported from php-src

Signed-off-by: Arthur Loiret <arthur.loiretens-lyon.fr>
Closes #3059

Reviewed By: @fredemmott

Differential Revision: D1410101

Pulled By: @LiraNuna
Disable flaky zend test

Summary: failed on unrelated D1413405

Reviewed By: liranuna, bsimmers, alexanderm

Differential Revision: D1414139
only do libpam on apple

Summary: Doing what paravoid suggested on https://github.com/facebook/hhvm/pull/2085

Reviewed By: @fredemmott

Differential Revision: D1412431
use system sqlite if present

Summary: porting from http://anonscm.debian.org/gitweb/?p=collab-maint/hhvm.git;a=tree;f=debian/patches;h=d3f6359591ab2af99d1f8ce24bc37a7cb5353aac;hb=HEAD

Reviewed By: @fredemmott

Differential Revision: D1412602
use system double-conversion if present

Summary: upstreaming commit from http://anonscm.debian.org/gitweb/?p=collab-maint/hhvm.git;a=tree;f=debian/patches;h=d3f6359591ab2af99d1f8ce24bc37a7cb5353aac;hb=HEAD

Reviewed By: @fredemmott

Differential Revision: D1412494
use system liblz4 if available

Summary: Upstreaming http://anonscm.debian.org/gitweb/?p=collab-maint/hhvm.git;a=blob;f=debian/patches/use_system_lz4;h=efdaae12088122a7ff7baa0fd6cf03b5f194df7b;hb=HEAD

Reviewed By: @fredemmott

Differential Revision: D1412662
use libzip on the system if present

Summary: Upstreaming from http://anonscm.debian.org/gitweb/?p=collab-maint/hhvm.git;a=blob;f=debian/patches/use_system_libzip;h=07c87fc685dab67d6dfc4b0c1851f1f78249e3a1;hb=HEAD

Reviewed By: @fredemmott

Differential Revision: D1413045
Fix bug renumbering region blocks

Summary: For Profile translations, the first block is renumbered to match the
TransID of the translation, so that we can easily map BlockIds to
TransIDs for these translations.  However, the arcs involving such
blocks were not being adjusted accordingly.  This diff fixes this, and
also add an assertion to make sure that we only process blocks in
non-topological order in translateRegion when loops are enabled.

Reviewed By: @edwinsmith

Differential Revision: D1411119
Don't require needsInitSProps before initializing

Summary: Persistent static properties can be initialized by any thread, so this
is a benign race.

Reviewed By: @mclarkelauer

Differential Revision: D1413405
Use slightly smarter entry states for DV-init entry points

Summary: bsimmers noticed that we don't assert that the locals being
initialized in a DV-init are Uninit.  Easy enough.

Reviewed By: @bertmaher

Differential Revision: D1376676
Check if there's possibly a magic getter in thisPropAsCell

Reviewed By: @bertmaher

Differential Revision: D1375422
First version of the formatter

Summary: We need a code formatter for serveral reasons:
1) Nice to have for the IDE (and vim/emacs)
2) Must have to write non-trivial refactoring tools
3) Would be nice to have before commit (not ready for that)

A while back, I tried to write a pretty-printer based on an AST.
I then tried to extend the tree with textual elements
(comments, newlines etc ...) and make the algorithm take them into account.

It was an epic failure. The textual elements did not "fit" well in the tree,
they were arbitrarily added in places that didn't always make sense.

Because of that, the code was difficult to follow. What it boils down
to is that the textual elements should be part of the logic while formatting.
An Ast is a poor representation because it either ignores textual elements or
includes them in a very "ad-hoc" fashion (attaches them to tokens).

So I tried a radically different approach: the formatter is structured like a
recusive descent parser. Because the token stream includes textual elements,
we have a lot more context (the state of the parser) to decide what to do with
them.

The output of the parser is not a tree, it uses a mini-DSL describing
what the output should look like (e.g. [newline; last_token; semi_colon]).

This first version is not meant to be perfect. I tried it on our codebase and
glossed over the result. I did check the following though:
-) All of www is formatted without errors
-) The formatter is idempotent
-) The result of the formatter always parses

I kept the option --debug (works on a directory) to carry on running these
tests while the code evolves.

However, I did not include a list of unit tests, because I think its going to
be really tedious to maintain. I didn't try to make the formatter work on files
that containt parsing errors for similar reasons.

What I would like to do instead is to plug the formatter into the IDE to:
  -) Log when the formatter failed because of a syntax error
  -) Log when the user edited the result of a formatted region.
     This consists in two steps, first, look if the comments are the same,
     then look if the trees are the same, if they both are: the user was
     unhappy with the formatting.

Once we have that data, we will know what kind of parsing errors we should try
to recover from and how often users are unhappy with the result of the
formatter.

It will then be the right time to adapt the code so that it recovers from
parsing errors and adjust the output to look like what most users want.
If this approach works, we might be able to systematically apply the formatter
before committing.

If you are interested in plugging the formatter into a tool:
cat the_buffer | hh_format --from absolute_char_pos_begins --to where_it_ends

Reviewed By: @jwatzman

Differential Revision: D1406466
Add an assert that class is not nullptr

Summary: Eletuchy asked for it on other diff but I missed it.

Reviewed By: @elgenie

Differential Revision: D1410525
Fix a race where closure classes can be used before they are defined

Summary: See the comments in the code.

There is a more general issue here, and the ideal solution is probably to load
all the persistent classes out of the repo before we start running any
requests.  @jasone's change to attempt that was causing a performance regression,
so we'd have to figure out why if we want to do things that way.

Reviewed By: @markw65

Differential Revision: D1414912