mark test flakey

Summary: I saw it fail returning a newline on the read

Reviewed By: @paulbiss

Differential Revision: D1577555
EZC: clear EG(exception) on return from zend_wrap_func()

Summary: Otherwise, if the exception is caught and then control is returned into
a zend_call_function() call which wrapped the throwing function, then
zend_call_function() will erroneously rethrow the exception, even though
it has already been handled.

https://bugzilla.wikimedia.org/show_bug.cgi?id=71174
Closes https://github.com/facebook/hhvm/pull/3834

Reviewed By: @ptarjan

Differential Revision: D1574411
Punt in ARM codegen for CallBuiltin if it needs stack args

Summary: They're not yet supported. I put the punt here rather than in
cgCallHelper itself because cgCallHelper is sometimes called in places that
can't handle punting.

Reviewed By: @edwinsmith

Differential Revision: D1577753
Refactor the parsing and processing of config options

Summary: The rise from the ashes edition....

D1554807 reverted the refactoring that I did to prepare for the hdf move to ini conversion because, well, I had missed a couple of things and started to break stuff.

Here we go, trying this again. I think we are at equivalent functionality as before this diff, modulo some bug fixes that should be useful and good.

Here is the lowdown:

1. Refactor so we have one goto place for parsing, processing and binding of config options.
2. Fixed a bug where some `-v` overrides were not being respected when the same option was being given in a `.ini` file.
3. Fixed a bug in `IniSetting::Set` where updates were not happening to existing pairs. That was actually a subtle, but big find.
4. Got a little more clever on how we re-parsed ini files for extension constants. Before we were parsing the whole file again, un-overriding any overrides that were given at the command line. Now we just deal with unbounded extension constants.
5. Precendence order for config options should be right. `ini file -> hdf file -> ini cli settings -> hdf cli settings -> Tiers -> ini cli settings re-check -> hdf cli settings re-check -> Load and Bind`
6. Reflect reality when it comes to the actual value of a `RuntimeOption` compared to the value exposed to a call to `ini_get()` for that `RuntimeOption`.
7. In the short term, during the migration, hdf always wins over ini.

Reviewed By: @markw65

Differential Revision: D1555790
Change Vreg to use PhysReg numbering, hoist vasm out of x64::

Reviewed By: @jasone

Differential Revision: D1577736
Turn on refcount-opts with loops.

Summary: D1550496 seemed to be the last of the issues.

Reviewed By: @ottoni

Differential Revision: D1577195
Move genCodeImpl from code-gen.cpp to back-end-arm.cpp

Summary: It is only used for ARM, and I need to customize it even
more to get ready for arm using vasm.

Reviewed By: @jasone

Differential Revision: D1577792
Decouple llvm from vasm::finish

Summary: This uncouples the vasm->x64 final code generation passes from
LLVM generation, which is a necessary step so we can generate
target-specific vasm in CodeGenerator, in cases where its more
convenient than being forced to have a target-specific lowering
pass.

ARM changes will add a finishARM() function and may require more
refactoring, for example we could factor out the target-agnostic
vasm optimizations, like vasm-dead and vasm-jumps.

Reviewed By: @jasone

Differential Revision: D1577810
Support custom stream wrappers in XMLReader::open()

Summary: This is similar to the treatment that was applied to a few other places in
842d6fb7dcd6d: manually create an IO object and use that to create the
xmlTextReader, rather than just calling xmlReaderForFile. This fixes web
importing of pages in MediaWiki.

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

Reviewed By: @ptarjan

Differential Revision: D1576426

Pulled By: @swtaarrs
Skip translation of region blocks that turn out to be unreachable

Summary: Region formers may create regions that contain blocks that the IR can
later prove they won't be reached. When this happens, the region
translator will try to call IRBuilder::startBlock() on a block for
which no FrameState is saved.  This isn't supported: IRBuilder assumes
that, before emitting code to a block, at least one of the
predecessors has been finished.  This diff changes the region
translator to skip blocks that turn out to be unreachable, and it
strengthens the region checker to check both the assumption above and
that a region is in topological order unless loops are enabled.

Reviewed By: @alexmalyshev

Differential Revision: D1578127
Remove control flow related code

Summary: Its been dead since I turned off Option::ControlFlow

Reviewed By: @jdelong

Differential Revision: D1578124
jit/containers.h shouldn't pull in smart-containers.h

Summary: We're using std containers right now, so there's no reason to pull in
the smart ones.

Reviewed By: @edwinsmith

Differential Revision: D1579289
Move GuardConstraints to its own header

Summary: There's no reason for everyone to include it via ir.h

Reviewed By: @ottoni

Differential Revision: D1579426
Move StackValueInfo methods to simplifier.cpp

Summary: This lets us forward declare SSATmp and IRInstruction in simplifier.h
Since simplifier.cpp is the only user of StackValueInfo methods this
shouldn't change perf.

Reviewed By: @edwinsmith

Differential Revision: D1579548
Move our punting mechanisms into a separate header

Summary: Not needed in ir.h, so lets not include them all over them place.

Highly doubt moving the exception constructors will cause a perf
regression.

Reviewed By: @edwinsmith

Differential Revision: D1579698
Remove side-exiting arcs from TransCFG

Summary: Since D1052990 switched slow side exits from doing REQ_INTERP to do
actual InterpOnes, arcs due to slow side exits started to be inserted
in the TransCFG.  The hottrace region selector had logic to avoid
following these arcs when forming a region, and wholecfg would need
something similar.  Instead of replicating that logic in wholecfg,
this diff prevents the insertion of such arcs in TransCFG altogether.

This issue was caught by the region checker running wholecfg in perflab.

Reviewed By: @bertmaher

Differential Revision: D1578852
Add {setup,teardown}Request methods to RequestHandler

Summary: Should be useful for enforcing that MemoryManager is only used within
request contexts, and also maybe for other purposes.

Reviewed By: @markw65

Differential Revision: D1575448
DynamicYield: no more prepareXXX functions

Summary: yup

Reviewed By: @jano

Differential Revision: D1580123
Add --list-tests option

Summary: This will be used by the new test-runner-runner @ fb.

Reviewed By: @JoelMarcey

Differential Revision: D1579422
Fixup origins during vasm immediate folding

Summary: I noticed we were missing seemingly random vasm instructions in
our assembly dumps. I tracked it down to the immediate folding, which
would replace the old Vinstr containing a valid IRInstruction origin
with a new Vinstr with no origin set.

Reviewed By: @edwinsmith

Differential Revision: D1579895