Fix incorrect ownerDocument after DOMDocument::createElement

Closes #1551

Fixed while investigating an ASAN failure when running PHPUnit's suite.

Reviewed By: @ptarjan

Differential Revision: D1144627
Fix memory management for xinclude nodes

Previously: ==580== ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x604400212103

We were recursively freeing the node, including the attribute nodes - however, libxml2 doesn't malloc them separately - all we needed to do was unlink and free the root.

This fixes a fatal in PHPUnit's test suite.

Reviewed By: @ptarjan

Differential Revision: D1144722
Fix spl_autoload_unregister($unused_but_valid_handler)

If a valid handler is passed in, but wasn't registered, we'd just remove the last one:

- find_if() would return ::end()
- erase() treats that to mean erase the last one

Behavior in the new test was:
- correctly remove 'b'
- incorrectly remove 'a' when asked to remove 'b' again
- segfault when asked to remove 'b' a third time

Reviewed By: @ptarjan

Differential Revision: D1145531
Fix scoping for evaling default ReflectionParameter values

Closes #1449
Closes #1652

Reviewed By: @ptarjan

Differential Revision: D1141045
Prevent garbage on DNS_TXT records

Bug #64458 fixed an off by one error when decoding TXT records
that resulted with garbage at the end of the string returned.

Reviewed By: @scannell

Differential Revision: D1146140
Define missing IMAGETYPE_ constants

Defined IMAGETYPE_UNKNOWN and IMAGETYPE_COUNT

Closes #1634
Closes #1638

Reviewed By: @ptarjan

Differential Revision: D1144855

Pulled By: @scannell
Fix Zend strrpos compatibility

Fixes Zend strrpos compatibility and adds test.

Closes #1564
Closes #1632

Reviewed By: @bertmaher

Differential Revision: D1142139

Pulled By: @scannell
Remove dead function: emitContVarEnvHelperCall().

It was never called.

Reviewed By: @ottoni

Differential Revision: D1146574
Implement codegen for Call

After LdLoc went down, this is the next top punt. This forced me to get
the bind-call machinery working, and a bunch of other stuff -- it kind
of snowballed on me. Redispatching from prologues and handling stack
overflow also had to work. We were also forgetting to rewind the
globalData frontier if translation failed, and this change combined with
that to actually blow out globalData in a couple of tests.

Small bonus: deleting a bunch of "JIT::" that used to be "Transl::".

Reviewed By: @edwinsmith

Differential Revision: D1134414
Disable flaky zend test

Reviewed By: @edwinsmith

Differential Revision: D1147082
Support for Intel VTune Amplifier XE

Intel VTune Amplifier XE
(http://software.intel.com/en-us/intel-vtune-amplifier-xe), the
performance analysis tool, supports mapping of performance data from IP
addresses to function names and source file/lines for custom JIT
engines; the engine should provide mapping from generated code to source
using JIT API (http://software.intel.com/en-us/node/458070). This patch
add the reporting to hhvm, allowing to profile PHP code execution and
see both generated assembly and PHP source for hotspots.

The reporting is controlled via Eval.JitUseVtuneAPI runtime option, so
the default behaviour is not affected. If the option is set and hhvm is
profiled by VTune, the information on compiled code is reported via JIT
API and stored in data file which is used during postprocessing and data
visualization.

The patch includes some files from VTune; the are distrubuted under BSD
license.

Closes #1254

Reviewed By: @ottoni

Differential Revision: D1133559

Pulled By: @scannell
SimpleXML rewrite

Update SimpleXML to be compliant with Zend and fix a bunch of
tests.

Closes #1387
Closes #1530

Reviewed By: @ptarjan

Differential Revision: D1135882

Pulled By: @scannell
stop killing the socket until all data is sent

For small responses this was ok, since sending the data didn't take much time. For large requests, they would get truncated without this.

I checked for leaks by printing in the FastCGIConnection constructor and destructor and making sure they match up.

Closes #1631

Reviewed By: @simpkins

Differential Revision: D1147016
Switch Map and Set to use tracked smart allocators

Switches Map and Set to use tracked allocators. Vector uses
smart_realloc which will require a bit more work.

Reviewed By: @edwinsmith

Differential Revision: D1146939
Support for UNIX sockets

Add a new config param, Server.FileSocket. When
Server.FileSocket
is set it will be used inplace of a network socket for the primary
server. This uses a new parameter to ServerOptions, m_useFileSocket,
to toggle between treating the address as a socket path or a network
address.

To initialize a socket connection thrift expects the socket file to not
exist. To support this the 'something nice' retry in startServer will
unlink an existing socket only if fuser claims it is unused.
Server.EvilShutdown enables unlinking the socket regardless of current
users.

Closes #1594

Reviewed By: @ptarjan

Differential Revision: D1135876

Pulled By: @sgolemon
parallel makes
cleanup ext_soap defines

Replaced with inline functions. Defining a global get_node macro is clowntown, and conflicts with parts of boost. These still need to be moved out of the HPHP namespace sometime, but this is an improvement.

Reviewed By: @ptarjan

Differential Revision: D1147196
Always assert when compile_file returns a null unit

We already depend on it being non-null, so failing to parse a file in an
unexpected way, such as a corrupt repo, will cause a segfault.

Reviewed By: @jdelong

Differential Revision: D1145395
HNI conversion helper script

Currently only matches functions.

Since signature mismatches in HNI natives just cause really weird
segfaults, and I keep missing the odd one, a way to make sure the
signatures match would be of use.

Closes #1636

Reviewed By: @jdelong

Differential Revision: D1147812

Pulled By: @scannell
Add pretty printing for FrameState

Useful for debugging, especially once we have inter-bytecode
control flow in the IR.

Reviewed By: @edwinsmith

Differential Revision: D1146746