Revert "Fix #4380, making get code and get message final"

Reviewed By: @paroski, @JoelMarcey

Differential Revision: D1736352

Signature: t1:1736352:1418398167:2b6d408c99a41f5224331b0837b4fb50cb283b5a
Add timestamps to test stats

Summary: All the tests claim to take 0s when run via fbmake runtests,
so add start and end times to get real numbers.

Also included a cpu time which is displayed with the
--verbose output

Reviewed By: @bertmaher

Differential Revision: D1735237

Signature: t1:1735237:1418397500:13d548f0901ad02d2561c0273aaa06d8827bd5c9
Lower default socket timeout for debugger tests

Summary: Two of the tests in here intentionally wait for a socket to timeout,
and the default of 60 seconds was making test/quick hang for a bit at the end.

Reviewed By: @edwinsmith

Differential Revision: D1736153

Signature: t1:1736153:1418389416:8e513aba6aa953de415d6db2659dfd34dfc7d945
Modify rpoSortCfg to reduce memory usage in refcount-opts

Summary: The old order was specifically designed so exit blocks would appear
last in the RPO order, for optimal codegen. But codegen order is now decided by
vasm's rpo sort so this shouldn't affect it. Anyway, because we were visiting
exit blocks last, their in-states would sit around in a map waiting to be used
until we finished visitng the rest of the blocks. With this new order, we'll
visit exit blocks and then erase their in-state right after visiting the
predecessor. This means the max size of the state map is now O(1) on long
traces with lots of exits blocks, rather than O(nExits).

This exposed a refcount-opts issue where we were depending on the traversal
order to punt in units with unsupported instructions. I changed it to check for
that condition in a better way before even starting the optimization.

Reviewed By: @bertmaher

Differential Revision: D1734625
Fix off-by-one error with checking the bounds of a Pair

Summary: The bounds for CheckBounds is an exclusive bound.

Reviewed By: @jdelong

Differential Revision: D1735233

Signature: t1:1735233:1418343580:43e7a38562778f9e9f208d3836be4cace85660b3
Move shouldPGO() out of Func

Reviewed By: @jdelong

Differential Revision: D1735644

Signature: t1:1735644:1418350022:d368ae30d5512c3d96c8317658275aa085c12d53
LowPtr should not require the size to be specified.

Summary: There were several uses of LowPtr typedefs where the user had to do
"#ifdef USE_LOWPTR" and then do the same typedef for either
LowPtr<T, uint32_t> or LowPtr<T, uintptr_t>.

Instead add LowPtrImpl<T,S>, and then typedef LowPtr<T> out of it,
defining S via USE_LOWPTR.

Reviewed By: @elgenie

Differential Revision: D1705343

Signature: t1:1705343:1417002921:5951d14bdf2418494803c4135a7349b90f7f0391
Use MM for MCrypt allocations

Reviewed By: @jano

Differential Revision: D1729456
Use MM for Key allocations

Reviewed By: @jano

Differential Revision: D1729467
Use MM for CSRequest allocations

Reviewed By: @jano

Differential Revision: D1729480
Use MM for Certificate allocations

Reviewed By: @jano

Differential Revision: D1729481
Add support for reading XHP attributes via "->:"

Summary: This diff updates the typechecker to meaningfully parse XHP attribute
declarations and treat them as instance properties for most purposes, and
it adds support for "$obj->:xhp-attr" syntax for reading XHP attributes.
Writing to XHP attributes via "->:" is not supported for now.

XHP attribute declarations don't perfectly map onto Hack's type system, so
some adjustments were needed. XHP's "enum {..}" annotation gets converted
to int, string, or mixed depending on the enum's literal values. XHP's
"string" annotation needs to be converted to Stringish because in some
cases XHP allows "string" attributes to hold non-string values.

Finally, XHP lets the programmer import attributes declared in other XHP
classes using the bizarre "attribute :xhp-class;" syntax. This essentially
works like trait importation except, it only imports XHP attributes (and
like trait importation it can be transitive). This diff adds the necessary
plumbing to make the typechecker understand XHP attribute importation.

Reviewed By: @jwatzman

Differential Revision: D1681272

Signature: t1:1681272:1418413929:a4ae62fc5ad9dcd532ea21fd96e37254b278d45c
Add stream_await() for async stream "blocking"

Summary: As with cURL, use stream_await() to drop the fd
into the asio event loop and get notified of read/write events.

Reviewed By: @JoelMarcey

Differential Revision: D1720052

Signature: t1:1720052:1418353349:c7c252f30e901d40e303e3e445ddf518aaf98d6d
Adjust Is DSO Extension test check

Summary: We now look for if we can traverse ../../hphp/test/run back to ourselves instead.  This fixes a false positive when you have a ../hhvm folder outside of your DSO extension folder.

Also fixes some style issues.

This is a replacement pull for facebook/hhvm#4419.
Closes https://github.com/facebook/hhvm/pull/4432

Reviewed By: @JoelMarcey

Differential Revision: D1735988

Signature: t1:1735988:1418419042:7d763df76767be6beb80c1eba343da6f2543e58a
Adding lexer error to HPHP output

Summary: output lexer error to HPHP

Initial code review to validate approach.

Reviewed By: @paroski

Differential Revision: D1708518

Signature: t1:1708518:1418418481:862ce03615400f9ed2cd05022e8cbfc7931aac81
Update klein Framework

Summary: HHVM reaches 100% for klein.php after applying https://github.com/chriso/klein.php/commit/744c07b7d4d168f146d0295073d85af13e576316
This is a good opportunity to update it.

I got 98.53% running it.
Closes https://github.com/facebook/hhvm/pull/4333

Reviewed By: @fredemmott

Differential Revision: D1700389

Signature: t1:1700389:1418420526:23740b8efe14af54cbeec4c1913462c488655474
Work around leak in boost flat_set

Summary: This is very likely to be the memory leak reported to be new in
HHVM 3.4. See code comment and linked GitHub issue for full explanation.

Fixes https://github.com/facebook/hhvm/issues/4268

{sync, type="child", parent="internal", parentrevid="1736543", parentrevfbid="1584241511789266", parentdiffid="5935230"}

Reviewed By: @paulbiss

Differential Revision: D1736543
Try not to rely on $USER

Summary: There are rare cases when it might not be set -- at least one
person complained in IRC of a crash due to this. Instead, try the
$LOGNAME env var, which apparently POSIX specifies should be set, and if
that doesn't work, run the `logname` command. cf:
http://unix.stackexchange.com/questions/76354/who-sets-user-and-username-environment-variables

Reviewed By: @int3

Differential Revision: D1731369

Signature: t1:1731369:1418322898:1688cb39c77b574dbf4ec3119bdead8be013fadd
Formatting fixes.

Summary: Mostly fixes for lines > 80. I have my editor set to wrap lines so
it's kind of annoying.

Reviewed By: @jwatzman

Differential Revision: D1732663

Signature: t1:1732663:1418424495:8551b7528dedf2fba8b62476befced0d315cc40e
Remove unused cache.ml

Reviewed By: @jwatzman

Differential Revision: D1732842

Signature: t1:1732842:1418424718:e29935c3321d75673ef3f1749fc64805c13f72cb