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