Update folly
Fix libevent keepalive memery leak

Closes #997
Rename the magic "__resource" class to "resource"

www engineers would like to be able to provide the type for code which
takes a resource as input. This simple change is a first step in the right direction.

In the future, we might want to provide a way to specific the exact type of resource
(e.g. PlainFile vs CurlHandle).

Differential Revision: D873115
fix test paths and import extra files to bad

@WizKid has been doing a few diffs on HHVM recently and he noticed that the path of the errors didn't match zend. This is totally right and I was being dumb trying to emulate the old perl script for our paths. Instead we should just match %s.

I also noticed you can't just run the bad tests from their directory since sometimes they need an `.inc` file. We should just duplicate those files in there so you can run the bad tests directly.

Differential Revision: D943288
inline vector/pair get and vector set

Define new OpCodes to allow code generation for vector style get and set

Differential Revision: D905624
Some cleanup on HPHP::CstrBuffer

Don't use DECLARE_BOOST_TYPES (use make_shared where
appropriate).  Delete the broken (double-free) default copy
constructor and copy assignment operator.  Also document some things
because a few points are more subtle than they seemed (unlike
StringBuffer, most functions have a precondition that the buffer is
valid, and the filename constructor does not report errors).

Differential Revision: D931752
Test a few paths through FileCache

Start testing FileCache

Differential Revision: D944350
Implement StringData::initAttach in terms of initCopy

This seems reasonable.

Differential Revision: D938745
Remove try/catch in conv{Obj,Res}ToStrHelper

We have a catch trace that does a SpillStack for both of
these helpers.  Incidentally, zend raises a fatal if you try to throw
in this situation.

Differential Revision: D944079
Fix region_tracelet test

The tracelet region selector was relaxing a guard that the normal
translator wasn't, exposing a bug in the register allocator: when a load
instruction has a label we care about its type, so we can't assign it to an xmm
register. We really shouldn't be guarding on this load at all, but that can be
fixed in a separate diff.

Differential Revision: D944937
Temporarily remove Iterable's function declarations

D923036 added these but we're not quite ready. Take them out for now.

Differential Revision: D944660
make simplexml xpath return original objects

Currently, xpath just creates new elements. This means that any
modification done to the return object will not change its original
parent.

xpath can also traverse -up- the hierarchical node tree, so we cannot
just recursively go through children to find a matching node. this is
why an additional m_root was introduced, to keep track of the root node
of the current tree.

Closes #986

Differential Revision: D943404
adjust ArrayIterator internals for zend parity

HHVM's current implementation promotes internal state to possible
subclasses.

This is meant as preparation to support RegexIterator in a separate
commit, because the Zend tests rely heavily on the internal var-dump
representation of ArrayIterator.

Closes #989

Differential Revision: D943461
g++-4.8.1

Switch to g++-4.8.1

Differential Revision: D935591
fix namespace bugs in ext_class/ext_reflection

- ext_* functions that call Unit::lookupClass were not correctly
handling denormalized names (ex. \FooNS\Bar), this adds a wrapper for
this pattern and calling it.
- ReflectionClass::subclassOf should be using f_is_subclass_of

Closes #827

Differential Revision: D945363
Fix bugs when multiple threads hit the same breakpoint

The function blockUntilOwn() was not actually blocking threads before letting them into processInterrupt(), which allowed multiple threads hitting breakpoints to process their interrupts and communicate with the client, which is bad.

Also fixed an issue where interrupts processed during an eval would result in erasing the current thread's 'lock' on processing interrupts, resulting in the same issue.

Differential Revision: D945203
Don't leave out AttrPhpLeafFn on account of FCallArray

FCallArray does a stack overflow check as part of its
"mini-prologue", so we can still consider functions that use it leaf
functions.

Differential Revision: D940120
Move fCallArrayHelper to an asm helper stub

fCallArrayhelper smashes its return address, leading to
return branch mispredictions until we return enough times to get back
on track.  Rewrite it as an asm stub so it can make a tail jump and
pop the proper return ip into the ActRec.

Differential Revision: D941930
Disable fread_socket_variation1.php

I've seen it fail on a few completely unrelated diffs

Differential Revision: D945745
Fix clone of SplPriorityQueue

Clone the underlying _SplPriorityQueueHeap object when someone clones a SplPriorityQueue object

Closes #984

Differential Revision: D942743