update with a link to the wiki page around oss frameworks
Fix libevent linking

Closes #1080
Eagerly hash shared variant strings

Right now, we wait until the first request that needs the
hash, and it stores it back to the shared StringData.  This removes a
branch from hashHelper, but it doesn't seem to matter.

Reviewed By: @edwinsmith

Differential Revision: D970437
Remove Hack comment

Removing the Hack comment from the script

Reviewed By: @sgolemon

Differential Revision: D977342
Make sure no decRefs are evaluated during sweeping

We're trying to make sure that destruction/sweeping of extensions is implemented properly. During sweeping there should be no reference decrementing and no smart memory freeing.

Reviewed By: @jdelong

Differential Revision: D932364
Finish refactoring service requests: move code, get Asm out of interface

I moved the top-level "emitServiceReq" functions (which don't output any
code themselves) into service-requests.h so they can be shared by the
ARM backend. They will conditionally call either X64::emitServiceReqWork
or (the to-be-written) ARM::emitServiceReqWork.

Reviewed By: @jdelong

Differential Revision: D977213
Use MakePacked in bytecode.cpp instead of doing it by hand

Smith noticed this could reuse the existing creation
functions.

Reviewed By: @edwinsmith

Differential Revision: D975127
Move new failing zend stream test to bad

This looks to come from D967885.

Reviewed By: julk

Differential Revision: D978088
collections: support converting to boolean

to simplify the migration story from array(), it makes sense
 to be able to write idiomatic code like:

   $x = $foo->getCollection();
   if ($x) { // ... collection not empty }

 As opposed to the current:

   $x = $foo->getCollection();
   if (0 !== count($x)) { // ... collection not empty }

 The methodology here is very similar to what collection::ToArray does
 (including helpers around static_cast and const access).

 Failure due to broken logic www test that
 I've disabled and the zend test disabled by jdelong in {D978088}

Reviewed By: @paroski

Differential Revision: D964614
rename c_SimpleXMLElement::{ToBoolean=>ToBool} to match Collections

for great consistency. Depends on D964614.

  failure due to www test impacted by dependent commit (since fixed)

Reviewed By: @jdelong

Differential Revision: D976094
Fix guard pages for thread stacks

I noticed a couple of issues:
 - the stacksize returned by pthread_attr_getstack includes the
   guard size, so we should adjust both the start and the size
 - if you call pthread_attr_setstack, its your responsibility to
   mprotect the guard region

Reviewed By: @jdelong

Differential Revision: D976923
get_class_vars should autoload

This has been wrong for two years (and I got it wrong originally :/ ).
It also turns out that it returns false instead of fataling if the class
isn't found.

Because PHP, get_class_methods doesn't work this way, in case you were
wondering. It returns NULL on error.

Reviewed By: @ptarjan

Differential Revision: D976416
Make DOMDocument::getElementById actually return DOMElement

We were blindly returning a DOMText object for
DOMDocument::getElementById when it should return a DOMElement.

Reviewed By: @ptarjan

Differential Revision: D967622
Add toVector(), toMap(), toStableMap(), toSet() methods to collections

These methods provide a convenient way to materialize a lazy iterable into
a concrete collection, or to convert from one collection type to another.
Doing "$x->toX()" is equivalent to "new X($x)" (where $x is an Iterable
and 'X' is a collection type), but it's nice to have for the chaining use
case, ex:

  $v = $m->lazy()
         ->map(..)
         ->filter(..)
         ->toVector();

Reviewed By: @elgenie

Differential Revision: D978191
Add XboxServer support for asio events

This allows us to treat XboxTasks as external threads in the ASIO
framework.

We template the ServerTaskEvent class so that it may be used in the
future with other similar server interfaces, e.g. PageletServer.  We
expose XboxTransport for use in ServerTaskEvent.

Storing a Transport * in ServerTaskEvent instead of a Resource

Template; expose the Transport type from the Server

Also parametrize the Transport class

Expose XboxTransport

Reviewed By: @jano

Differential Revision: D975697
put back test 537

@markw65 confirmed we shouldn't expect the warning in repo mode. Either I disable the test in repo mode or make the warning optional. I went with optional.

Reviewed By: @elgenie

Differential Revision: D978593
Maintain linked list correctly in Sweepable

In a more complex scenarios where sweep() may unregister() other
Sweepables, linked list was not maintained correctly.

Imagine this example:

  HEAD <-> A <-> B <-> C <-> HEAD

If sweep(A) calls unregister(B) and unregister(A), the following
happens:

  // Sweepable::SweepAll delists A:
  HEAD <-> B <-> C <-> HEAD
  HEAD <- A -> B

  // and calls sweep(A), which calls unregister(B):
  HEAD <-> C <-> HEAD
  B <-> B
  HEAD <- A -> B

  // then unregister(A) that uses invalid pointers from A, creating this mess:
  HEAD <-> B -> B
  HEAD <- C <-> HEAD
  A <-> A

  // Sweepable::SweepAll then tries to incorrectly sweep(B), which
  // crashes stuff

After this diff, Sweepable::SweepAll delists stuff correctly:

  // Sweepable::SweepAll delists A:
  HEAD <-> B <-> C <-> HEAD
  A <-> A

  // and calls sweep(A), which calls unregister(B):
  HEAD <-> C <-> HEAD
  B <-> B
  A <-> A

  // then unregister(A) does nothing:
  HEAD <-> C <-> HEAD
  B <-> B
  A <-> A

  // so Sweepable::SweepAll can correctly continue with sweep(C)

Reviewed By: bertrand

Differential Revision: D979013
Keep source location table in memory so that source line number to byte code offset lookups don't hit the SQL database

Hitting the SQL database with at least two queries every time the debugger needs to map from source line number to byte code offset, or vice versa, makes no sense. This diff adds a table to Unit that can be used instead of the database. Note that when running in repo authoritative mode, the table will be empty because a) it is created lazily when a unit is loaded form the repo and b) in this mode, the repo does not contain the source line information needed for this table. This does not matter too much because we don't support debugging when running in repo authoritative mode.

Note, this diff does not remove all uses of the SQL database. That will be done in a follow up diff.

Reviewed By: @mikemag

Differential Revision: D978834
Don't try to unlink a non-existent repo

This'll throw spurious warnings on fresh checkouts

Reviewed By: @ptarjan

Differential Revision: D979499
Fix ~AutoloadHandler to never access its smart members

We potentially create the AutoloadHandler during repro
creation, from various work threads.  (Things are set up enough to
call builtins.)  Then we shutdown the execution context and then run
OnThreadExit handlers.  ~AutoloadHandler can access the memory manager
after it is destructed, triggering the post delete assertions.

Reviewed By: @markw65

Differential Revision: D979498