Fix some emitPropSpecialized code relating to intermediate property accesses

Summary: It turns out that this code doesn't seem to have been running anymore,
since we weren't getting any appropriate knownCls values through to
getPropertyOffset for intermediate prop operations on nullable object types.
Also, this tweaks needFirstRatchet to avoid some unnecessary control flow on
the first prop dim even if we don't know the type of the property (but know the
type of the base).

Reviewed By: @alexmalyshev

Differential Revision: D1625428
Non-member function organization for simplifier

Summary: Remove member-function-per-opcode design.

Advantages:

  - Adding a new simplify method doesn't involve changing simplifier.h, which
    means it doesn't change ir-builder.h, which means you don't wait 60seconds
    for hhbc-translator.o to build.

  - You can add private helpers without forward declaring them.

  - If simplifier ever gets too big, we can split it easily.  (The state struct
    and helper methods go to some -internal header, and then you can sprinkle
    the simplify routines into several .cpps.)

Disadvantages:

  - You have to say "env" all over the place.  (I got used to this pretty quick
    in hhbbc but it's definitely not an upside.)

I'd like to do this to hhbc-translator, but I thought I'd do simplifier first
because it was small enough to do quickly, and to make sure there's consensus.

Reviewed By: @edwinsmith

Differential Revision: D1632329
Rename simplifier.{h,cpp} to simplify.{h,cpp}

Summary: Assuming we do D1632329 a Simplifier isn't a nouny thing now, it's a
procedure.  So verb the filename.

Reviewed By: @mxw

Differential Revision: D1632525
Remove isRefCounted; fix a bug in simplifier xorBoolImpl

Summary: isRefCounted really means maybeCounted, which we have in Type.  And in
xorImpl we needed to check that the sources can't be doubles, not that they
aren't known to be doubles.  (As alexanderm pointed out in the task.)

Disable it for arrays and objects even though we don't have an example it
breaks, because the burden of proof should be on it being correct.

Reviewed By: @alexmalyshev

Differential Revision: D1633947
Clean up in hhbbc dce module

Summary: Been meaning to do this for a bit: convert the visitation away from
object-with-overload-per-bytecode design.

Reviewed By: @alexmalyshev

Differential Revision: D1633438
Disable xdebug_get_declared_vars in RepoAuthoritative mode

Summary: xdebug functions aren't apparently not generally useful in repo auth
mode, and we don't have this function hooked up to the disallowed dynamic funcs
mechanism.  Since get_defined_vars already exists let's just disable this one
in repo for now.

Reviewed By: @ptarjan

Differential Revision: D1638826
Enable -fglobal-dce and -fremove-unused-locals in hhbbc by default

Summary: For some reason I forgot that I meant to look at doing this when
turning off postOptimize.  The pass was off originally because I wanted to
think about it some more and was worried about the default implementation being
correct for bytecodes that aren't explicitly supported---it really just relies
on the mayReadLocalSet being correct from the normal abstract interpreter,
which I feel pretty confident about now.

This also turns on unused local variable removal, so we don't need to do
-fno-insert-assertions on test/quick/lotsa-locals.php (because hhbbc just
removes all the locals after constant propagating them into var_dump).  Found
and fixed a bug in this---it was willing to remove parameter locals.

Reviewed By: @jano

Differential Revision: D1633779
Support for SetOpL and IncDecL in hhbbc global dce

Reviewed By: @jano

Differential Revision: D1634176
Convert invariant() to return void in the emitter

Reviewed By: @elgenie, @jano

Differential Revision: D1634183
Remove ArraySet and MapSet case from storesCell

Summary: We believe it's bogus.

Reviewed By: @swtaarrs

Differential Revision: D1633881
LookupClsCns should return DCns

Summary: It doesn't matter in practice because the native call incref'd it, and
then the JIt just spills it on the stack before side exiting.  But we should
have the type system reflect what's going on.

Reviewed By: @swtaarrs

Differential Revision: D1633894
Automatically turn a few flags on for --region-mode=method

Summary: This is helpful.

Reviewed By: @mhahnenberg

Differential Revision: D1639787

Signature: t1:1639787:1414274827:8c7754ef6c8ced609e445141ea378c6212cfbe50
Don't include frame-state.h from opt.h

Summary: We can forward declare it.

Reviewed By: @alexmalyshev

Differential Revision: D1634315
Remove an unused hhbc-translator function

Summary: Dead code.

Reviewed By: @alexmalyshev

Differential Revision: D1636692
typechecker: hhi declarations for enum reflection builtins

Summary: first class enums have builtin support:
 - enum_exists -> similar to {class|interface|trait}_exists
 - ReflectionClass::isEnum -> similar to ReflectionClass::is{Interface|Trait|Abstract}

Reviewed By: @jwatzman

Differential Revision: D1637571
Add return type checking for async functions

Summary: Currently, HHVM does not do any return type checking for async functions.
This diff run time checks for async functions with return type annotations
of the form "Awaitable<T>".

Reviewed By: @elgenie

Differential Revision: D1580231