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
Add global value numbering pass

Summary: We currently have a somewhat ad-hoc CSE pass that runs at IR
gen time. We'd like to remove this in favor of a separate, more
formalized pass that runs later. To that end, this diff adds a new
global
value numbering pass based on the RPO version of the algorithm presented
in the Cooper/Simpson '96 paper "SCC-Based Value Numbering".

Reviewed By: @edwinsmith

Differential Revision: D1718396

Signature: t1:1718396:1418418949:d4017969b77056a055e14803fe1894b392855c9a
update third-party SHA for libmbfl fix
Support timestamp begins and ends for getTransitions()

Summary: `DateTimeZone::getTransitions()` has two optional parameters that we don't currently
support ... `timestamp_begin` and `timestamp_end`. Let's support them now.

Fixes #2479

Reviewed By: @sgolemon

Differential Revision: D1724025

Signature: t1:1724025:1418418358:e4408ada5c240ef13860c777924f8a965b4903c6
typechecker: demand consistent casing for primitive typehints

Summary: ... instead of the baffling behavior of treating `Array` as
 referring to some php-defined class of which the typechecker is unaware.

 As part of this change, consolidate all the errors for the spelling of primitive typehints
 under a single error code

Reviewed By: @paroski

Differential Revision: D1739580

Signature: t1:1739580:1418677499:41984c4b0207686ea7817c219af07c6dcfcc30c5
Fix dependency detection issue with "attribute :foo;" statements

Summary: When an XHP class imports attributes from another XHP class via the
"attribute :foo;" syntax, we need to record the dependency to make sure
typechecking is performed in the correct order.

Reviewed By: @elgenie, @jwatzman

Differential Revision: D1740731

Signature: t1:1740731:1418685342:7d2db3991a19b1c1385cf2fcbbe61e3f90b2f425
Remove unused includes in builtin-functions.h

Summary: It was pulling in a bunch of stuff it didn't need.

Reviewed By: @edwinsmith

Differential Revision: D1735483

Signature: t1:1735483:1418393005:a26842d02f0fd19a4d44e1dabe0d6d18af1d1609
Disable socket-pair test because it is flaky

Summary: It's failing a bunch on sandcastle

Reviewed By: @alexmalyshev

Differential Revision: D1741089
Cleanup and document VariableUnserializer API

Summary: Brought VariableUnserializer up to our current coding standards,
documented the API, and in the process found some minor simplifications (an
unused method, unused member, and constructor that didn't add much value).
Split out the inline methods to improve readability.

Reviewed By: @edwinsmith

Differential Revision: D1738354

Signature: t1:1738354:1418570047:84f18bac7ef3cacac159f66fae9f9c11d83b471e
Don't print key's local id in IterData if it's invalid

Summary: It prints as 'IterInit<Bool,0::4294967295::2> t43:Arr, t0:FramePtr'
otherwise.

Reviewed By: @jdelong

Differential Revision: D1737610

Signature: t1:1737610:1418506183:325bddb2e47b5e85ff7b285b6c9c96ced5b932a0
Adds planned optimizations for memoize

Summary: All optimizations have been moved out of emitter.cpp and into more appropriate places. Specific optimizations:
- HHBBC handles the old "blessed types" optimizations. It also adds a direct call to getInstanceKey() for typehinted objects that inherit HH\IMemoizeParam.
- The jit has a couple fast paths when it detects null or int at that level.
- A few better paths have been added to the runtime code. Ints are always used without serialization, and null, bool, and empty array always return static strings instead of building new strings.

Reviewed By: @elgenie

Differential Revision: D1706507

Signature: t1:1706507:1417565711:377fce22eb399f967d2a87ce3f5bb6fade04acb5
Fix JIT crash related to stack size limits.

Summary: Fix the JIT to distinguish between the native stack and the VM stack,
even when the VM stack ends up allocated in the virtual memory region
that was originally available to the native stack.  This situation
arises when the stack size limit (ulimit -s) is set very high, e.g.
unlimited, in which case shared libraries are loaded much lower in
memory in order to give the native stack lots of room to grow.

Reviewed By: @swtaarrs, @markw65

Differential Revision: D1736940
Remove ProdServerPort

Summary: There's a comment saying it must be set to the same port
as the main server; so just use the main server port instead.

Reviewed By: @afrind

Differential Revision: D1739002

Signature: t1:1739002:1418676596:b29ae95848bb4bf84aa5d16be6fda8ad4a69e236
Fix ASAN-identified memcpy issue

Summary: If the IV provided in `mcrypt_generic_init` is less than the expected IV size, we still memcpy a number of bytes equal to the expected IV size. That leads to an out-of-bounds read which ASAN detects.

We also don't want to mark the object as initialized in case of failure. This is consistent with https://github.com/php/php-src/commit/dd791cd71742fdb9b87b7166537fbb25bd7cd8b9

Reviewed By: @jano

Differential Revision: D1639516
Remove FORWARD_DECLARE_CLASS macro and associated typedefs.

Summary: The FORWARD_DECLARE_CLASS(T) macro was used to declare a class T and create a SmartPtr<T> typedef automatically. It seems clearer to use the SmartPtr<T> class directly than through a typedef.

Reviewed By: @jano

Differential Revision: D1736966
Make Dep a properly abstract type.

Summary: * Created an mli for Typing_deps
* Made Typing_deps.Dep.t an abstract type, instead of int
* Replaced various uses of ISet by DepSet (ISet is a set of Ident.t,
  not ints... though it so happens that Ident.t = int. But it seems
  inappropriate to store a Dep.t in a set of Ident.t)
* Created Typing_deps.(un)marshal, so we don't expose ifiles

Reviewed By: @jwatzman

Differential Revision: D1738913

Signature: t1:1738913:1418676595:d745988e8699baf05274f7a13035fff7ebb25d52
Remove dead code.

Reviewed By: @jwatzman

Differential Revision: D1738947

Signature: t1:1738947:1418676801:435f8c422dfd923e5ee1b5a7948eda01b69da0a0
Make subst an abstract type.

Summary: This also revealed some code duplication, yay!

Reviewed By: @jwatzman

Differential Revision: D1739103

Signature: t1:1739103:1418678734:6416828a85aa4fd60756b5f9f6bece808e1cf2e5
Print out total startup time.

Summary: Incremental mode logging does the same thing.

Reviewed By: @jwatzman, @elgenie

Differential Revision: D1739379

Signature: t1:1739379:1418682187:5dc050f4b5b0c73a6e4685583f878deb14ec7f0b