HHIR pass to do dead store elimination on frame locals

Summary: Does a liveness analysis and removes dead StLoc and StLocNT
instructions.  Also determines if stores are partially dead and tries to move
them to make them not dead.

Reviewed By: @swtaarrs

Differential Revision: D1639214
Remove an unused ir opcode, rename LdProp to LdContField

Reviewed By: @swtaarrs

Differential Revision: D1640044
Remove the various raw load/store instructions

Summary: Not very widely used now.  They also often don't really seem to save
significantly on boilerplate vs writing a small cg function these days (maybe
it originally did).  Also the func numparams thing was pretty bizarre to have
in these opcode (and was wrong in both arm and the emitStRaw implementation).

Reviewed By: @swtaarrs

Differential Revision: D1640078
Fix a bug in simpleCollectionOp that was throwing away array types

Summary: Only call ldRefReturn if we're going to do a LdRef on it.

Reviewed By: @swtaarrs

Differential Revision: D1640090

Signature: t1:1640090:1414504709:9590e3f0ca974b326c0f86b10e7057c88b085254
Reflow some paragraphs in type-system.{h,cpp}

Summary: @swtaarrs and@mxw made me change my fill column to 80 and now
shorter ones look weird.

Reviewed By: @edwinsmith

Differential Revision: D1641865

Signature: t1:1641865:1414449709:9fe81ba58bae065cef4fab0c71e32b808174141d
FrameState should use canonical values when refining locals.

Summary: If we build IR as follows:

B0:
  t1:Arr = LdLoc<Arr, 0> t0:FramePtr
  t2:Arr = AssertType<Cell> t1:Arr

B1:
  t3:Arr=PackedKind = AssertType<Arr=PackedKind> t2:Arr

then IRBuilder::reoptimize will turn it into:

B0:
  t1:Arr = LdLoc<Arr, 0> t0:FramePtr
  t2:Arr = Mov t1:Arr

B1:
  t3:Arr=PackedKind = AssertType<Arr=PackedKind> t1:Arr

which is a problem for fixed-point FrameState as it would say that the
value of local 0 at the start of B1 is t2, but reoptimize will replace
all uses of t2 with t1 as it's running copyProp on each
instruction. This gets us in trouble in B1 because FrameState will not
realize that the new value of the local is t3.

To fix this, just make FrameState use canonical values when walking locals.

Reviewed By: @ottoni

Differential Revision: D1647937

Signature: t1:1647937:1414692383:33fa9ae714c0bd8d378a852961fd9216853f4774
Widen bools before storing them

Summary: The testcase stored an unwidened bool with garbage in
the high 56 bits prior to this fix (and asserted in dbg builds).

Reviewed By: @alexmalyshev

Differential Revision: D1648569

Signature: t1:1648569:1414630806:9622d3981838ad3cf92cc055905f6057e7e9f8cf
Enable re-printing of results without re-building or re-running

Summary: Many times I forget to add the --remarkup flag to print the
results in a phabricator-friendly fashion. This diff adds a way to get
benchy to re-print previous results without re-building or re-running
the benchmarks.

Reviewed By: @jdelong

Differential Revision: D1647396
Add JSON output support to benchy

Summary: This will allow benchy to communicate with other future services more
easily.

Reviewed By: @jdelong

Differential Revision: D1646887

Signature: t1:1646887:1414608128:32c5ca67a0a2215a7c39efdb26126668437903d6
Add lower-is-better flag when comparing benchmark results

Summary: For some benchmarks, lower scores represent speedups.
significance.py assumed the opposite. This diff adds an option to
significance.py that signals whether or not a particular change is
better or worse.

Reviewed By: @jdelong

Differential Revision: D1626744
Add null checks on driver PDO statement

Summary: php5 makes all methods do nothing if there is no backing driver PDO statement
Closes https://github.com/facebook/hhvm/pull/4064

Reviewed By: @paulbiss

Differential Revision: D1640296

Signature: t1:1640296:1414598532:2f284f59c76fa94b926251aabe2d27cd0a7de470

Pulled By: @ptarjan
Refactor SweepNode and family to make room for header kind

Summary: Decoupled NativeData's use of SweepNode from MemoryManager
since they are independent data structures. Renamed SweepNode
to BigNode reflecting its only use. Defined Big/Small/FreeNode
together so its easy to see their layouts together.

down in memory-manager.cpp, define union MallocNode that combines
BigNode and SmallNode in a cleaner way, and doesn't expose the
unioning outside the memory manager module.

sizeof SmallNode grew to 16 bytes, this guarantees all smart_malloc
blocks are 16-byte aligned, but might cause some allocations to
grow into the next size class.

Reviewed By: @jdelong

Differential Revision: D1649339
Move ArrayData::m_kind to offset 11

Summary: Rearranging the header so all object types have a 1-byte field
at offset 11, adjacent to m_count. in packed-array.cpp and
mixed-array.cpp, I refactored carefully to keep header initialization
all together so it was easier to inspect the code.

Reviewed By: @jdelong

Differential Revision: D1646259
Switch server tests to use .ini

Reviewed By: @paulbiss

Differential Revision: D1649792

Signature: t1:1649792:1414694605:e0d2bc89d33f19f5e612e5bc5a5a9715c55deaaa
Disallow mixed enums

Summary: If you have a mixed enum with a falsey value, then a `switch`
on that enum can lead to very unexpected results, since `switch` uses
`==` equality. This form of enum is of questionable use anyways, so
let's just disallow it.

Reviewed By: @elgenie

Differential Revision: D1646639
Add flag STREAM_URL_STAT_QUIET when calling urlStat.

Summary: Add flag STREAM_URL_STAT_QUIET when calling UserFile::urlStat from UserFile::stat like what it does in official implementation.

Fix vfsstream's is_file and is_dir test cases.
Closes https://github.com/facebook/hhvm/pull/4094

Reviewed By: @ptarjan

Differential Revision: D1646061

Signature: t1:1646061:1414717749:9f491a9b7bbb36d47ef7ac8c95fc48d0787500c1
Preprocessor gcc48+ performance regressions

Summary: facebook/hhvm#3808

Closes https://github.com/facebook/hhvm/pull/4065

Reviewed By: @ptarjan

Differential Revision: D1640295

Signature: t1:1640295:1414718541:0b78bc399f779276ee2130ed65af666b5edab72b
Stack overflow in KernelVersion parser

Summary: Caught by ASAN

Reviewed By: @ottoni

Differential Revision: D1651562

Signature: t1:1651562:1414731602:574aa61ef4b4538f26299f6694aff3c5e3bc317d
fix sandbox access logs

Summary: I broke this by moving the logging into teardownRequest without preserving sourceRootInfo.  Make this an Optional (eg: delayed construction) member and clear it after logging is complete.

Reviewed By: @markw65

Differential Revision: D1650759
Skip arbitrary number of 0xff padding bytes in JPEG

Summary: There's no reason to limit the number of 0xff padding bytes while trying
to parse JPEG. Let's remove the arbitrary limit of 26 and keep reading
the file and skipping them.

Reviewed By: @billf

Differential Revision: D1650960