Make clearstatcache() signature Zend compatible

clearstatcache() does nothing, but the function signature is not
the same as Zend so unnecessary warnings are raised.

Closes #1115
Closes #1117

Reviewed By: @JoelMarcey

Differential Revision: D991348

Pulled By: @scannell
Implement USE_INCLUDE_PATH for file functions

Implement File::USE_INCLUDE_PATH for functions eg:
file_get_contents, fopen, file_exists etc.
Closes issue #837 and move tests to good folder, copy dependency file
from Zend PHP for tests

Closes #837
Closes #1110

Reviewed By: @ptarjan

Differential Revision: D989689

Pulled By: @scannell
Get X64 out of emitGuardChecks & transitive dependencies

This was a spurious coupling; the only reason the assembler object was
used was to emit stats-counter increments. I agnostified the interface
to that as well, which turned out to be pretty easy. I'll put a branch
inside emitInc for ARM support.

I discovered that the cc parameter (which was another x64 coupling) was
unused, so I deleted it.

Reviewed By: @edwinsmith

Differential Revision: D991443
Update NEWS for Tabasco release

Reviewed By: @jdelong

Differential Revision: D990847
Move runtime helpers out of codegen

This is pure code movement.  After this the only runtime
functions left in code-gen are the ccmp_* family, which I haven't
figured out how I want to deal with yet.

Some of these can probably be cleaned up/killed (you'll notice a few
TODOs that have probably been around for a long time) but I want to
separate that from the code motion for easier review.

Reviewed By: @edwinsmith

Differential Revision: D991360
Make SrcDB more compact

Add a GrowableVectorWrapper to make GrowableVector more
compatible with vector, and use it in SrcRec.
Use a CompactSizedPtr to hold the tca and tag for IncomingBranch.

Reviewed By: @edwinsmith

Differential Revision: D991310
Remove use of IRTrace::isMain() in layoutBlocks()

Mark all exit blocks Unlikely, then only use likely/unlikely hints
in layoutBlocks().

Reviewed By: @jdelong

Differential Revision: D991320
Implement SORT_{NATURAL,FLAG_CASE}

We had code for natural sorting, but we never set up the SORT_NATURAL
or SORT_FLAG_CASE PHP constants.

Closes #1090

Reviewed By: @ptarjan

Differential Revision: D986738
Fix a race in retranslate

Multiple threads can enter retranslate for a tracelet
simultaneously. This is not normally an issue, because only one
will get the write lease. But if we force blocking on the write
lease, they will all wait, and then generate potentially identical
translations (possibly pushing us over the 12 translation limit).

This adds an atomic flag to the SrcDB so that only one of the
threads will make a translation, and the others will re-enter
the head of the tracelet chain (and either find the new translation
or again hit the retranslate service request).

Reviewed By: @jdelong

Differential Revision: D991611
CStrRef sucks

This is the first step of a larger campaign of eliminating goofy types from our codebase. Typedef-ing a reference is unrecommended because references are not first class types and therefore things like construction and copying may do unexpected things. In fact search this diff for 'reinterpret_cast' to see some very odd stuff.

Destroy!

Reviewed By: @jdelong

Differential Revision: D983915
Fix cleanup code for s_directory_data in ext_file.cpp.

When an Xbox thread gets destroyed, the destructor for s_directory_data destroyes the Resource in defaultDirectory, which decreases the refcount to the Directory object, which is a sweepable and is reclaimed somewhere else. This leads to double trouble and caused flib/utils/thread/__tests__/ConcurrentThreadsTestCase.php to fail. (Sadly the test case got disabled, so contbuild did not pick this up.) To prevent the double deallocation, I've added a handler for request completion that detaches the Directory value from defaultDirectory. This seems to solve the problem.

Reviewed By: @markw65

Differential Revision: D991808
Recover from fatal errors that occur while generating back trace information after a VM crash.

When the VM crashes the crash reporter tries to generate a back trace for the error report. If the stack trace contains a call to a function with an argument that is an object that cannot be converted to a string, the routine for generating the stack trace will fail, which is not optimal. This difference adds a try-catch to that recovers from fatal errors that occur during back trace generation.

Adding this try-catch modifies the behavior of public PHP function debug_print_backtrace in an observable manner. Arguably it is a desirable improvement, but is a potentially breaking change.

Reviewed By: @markw65

Differential Revision: D992293
Adding VariantTraits

Adding VariantTraits and changing CacheClientSerializer to be parametrized by Variant.

Opensource commit message:
Moving VariantController into a separate file.

Reviewed By: zhuohuang

Differential Revision: D990915
Add toVector() and friends to LazyIterableView and LazyKeyedIterableView

Materialization methods were recently added to collections. This adds them
to the LazyIterableView and LazyKeyedIterableView as well so that these
methods will work when called on an object returned by lazy().

Reviewed By: @jdelong

Differential Revision: D990588
Implement restore_include_path()

Implement restore_include_path() and make the default include
path consistent with Zend

Closes #1105

Reviewed By: @ptarjan

Differential Revision: D989566

Pulled By: @scannell
Remove PolicyArray

It was a good experiment in modularity, and I think we can do something
similar (but different) in HphpArray.

Reviewed By: @andralex

Differential Revision: D992945
Data stream wrapped based on RFC 2397 and Zend

Implemented data stream wrapper, based on RFC 2397 and Zend
implementation.

While the patch can read the metadata of a stream, it does not save it
anywhere, and thus will not pass zend's stream meta data tests for RFC
2397.

Closes #1051
Closes #1112

Reviewed By: @ptarjan

Differential Revision: D990460

Pulled By: @scannell
support objects in zend compat layer (take 2)

Now that mark found the issue with HPHPc not having `ZendCompatMode` classes removed this should be safe

Reviewed By: @markw65

Differential Revision: D989365
import oauth extension (take 3)

Now that mark found the issue with HPHPc not having ZendCompatMode classes removed this should be safe

Reviewed By: @markw65

Differential Revision: D989366