Support static/self::TypeConst access

Summary: One thing that will make Type Const a compelling feature is the ability to access them via "self" and "static" access. For the most part the semantics of "self" and "static" in a type access hint is the same as self and static in expressions accessing constants.

For "self" we are able to resolve during naming, so we replace all references before reaching the typing phase.

For "static" it is a bit more nuanced. When expanding a type access we have to keep track of what the current class we are examining. For example

```
class A {
  type TC = int;
  type TC_static = static::TC;
}

class B {
  type Foo = A;
  type Bar = static::Foo;
}
```

Then when trying to resolve B::Bar::TC_static we do the following:

```
type = B::Bar::TC_static, root = B, tconst = Bar, rest = TC_static, static = ""
type = (static::Foo)::TC_static, root = static, tconst = Foo, rest = [], static = "B"
type = (B::Foo)::TC_static, root = B, tconst = Foo, rest = [], static = "B"
type = A::TC_static, root = A, tconst = TC_static, static = "B"
type = static::TC, root = static, tconst = TC, static = "A"
type = A::TC, root = A, tconst = TC, static = "A"
type = int
```

From the above example it should be clear that "static" refers to the previous root (after resolving "static"). The other thing to note is we have to expand through type defs. This is due to the fact we use type defs as part of the representation of these.

Reviewed By: @jwatzman

Differential Revision: D1732621
Swap arguments to Variant(StrongBind) constructor.

Summary: Makes it more obviously not a copy constructor.

Reviewed By: @​bnell

Differential Revision: D1736780

Signature: t1:1736780:1418412688:5e1020b8428f8c1515cabd7e3940e480e8b9fea7
Remove stale comment

Reviewed By: @swtaarrs

Differential Revision: D1733797

Signature: t1:1733797:1418321212:7a870bb70399c95c676aaed32665ea26f18cd794
Remove lots of includes from hphp-system.h

Summary: It didn't need any of them. Also, stop including it
everywhere. Then add includes back where necessary.

Reviewed By: @alexmalyshev

Differential Revision: D1738819

Signature: t1:1738819:1418544522:c277c8eeef6301c51a36931c37684bf9f31653f0
Use tvhelpers in type-variant

Reviewed By: @markw65

Differential Revision: D1738993

Signature: t1:1738993:1418582273:9f72c386e45e1c3bf1f0cc392d0269130a3753cd
remove tvRefcountedDecRefCell()

Summary: tvRefcountedDecRefCell(TypedValue*) and tvRefcountedDecRef(TypedValue*)
are essentially the same; consolidate them.

Reviewed By: @markw65

Differential Revision: D1738995

Signature: t1:1738995:1418586315:8035f05164dda4b55f58b71bb1f77de6ff905bfb
Allow hex in mb_encode_numericentity

Summary: PHP 5.4 added an additional `is_hex` parameter to `mb_encode_numericentity`. We should
support it now given that we have also just updated our `libmbfl` library.

Fixes #4247

Reviewed By: @sgolemon

Differential Revision: D1691911

Signature: t1:1691911:1418418614:0e3f630d326c3a7488be152bea1dd1e3df7224ba
Check Eval.JitAMaxUsage when deciding whether to start profiling a function

Summary: Optimize translations bypass Eval.JitAMaxUsage to avoid running
Profile translations forever, but that can potentially lead to
code.main getting much bigger than Eval.JitAMaxUsage.  To avoid this
issue, this diff checks the TC usage when deciding whether to start
profiling a new function.

Reviewed By: @markw65

Differential Revision: D1734032
Fix lexer rules for XHP identifiers

Summary: This fixes how the typechecker's lexer deals with XHP identifiers to match
HHVM. Most notably, XHP identifiers are not allowed to end with a hyphen or
a colon.

Reviewed By: @int3

Differential Revision: D1739223

Signature: t1:1739223:1418616156:87575bcda7d550bec63584c14b373549fe5c3831
Add deprecation warning to fb_autoload_map

Summary: Been documented as deprecated for a while, but new callers come in.

Reviewed By: @jdelong

Differential Revision: D1720790
Reduce the number of warning flags used for naming/.

Reviewed By: @elgenie

Differential Revision: D1739225

Signature: t1:1739225:1418660966:b3b86239e815e1fd81ff4abfb8b2a525427e9b8d
ResourceLimit.SerializationSizeLimit can be overwriten from the vhost config

Reviewed By: @markw65

Differential Revision: D1712716
Don't short circuit merging predicted types in FrameState

Summary: If we change the known type, we won't merge the predicted type.

Reviewed By: @jdelong

Differential Revision: D1737866

Signature: t1:1737866:1418430377:4d0fdb1683cec327b3fb398305043f1e1ed18c1d
Support \u escape sequences in double-quoted strings

Summary: \u escape sequences, when followed by a sequence of hexits
indicate a specific unicode character which will be represented in
the string as UTF-8.

For example "\u{00DF}" is equivalent to "\xC3\x9F"

Reviewed By: @JoelMarcey

Differential Revision: D1729476

Signature: t1:1729476:1418420831:e28cc4c27313a7b1c71828329db6daaa42244e32
Factor out tvRefcountedDecRef calls from ext_collections.cpp

Reviewed By: @alexmalyshev

Differential Revision: D1739064

Signature: t1:1739064:1418670053:01f4697718ed0e1128d6def0eec8fbd4e3724e87
Merge remote-tracking branch 'upstream/master' into phar_running
fix style issues