Fix segfault when calling hash_final twice

Summary: context is freed in hash_final. The second call tries to use the freed variable.

Fixes #3741
Closes https://github.com/facebook/hhvm/pull/3771

Reviewed By: @fredemmott

Differential Revision: D1560874
Fix spelling errors in comments.

Summary: Spelling errors are hard to ignore...

Reviewed By: @jwatzman, @elgenie

Differential Revision: D1560046
Remove Toran Proxy support

Summary: We're not using it, as it doesn't cache enough to improve our reliablity. Replaced with --cache-dir.

Reviewed By: @JoelMarcey

Differential Revision: D1561742
Make Framework::installDependencies() final, add <<Override>> where appropriate

Summary: The new hooks mean there's no need to override installDependencies(), and implementing the hook makes it clearer what's going on.

Add <<Override>> to isInstalled just for future safety.

Reviewed By: @JoelMarcey

Differential Revision: D1561812
Reserve / fix error codes.

Summary: Reserve error codes for an upcoming commit.

Also fix one instance of overlapping error codes.

Reviewed By: @elgenie

Differential Revision: D1563423
Tune pcre cache lookup

Summary: In the AHM for pcre cache, optimistically check for
StringData pointer equality before doing a full
comparison.

Reviewed By: @edwinsmith

Differential Revision: D1557919
Clean up const type inference

Summary: Remove duplicated code dealing with infering the type of constants. For
some reason it was doing munging during naming, which we don't need at
all; move the one relevant bit into the other code in declaration. Add a
comment as to why we need special logic here.

Originally to support negative constants:
These are parsed as a unary minus. Fixing here seemed easier
than fixing the parser (which isn't necessarily wrong depending on how
you look at it).

Reviewed By: @int3, @elgenie

Differential Revision: D1559026
Added a rule to the simplifier for LdCtx to constant fold when inlined

Summary: When compiling LateBoundCls, we emit a LdCtx followed by a LdClsCtx to
get the Class that we're operating on. When LateBoundCls is inlined in such a
way where we statically know which Class the callee was invoked with, we can
constant fold the LdCtx and LdClsCtx, which then allows us to DCE the
DefInlineFP and other associated boilerplate for reifying an inline call frame.

Reviewed By: @jdelong

Differential Revision: D1552775
Minor fixes to PHP5 test importer

Summary: * Exclude buggy test ext/gmp/tests/014.phpt
* Use __DIR__ instead of getcwd() in tests/security/open_basedir.inc
* Deal with having false passed to utf8Sanitize()
* Add more "other files"

Prep for PHP-5.6.0 test import

Reviewed By: @fredemmott

Differential Revision: D1556259
hh_ide.js - remove unneeded declare_file call

Summary: caller needs to hh_add_file before they can call hh_check anyways, so declare file has already been called.

Reviewed By: @jwatzman

Differential Revision: D1562022
hh_ide.js perf - Don't parse if the parser_heap would already have it

Summary: We're doing this completely unnecessarily. If it's already in the parserheap, we don't need to parse it again.

Reviewed By: @jwatzman

Differential Revision: D1562087
Removed REX.W requirement for several instructions

Summary: Several SSE related instructions didn't require REX.W, but we were
generating them anyways. Now we don't generate a REX prefix if if these
instructions use xmm0-xmm7. If they do use xmm8-xmm15, we emit the REX prefix
byte with REX.R set (which we already did correctly).

Reviewed By: @edwinsmith

Differential Revision: D1548397
Fix potential security leak in HashContext

Summary: CVE-2014-6229

This is not a NUL-terminated string, it's a fixed-size block of data.
The risks were key truncation (if there happens to be a NUL byte in the
key) or over-reading (which would be information leakage).

Reviewed By: @ptarjan

Differential Revision: D1533546
Remove the streams extension (just the stub)

Summary: The "stream extension" is actually a subset of the standard extension.

Reviewed By: @fredemmott

Differential Revision: D1561554
Admin command to dump regex cache

Summary: By the end of the weekend some machines have accumulated an oddly
large number of regular expressions.  We can use this to figure out what they
are and fix them.

Reviewed By: @mclarkelauer

Differential Revision: D1563554
Change CONTRIBUTING.md to suggest "probably easy" issues

Reviewed By: @paulbiss

Differential Revision: D1564003
Fix server tests broken by D1462817

Summary: When the main thread exits it calls ShutdownModules, which marks the extensions as unsorted.  Any unjoined threads will hit an assert when they exit.  In this case the 'watchdog' thread was joined a step too late in the shutdown process.

Reviewed By: @markw65

Differential Revision: D1562679
Convert some cg functions to SSA.

Summary: These are the easy cases that don't require conditionals
and phi nodes.

Reviewed By: @jasone

Differential Revision: D1556344
run test/tools/update-server-mode-blacklist.sh

Summary: @swtaarrs said this might fix the weird locale race

Reviewed By: @paulbiss, @swtaarrs

Differential Revision: D1564231
Prefix magic attributes with "__"

Summary: See linked task for full description, but here's the gist. In
the absence of real namespacing for user attributes, we should do the
same thing as PHP did for reserved functions: anything prefixed by `__`
might be magical in the runtime (in our case, in the typechecker).
Anything else is up for grabs by users of the language.

In that vein, prefix the handful of unprefixed magic attributes with
`__`. Maintain backwards compatibility support for the old names for a
little while.

Going forward, we should only make magic for user attributes prefixed
with `__`.

Namespacing support for user attributes might be a good idea, at which
point we can redo this, but it's complicated and no one is volunteering
to do it, so here we are.

Reviewed By: @int3

Differential Revision: D1559079