Remove Pos.file.

Summary: Explicit is better than implicit!

Reviewed By: @jwatzman

Differential Revision: D1677963

Signature: t1:1677963:1415907499:8acc4d937267fb9e4caf573ae541b2d22c5d5fe4
Use a non-worker thread for the job reaper

Summary: Reaping timed-out jobs used to use a worker thread, which causes the
treadmill to back up.  This makes the reaper a dedicated thread, so it doesn't
hold up the treadmill.

Reviewed By: @jdelong

Differential Revision: D1660353
Use musttail to enforce tail call.

Summary: From LLVM manual: "The musttail marker means that the call must be tail call optimized in order for the program to be correct". We should use it when we need tail call to happen.

Reviewed By: @jasone

Differential Revision: D1682217

Signature: t1:1682217:1415995606:133db7fff792a61fb7c199febbe4e31eea8d1ea3
Copy-and-clear instead of detaching JSON StringBuffer

Summary: detach transfers ownership of the buffer to a String; but during JSON
decoding we always start with a 127-character buffer, so short strings end up
wasting a bunch of memory.  Copying gives us tightly allocated strings, and
clear just resets the internal length to zero, so we don't have to allocate a
new buffer.

Reviewed By: @markw65

Differential Revision: D1681172

Signature: t1:1681172:1415990188:2851b963a32ef54861557000bd229e3041ef9e05
Simplify how `hh_client` finds the root

Summary: This used to do very different things depending on if you
specified a root to `hh_client` or not, including different error
messages. I think it makes sense for it to climb up the directory
hierarchy same as if you don't specify a root (see github task), and it
also makes the code cleaner.

Fixes https://github.com/facebook/hhvm/issues/3643

Reviewed By: @int3

Differential Revision: D1682933

Signature: t1:1682933:1416006291:3bf378e5a19598d587e35371f909e064067326dd
unparse dynamic new

Summary: We currently parse new as id*exprlist*exprlist so we can represent
dynamic new only as new *Unknown*. This diff parses it as expr * expr list * expr list
and converts it back into an id during naming

Reviewed By: @paroski

Differential Revision: D1674986

Signature: t1:1674986:1416011812:ddac5e57292e9f7f135d5d502818b0d64cd30eb4
introduce a no collections mode

Summary: Most of the transformations of h2tp that result in code that is
very different from the input has to do with collections. This introduces a mode to
disable all collection related transformations
Fixes https://github.com/facebook/hhvm/issues/4225

Reviewed By: @jwatzman

Differential Revision: D1677973

Signature: t1:1677973:1416015234:220f58d20b5cbe854853174906a5923555766c0a
automatically attempt to convert all hack test inputs

Summary: check files
Fixes https://github.com/facebook/hhvm/issues/4218

Reviewed By: @jwatzman

Differential Revision: D1682211

Signature: t1:1682211:1415999283:9b1db0f1d25a170335453f1917500d00332a500c
support for enums

Summary: This converts first class enums. We convert it into a final class with a private constructor
and use a trait to implement all the enum methods.
Fixes https://github.com/facebook/hhvm/issues/4221

Reviewed By: @jwatzman

Differential Revision: D1682688

Signature: t1:1682688:1416003415:c4522a703537d9b3c1603808a08e8a98749d6660
Remove duplicate stack size code

Summary: We already had code forcing the stack size to 8M,
but recently added more code to force it to 8 in normal mode,
and 16 in ASAN mode.

In addition, the old code always ran, even if the main thread wasn't
going to do much real work (eg when running as a server).

Drop the old code in favor of the new.

Reviewed By: @edwinsmith

Differential Revision: D1683119

Signature: t1:1683119:1416055986:e7fecf294752fc6f2f17478f613919f46929eea2
Fix a bug in Index::lookup_constraint

Reviewed By: @paroski

Differential Revision: D1680897
Allow non-static expressions in function parameter defaults

Summary: This is primarily for HNI expressions such as the following
in datetime:

  function date(string $format, int $now = TimeStamp::Current());

HHVM compiles default arguments to Bytecode and jumps to the correct
location in the function for initialization anyway, so there's no real
need to limit the default to static expressions apart from PHP's
language design.

Closes #2886

Reviewed By: @paulbiss

Differential Revision: D1682957

Signature: t1:1682957:1416007027:42343f4baf80906e22308e1e1e91bea7027967d1
Fix Symfony's it's not safe to rely on system timezone setting errors

Summary: Symfony requires a date.timezone setting in the standard php.ini
We can't do that so this modification adds a call to date_default_timezone_set
Closes https://github.com/facebook/hhvm/pull/4251

Reviewed By: @fredemmott

Differential Revision: D1683075

Signature: t1:1683075:1416091145:b2eca865d5811e41aa0669519f59ac8dc5188341
Remove mostly-unused PreClass* field from PreClass::{Prop,Const}

Summary: It was only being used in their pretty-print methods, but those are only
called from PreClass::prettyPrint, so we can just pass the current PreClass*
over to them instead of having to store it.

Reviewed By: @bertmaher

Differential Revision: D1681944

Signature: t1:1681944:1415999560:911757507ea045d3c4e9cf0269aa9221b1f9ed8d
Fix parsing of binary literals denoted with a capital '0B'

Summary: The binary prefix should be case-insensitive,
but the scalar expression parser was only checking lower-case.

Closes #4253

Reviewed By: @nigelchanyk

Differential Revision: D1684154

Signature: t1:1684154:1416146734:6f4954beaa2e96c78567b37c658f72d59894c73b
Inline JSON decoding fast paths assuming most things are UTF8

Summary: A couple of decoding routines have fast paths in the case that the
character is < 0x80; this restructures the code a bit so that fast path can be
inlined, and tail-calls the more complex decoding.

Reviewed By: @jdelong

Differential Revision: D1681669

Signature: t1:1681669:1416158136:a3dc22d3ed5234566c2d9a0b394c0a71d2291c4d
Convert SOAP to HNI

Summary: fixes #3949

Reviewed By: @ptarjan

Differential Revision: D1615521
Record the start time for every request

Summary: We recently refactored the code to record an access log
even for requests that failed early (ie didn't get processed by
the RequestHandler, or which the RequestHandler decided to abort
early).

The requests that previously didn't get processed at all, also didn't
get their start times set. This fixes that.

Also, the previous change moved the point at which we recorded the start
time (when we did record it) past some early setup - which may have
artificially reduced the time recorded in the logs. This puts it back
before we start doing any work for the request.

Reviewed By: @​marccelani

Differential Revision: D1684356
Fix a few issues that showed up in an hg build

Summary: "fbconfig -r hphp && fbmake dbg" in a mercurial checkout
now runs without any warnings

Reviewed By: @alexmalyshev

Differential Revision: D1684337

Signature: t1:1684337:1416217066:2f77224da83c0b654f82dfc29534affca7a35b02
Enable ASAN for smart allocator

Summary: Route all smart allocator allocations and frees to malloc for ASAN builds

Reviewed By: @edwinsmith

Differential Revision: D1657895

Signature: t1:1657895:1415905951:b356d1944253bc341fe0ac62751e4f8ba6a7d42a