Revert "An async method's return annotation (if there is one) must be "Awaitable""

Reviewed By: @elgenie
Easy cleanup of DataType

Summary: Hard cleanup forthcoming; this is the free-of-thought stuff.

Reviewed By: @jdelong

Differential Revision: D1603727
Get rid of KindOfAny in extension code

Summary: yay hooray

Reviewed By: @jdelong

Differential Revision: D1608540
Organize and document jit::Type

Summary: Trying to get rid of KindOfAny led me down this road.

Reviewed By: @swtaarrs

Differential Revision: D1608437
Deal with double nulls in an even smarter way

Summary: `Typing.non_null` attempts to deal with double nulls, but
doesn't quite do the entire job, as comes up a lot with `idx2`, see new
test case. This threads information thru `unify` and `sub_type` to deal
with that, along with starting to set up a type `apply` function which
we may eventually want to write. (I originally started trying to write
such a function, which is why this took me so long to crank out, but
ended up just doing this simpler approach.)

Reviewed By: @int3, @elgenie

Differential Revision: D1603190
Fix heap corruption in exif_ifd_make_value

Summary: CVE-2014-3670

The logic for writing float/double arrays in exif_ifd_make_value is flat out wrong. Firstly, the whole size of the target buffer is `byte_count`, yet `byte_count` is used as if it was the size of an individual element in the array.

Furthermore, the source pointer for the memmove is wrong as well. The expression `info_data->value.f` access the union (`_image_info_value`) as a float, even though it is a pointer in this case. See line 5857 for an example where - in the case of an array - the list member is derefenced properly as a pointer to an array. This ends up being simultaneous out-of-bounds read and write.

Reviewed By: @oyamauchi

Differential Revision: D1553388
Fix SplFileObject::fgets

Summary: Aims to fix #3873
Closes https://github.com/facebook/hhvm/pull/3877

Reviewed By: @paulbiss

Differential Revision: D1584282
Remove movq, movqrx, movqxr.

Summary: These were left over from the X64Assembler->VASM conversion,
we only need copy{}.

Reviewed By: @swtaarrs

Differential Revision: D1614296
De-hhvmify hhmeasure

Summary: It'd be nice to be able to use hhmeasure as a tool to comparatively
microbenchmark hhvm and other php implementations, so let's get rid of
the hhvm-specific language extensions.

I considered inlining the implementation of idx() at the callsites,
instead of defining my own. I went with this because I have a hunch that
a lot of real codebases probably define their own idx-like thing, so
this is somewhat realistic. Any thoughts?

Reviewed By: @edwinsmith

Differential Revision: D1614251
Fix a tracing bug in hhbbc

Summary: Segfaulted if you have an unnamed local in a member instruction.

Reviewed By: @edwinsmith

Differential Revision: D1605906
Add a utility to hhbbc to increase trace level for specific functions

Summary: I've done this manually many times, so let's make it a feature.

Reviewed By: @markw65

Differential Revision: D1606347
Don't propagate states past noreturn functions or Awaits that throw

Summary: Outside of FPI regions this is pretty easy to do.  Inside of them, the
restrictions on bytecode for FPI regions make this easiest to do by not
eliminating the unreachable code---this means running the abstract interpreter
on it, but we don't want any types it infers to leak into successor blocks.
Handle this by adding a new 'unreachable' flag for states and setting up the
state merge rules to handle it appropriately.  When the optimizer sees
unreachable code, it tries to remove it only if it isn't in an FPI region.

Also, change the cases where this happens to push TBottom, and fix a few bugs
where subtypeOf was being used when we really meant something else.
(TBottom.strictSubtypeOf(TObj) is true, but that doesn't mean it has specific
information about an object.)  There are other cases where we'll do things like
push TTrue if a TBottom is being tested for is_int---these are all harmless
because the code is unreachable if you have a TBottom involved.

Reviewed By: @jano

Differential Revision: D1596487
Fix a bug in how __Memoize sets up FPI regions

Summary: In this case you could have the fpushOff pointing to a non-FPush.

Reviewed By: @jano

Differential Revision: D1614957
Remove MemoryManager::refreshStatsHelper

Summary: It's just a wrapper.  I think the original purpose was to prevent
inlining of refreshStatsImpl, but that's moved to .cpp now anyways, so getting
rid of it should just make this code (marginally) easier to follow.

Reviewed By: @jdelong

Differential Revision: D1612500
Add a few more very simple APC unit tests

Reviewed By: @edwinsmith

Differential Revision: D1594377
Remove APCTypedValue optimization in APCLocalArray

Summary: This doesn't buy anything anymore and it's one less variable for
differences with the new system.  (On its own merit it also would mean we don't
need to have APCTypedValue have the same layout as TypedValue.)

Reviewed By: @bertmaher

Differential Revision: D1606396
Don't throw ints when throwAllErrors is enabled

Summary: Throwing ints is not cool.  But enterVM also just catches them and
turns them into Exception anyway, so anything that was relying on it being an
int would be broken.

Reviewed By: @markw65

Differential Revision: D1611790
Update third party SHA to support 12:0 folly update
Don't re-create singletons

Summary: This forbids singleton creation/re-creation after destroyInstances() was called.
Only after reset() is called singletons can be created again.

registrationComplete() behavior is also slightly change. We disallow singleton registration after registrationComplete() is called even in Relaxed mode. Strict mode now only controlls whether singletons can be constructed before registation is complete.

Reviewed By: @chipturner

Differential Revision: D1605136
Fix a crash in nested file functions

Summary: UrlFile functions correctly chased through multiple actrecs
to find the callsite. ExecutionContext::setVar only went one deep.

The result was that the example crashed because it tried to set a
variable in a frame that didn't have a VarEnv.

Reviewed By: @swtaarrs

Differential Revision: D1614350