Replace boost::iterator_range with folly::Range

Summary: We use folly::Range in the JIT, might as well be consistent.

Reviewed By: @swtaarrs

Differential Revision: D1747315

Signature: t1:1747315:1418899046:bbee650951b4574404b54072a061a45b5fac5186
Don't allocate PlainFile instances on the stack.

Summary: All ResourceDatas must be smart-allocated.

Reviewed By: @jdelong, @​bnell

Differential Revision: D1753418
Fix a bug in refcount-opts for InterpOneCF

Summary: It would double consume the things the InterpOneCF was going to do,
because it both used local_effects on it and a special case to consume
everything.

Reviewed By: @swtaarrs

Differential Revision: D1732324

Signature: t1:1732324:1418254150:7d3e2613b1052a32afb9f7206ec62453c5b9b43a
Check surprise flags on conditional backward jumps and *IterNexts

Summary: The interpreter does, but the jit doesn't.

Reviewed By: @markw65

Differential Revision: D1726231
Various fixes for OSS upstream sync

Summary: Fix build on Linux (on some platforms ocamlopt exists but not
ocamlc.opt).

Reviewed By: @bhosmer

Differential Revision: D1707929

Signature: t1:1707929:1417455110:18f7cbfb08c376ca3b59cabf4ac4e4a28002e866
Remove the Essential flag in favor of a switch statement

Summary: The Essential flag and IRInstruction::isEssential are DCE-specific
pieces of information, so this diff moves that information where it belongs.

Reviewed By: @jdelong

Differential Revision: D1752612
Move SideExitJcc conversion optimizations to vasm

Summary: This enables us to get rid of a bunch of SideExitJmp* IR
instructions, and moves us closer to being able to run jump opts
whenever we want.

Reviewed By: @edwinsmith, @jdelong

Differential Revision: D1741308
Remove align-16 attribute from ObjectData

Summary: Less coupling between the allocator and ObjectData. This constraint was
added so the jit could use movdqa to load and store TypedValues into
XMM registers, however we switched to movdqu a while ago. We don't have
evidence that using movdqu on an aligned address is any slower than
movdqa.

Reviewed By: @jdelong

Differential Revision: D1756285

Signature: t1:1756285:1419366514:035de81134fcd8cd10468b8f2dd9cafcd3eb1545
Implement Phar::running()

Summary: Closes https://github.com/facebook/hhvm/pull/4353

Reviewed By: @mxw

Differential Revision: D1709234

Signature: t1:1709234:1419550599:446e79b4a8e94a2390f4a7fe05b668eb4e442349

Pulled By: @sgolemon
RequestInitDocument 404 friendly reminder

Summary: 404  don't friendly reminder when RequestInitDocument   file don't exsists,we can't quickly positioning problem,so modify this function friendly reminder.
Closes https://github.com/facebook/hhvm/pull/4494

Reviewed By: @sgolemon

Differential Revision: D1753403

Signature: t1:1753403:1419556980:e34cd738458fe8ae92773e468cf1b48bb636382d
look in /usr/lib64 in FindGLIB.cmake

Summary: glib won't be found on fedora/centos without it.
Closes https://github.com/facebook/hhvm/pull/4522

Reviewed By: @sgolemon

Differential Revision: D1757717

Signature: t1:1757717:1419556976:9f53a117ef8d625abd48f3358fbff25dd9f78ca8
Implement Memcached::quit

Summary: Closes #4455
Closes https://github.com/facebook/hhvm/pull/4473

Reviewed By: @sgolemon

Differential Revision: D1743479

Signature: t1:1743479:1419557100:f12b5a03590b672bdccf4f19196bd4ca24eca321
Fixes issue with gdb segfaulting when reading debug symbols

Summary: Changing the gcc debug optimization level to -gO (enables some optimizations
that do not interfere with debugging). gdb no longer segfaults.
Closes https://github.com/facebook/hhvm/pull/4450

Reviewed By: @sgolemon

Differential Revision: D1742603

Signature: t1:1742603:1419577719:b486deec56efeb9650a71dd55a2b82a95c1aa25f
typechecker: include more UserAttribute functions in reflection hhi

Summary: - added getAttributes, getAttributeRecursive, getAttributesRecursive to ReflectionClass
 - added getAttributes to ReflectionFunctionAbstract
 - added getAttributeRecursive, getAttributesRecursive to ReflectionMethod
 - included a few more return types for ReflectionFunctionAbstract

Reviewed By: @int3

Differential Revision: D1754642

Signature: t1:1754642:1419292410:9ae87bb7950305a4404be3a13068f0bd6b2cdcdc
Have dfind use the same set / maps as the rest of the code

Summary: This avoids having to convert a DfindEnv.SSet into a
Utils.SSet by copying its members.

Reviewed By: @elgenie

Differential Revision: D1754873

Signature: t1:1754873:1419639676:148ca8db979eebfae35475237253167636e6946c
Don't have an optional param that's an option type

Summary: OCaml implements optional parameters as option types, so the
additional layer of option-ing is unnecessary.

Reviewed By: @elgenie

Differential Revision: D1758445

Signature: t1:1758445:1419723236:52b99d34e318be0b127b280cb82d01f934c30f4c
Improve fatal exception handling

Summary: Currently, when the server fails to generate a response, it
doesn't close the socket, leaving the client waiting indefinitely on the
open socket. This creates a poor user experience; some people wait for
many minutes (or retry the same command multiple times) before they give
up.

This diff ensures that we close the socket, as well as providing a
helpful suggestion (`hh_restart`).

Reviewed By: @elgenie

Differential Revision: D1758513

Signature: t1:1758513:1419719643:67136011c1621cddc36a39736ca3fd72f313ca0b
Remove the 16-byte alignment requirement from ResourceData

Summary: This was leftover from when Resources were represented using
ObjectData.

Reviewed By: @jdelong

Differential Revision: D1757694

Signature: t1:1757694:1419726294:f7fcff846673213ff11749024d2d25e619956bd9
Parameterize rds in helper functions.

Summary: plumb the rds base register down into helpers, instead of assuming
it's always rVmTl. This centralizes the decision of how to access RDS.

Reviewed By: @jdelong

Differential Revision: D1758651
Fix realpath lookup

Summary: Actually use the realpath to load the file

Reviewed By: @jdelong

Differential Revision: D1758587

Signature: t1:1758587:1419725692:4a5b40338b3f78fea038055149ee0d943f3b4707