Add VectorFormat to unserialize a vector as map or as vector

Summary: The current code serialize vector as map. But in theory, we should serialize the vector as a vector.

This diff adds a new FB_SERIALIZE_VECTOR used for vectors.

The serialize logic now can serialize the vector as
FB_SERIALIZE_VECTOR
list of Values
FB_SERIALIZE_STOP

The unserialize logic will understand the FB_SERIALIZE_VECTOR correctly, and use createVector and vectorAppend to create the map (php doesn't have vector type so it still uses map).

To make roll out eaiser, this diff only has the unserialize part. The serialize part will be checked in after unserialize it everywhere.

Reviewed By: @andriigrynenko

Differential Revision: D1714262
Add __ParamCoerceModeFalse to various ext file functions

Summary: After the ext file HNI conversion, the return value of various file functions have been changed from false to NULL. Setting these functions' param coerce mode to false would fix the issue.

Reviewed By: @JoelMarcey

Differential Revision: D1700631
Fix Arr=Packed | BoxedInitCell.

Summary: We weren't correctly dropping the specialization, and hitting an assert when
constructing the new type.

Reviewed By: @jdelong

Differential Revision: D1721056
Make timeout flag sticky

Summary: Occasionally we see long-lived requests that fail to timeout.  What
probably happens is that the TimeoutException is generated, the timeout
surprise flag is unset, and then the exception is caught by some block that
simply drops it.  While we could keep auditing catch blocks, it seems more
reliable to simply make timeouts sticky, so that we'll re-raise the exception
at the next opportunity.

Reviewed By: @jdelong

Differential Revision: D1711487
Use heap parsing for objprof

Summary: Parsable heap means we don't need a hashtable to keep track of objects.
Change heap iteration to take a snapshot of the objects in the heap,
then iterate over them. Populating a vector of pointers is probably more
efficient than using the unordered_set for a single snapshot, but could
lose if many snapshots are taken in the same request.

Looking at the inner loop code in objprof_get_data/strings, I don't think
the snapshot cost is significant; they're converting objects to arrays,
accessing the arrays, and so on. Taking a snapshot also avoids mutating
the heap (allocating arrays, etc) while we are iterating over it.

Reviewed By: @markw65

Differential Revision: D1711579
Convert WddxPacket to use StringBuffer instead of std::string.

Summary: Convert WddxPacket to use StringBuffer instead of std::string.

Reviewed By: @edwinsmith

Differential Revision: D1714927
Allow typechecker to interpret WaitHandle result()

Summary: Avoid problems with typechecker on hhvm 3.5 version
Closes https://github.com/facebook/hhvm/pull/4405

Reviewed By: @jano

Differential Revision: D1724448

Signature: t1:1724448:1418076102:74b9fc566f8720d1493d19b568f47b98448866a2
Fix use-after-free in soap extension

Summary: Binding a StrNR to a const String& results in a dangling
reference.

Reviewed By: @swtaarrs

Differential Revision: D1725840

Signature: t1:1725840:1418075846:75cf7115c6fb2c48b81023cb9dd5bf4a1d2ff9f7
Basic support for interfaces in HHBBC subtypeOf

Reviewed By: @paroski, @elgenie

Differential Revision: D1719649

Signature: t1:1719649:1417817263:4c8ac18096750c5b553c855e0809cfd287135c45
Remove the SoftClosureReturnTypeHints runtime option (part 1)

Summary: The SoftClosureReturnTypeHints runtime option was added as a temporary
crutch while adding return type enforcement for closures. We don't need it
anymore, so let's get rid of it.

This diff removes all uses of the SoftClosureReturnTypeHints runtime option
inside HHVM, but doesn't completely remove the option because there are
still some configs that reference this option. Later, we'll completely
the option once enough time has passed to update all the relevant configs.

Reviewed By: @elgenie

Differential Revision: D1724592
Always assert a few limitations in copyTV

Summary: Seems cheap enough and could save debugging time, before we actually
support it.

Reviewed By: @jasone

Differential Revision: D1713316
Use aligned version of hash function when safe

Summary: I am assuming that std::string::c_str() and HPHP::String::data() always give aligned addresses.

I don't see a failure. But sandcastle has been postponing some tests for many hours now.

Reviewed By: @markw65

Differential Revision: D1725993

Signature: t1:1725993:1418080027:b7628914ad44582976748d138c53db43ddc48028
Use a custom implementation of strtoll for unserialize

Summary: We can do better than the standard libc strtoll for unserialize, both
because we can avoid the plt, and because unserialize doesn't need all the edge
conditions (overflow doesn't need to be defined in any particular way, there's
no need AFAIK to handle leading + or whitespace).

Reviewed By: @ottoni

Differential Revision: D1722763

Signature: t1:1722763:1417817958:a1b96780879ce4400b30fe39b21523b171ba5bd9
Apply code skew to code alignment.

Summary: When we emit code starting at an address that is not cache line
aligned, we need to pass to LLVM the skew in alignment.
LLVM uses the aligment e.g. when generating code for smashable
instructions.

Reviewed By: @swtaarrs

Differential Revision: D1724732
Move disabled unit tests to runtime/test.

Summary: There were a number of unit tests under test/ext/test_cpp_base.cpp that were disabled because they were a part of TestLibEventServer.  I've moved them over to runtime/test and converted them to gtest.

Reviewed By: @markw65

Differential Revision: D1722753
Add Hack typing to array_keys

Summary: There's also a diff for `array_values` forthcoming. The resultant hack errors all look reasonable.

Quirks found:

1. `array_keys(Set {'foo'})` doesn't typecheck, since Set doesn't implement KeyedContainer. Use `array_values(Set{'foo'})` instead.
2. `array_keys(shape('stuff' => 'morestuff'))` doesn't typecheck, and possibly never will.
3. `array_keys('foo')` logs an error and returns `null`. I assume we're okay with this.

Reviewed By: @dlreeves

Differential Revision: D1661290

Signature: t1:1661290:1418145186:2ead1ade24806ea0a1923a1534f8f6c0dcf178b5
Implement smashable jump service requests in llvm backend

Summary: Fairly straightforward, except for the fact that the jumps aren't
actually smashable yet due to a bug in llvm's assembler (or how we're using
it). The bindjcc1st/2nd vasm instructions are implemented with a local jcc
going to REQ_BIND_JMP stubs because we can't emit smashable jccs yet.

I moved the global function name table into TCMemoryManager to keep the size
from growing indefinitely with each translation, since we need to generate
names for certain stubs that are unique for each translation.

Reviewed By: @maksfb

Differential Revision: D1717035
Initial cleanup of ObjectData

Summary: * Moves all inline ObjectData methods out of object-data.h, and into
  object-data-inl.h

* Renames implementsIterator() to isIterator() to match is*Collection().

* Gets rid of the o_ prefix on o_getClassName(), o_getId(), and o_instanceof().

* Deletes a few unnecessary methods such as getAttributes(), setAttributes().

Reviewed By: @edwinsmith

Differential Revision: D1707226

Signature: t1:1707226:1417042506:3be85673baf9cd215b506fbf52533733ac9d4c96
Make newlines in http headers a fatal error.

Summary: Make newlines in http headers a fatal error.

Reviewed By: @markw65

Differential Revision: D1720703
Define proper constants for CURLOPT and friends

Summary: I can never recall our inference story on constants, but we
don't infer these to ints, so explicitly declare as `const int`.

Reviewed By: @int3

Differential Revision: D1725225

Signature: t1:1725225:1418089362:d99d16add218d4b8dd8fdf37f7408c16c2065039