Spyc is not required in Framework.php

Summary: Accidentally added in D1263642

Reviewed By: @ptarjan

Differential Revision: D1274047
Move m_savedRbp spill from FPushFunc*/SpillFrame to FCall/Call

Summary: Make m_savedRbp spill consistent with m_savedRip/m_soff spills and do it
at FCall time rather than FPushFunc* time.

Reviewed By: @jdelong

Differential Revision: D1281465
Make arGetSfp() more sane and rename it to sfp()

Summary: - no good reason to return the same fp if there is no saved fp; return nullptr instead
- rename ActRec::arGetSfp() to ActRec::sfp()
- rename ActRec::m_savedRbp to ActRec::m_sfp and change its type to ActRec*
- kill arSetSfp()
- simplify related code
- make sfp() return nullptr when in resumed async function; m_sfp is currently always nullptr in this case, but this adds ability to reuse this field to return from async functions directly into the caller async function (one of its parents)

Reviewed By: @markw65

Differential Revision: D1281656
Kill async stack overflow checks

Summary: Async stack overflow checks were used to detect unbounded async
recursion. It's too troublesome to maintain this feature and it
currently blocks an attempt to remove active tracking of currently
running async function.

The side effect of this change is that instead of injecting exception at
random place early (possibly in a context that did not expect any
exceptions), we let the request run until it runs out of memory.

Reviewed By: @billf

Differential Revision: D1285431
Update third-party to fix MacOSX
Replace IRTranslator::translate* with macros for nullary opcodes

Summary: This is totally straightforward: macro-generate calls to
HhbcTranslator::translateBlah() that don't have arguments.

Reviewed By: @edwinsmith

Differential Revision: D1285296
Remove legacy webserver from non-X64 Linux

Summary: The legacy webserver hasn't been working on platforms that
aren't X64 Linux. Since it requires custom libevent, remove the
unneeded dependency on that where it's not going to work.

Reviewed By: @fredemmott

Differential Revision: D1286634
Make hack javascript work with js_of_ocaml 2.0

Summary: Looks like js_of_ocaml 2.0 changed two things:
-Added some sort of scoping where we were exporting functions
-Made new MlString break.

Changes:
-Add self. where it was needed to make the stuff we were exporting global. self works in a window or a webworker. Tested that.
-instead of using new MlString, I exported the function that converts js strings to MlStrings and used it where we used to.

ihavenoideawhatimdoing
but it works ok now

Reviewed By: @jwatzman

Differential Revision: D1274773
Add NativeDataInfo Sweep mechanism

Summary: DestructFunc will be called when an
object goes out of scope during a request and
is responsible for all cleanup.

SweepFunc will be called at the end of a
request during sweep.  Sweep functions should
not try to clean up any smart allocated resources
since they may have been already swept.

In practice for NDI Classes this translates into
a `void sweep()` magic method.

If your NDI class DOES NOT have sweep() on it,
then the destructor will be called for either case.
This is fine if you do not have any sweepable resources.

If your NDI class DOES have a dispose() method,
it will be called during sweep, while the destructor
will be called for in-request cleanup.

The normal pattern for this looks like:

  class MyNativeData {
   public:
    MyNativeData() { /* new MyNativeData() */ }
    MyNativeData& operator=(const MyNativeData& other) { /* clone $mnd */ }
    ~MyNativeData() {
      /* unset($mnd); */
      // Clean up sweepable resources (if needed, generally not)

      // Chain through to clean up non-sweepables
      sweep();
    }

    void sweep() {
      /* sweeping */
      // Clean up non-sweepable resources
      fclose(m_fp);
    }
  private:
    // Gets cleaned up with ~MyNativeData() in-request, but is ignored for sweep
    String m_path;

    // Must be manually cleaned up, even during sweep
    FILE *m_fp;
  };

Reviewed By: @edwinsmith

Differential Revision: D1270365
Change AssertType and AssertStk to refine their source type through typeParam

Summary: This diff changes the semantics these instructions to match their
corresponding Check versions.

Reviewed By: @edwinsmith

Differential Revision: D1197194
Disregard presence of init methods for LdClsPropAddrKnown

Summary: I don't think this check is actually necessary; we need to initialize
static props per-request regardless of whether it has any non-scalar
init methods.  My guess is that we only had this check because we had
nothing like `findSProp()` which gave us accessibility and visibility
without actually initializing some static properties.

This, along with deleting the early-success pass in ldClsPropAddr()
where we checked only the class name, was causing us to take the slow
path in many places for static properties on self (and probably in
general).

Now we have an extra bit in Class to fill with all sorts of fun things
(or at least one fun thing).

Reviewed By: @jdelong

Differential Revision: D1286416
Close a memory leak when uploading a file

Summary: When uploading a file, the server uses `strdup` to allocate a string for the temporary file name that is being uploaded conditionally.
However, that string is not always being cleaned up in the loop. This diff frees the string to avoid the memory leak.

Reviewed By: @scannell

Differential Revision: D1285325
Add hash_equals() from PHP 5.6

Summary: Function for comparing strings in constant time to
avoid attacks based on short-circuit comparison.

Reviewed By: @ptarjan

Differential Revision: D1155443
submodule update must be recursive
Add missed 'name' property for ReflectionFunction, resolves #2492

Summary: Closes #2497

Reviewed By: @fredemmott

Differential Revision: D1287050
Fix potential null pointer dereference.

Summary:
Closes #2392
Closes #2489

Reviewed By: @fredemmott

Differential Revision: D1287004
Eliminate hphp-only test runs in repo mode

Summary: Now that hhbbc is probably on for good, we can just run tests with
hhbbc.

Reviewed By: @jdelong

Differential Revision: D1287706
Better error when TC is full

Summary: It now shows the the size and remaining capacity of the block we're
overflowing. I'd like to show which block it is (a, astubs, ...) but that will
require a bunch more refactoring, at which point we should probably just fail
more gracefully.

Reviewed By: @ottoni

Differential Revision: D1287060
Refactor back ends into implementations of BackEnd.

Summary: Mechanically refactor explicit architecture-specific code branches into
implementations of a pure-virtual BackEnd class.  The initial BackEnd
API is intentionally uneven and incomplete; it serves as a foundation
for further refactoring and refinement.

Reviewed By: @jdelong

Differential Revision: D1233038
Allow replacing the file:// wrapper in a script

Summary: PHP5 started supporting this, so let's follow along.

Closes #2477

Reviewed By: @fredemmott

Differential Revision: D1287000