Revert "Share errors for abstract trait methods and interfaces"

Summary: This reverts commit 3b432fcbf02ac8daf066a60df16268fcb1b9fcfa.

Reviewed By: @bertmaher

Differential Revision: D1448119
Fix file:// URL decoding in libxml functions and elsewhere

Summary: Anything that accepts a file URL should be able to accept an actual
file URL, as per RFC 1738, without requiring escape codes to be pre-decoded.
So, implement decoding in all the relevant places by means of a new function
StringUtil::DecodeFileUrl(). Use url_parse() as a backend, which should cover
the relevant corner cases (or can be fixed if it doesn't).

Refactor the many places in the code where a string is checked for a file://
prefix to see if it is a file URL. Some methods are inefficient, requiring
copying. Some are wrong -- RFC 1738 section 2.1 states that the protocol is
case-insensitive, so strncasecmp should be used instead of strncmp.

Refactor the identical *_get_valid_file_path() in the XML extensions into a new
libxml_get_valid_file_path(). Implement it with url_parse() instead of the
idiosyncratic xmlCreateURI(). If there's any test case which works with
xmlCreateURI() but fails in DecodeFileUrl(), then that should be fixed in
DecodeFileUrl() for the benefit of non-libxml callers.

Reviewed By: @fredemmott

Differential Revision: D1445181
Rename some of the ArgGroup code and remove operator[]

Summary: This is factored out of the vasm diff stack.

Reviewed By: @bertmaher

Differential Revision: D1447149
Kill IRBuilder::blockIsIncompatible

Summary: The only purpose of IRBuilder::blockIsIncompatible left was to prevent
loops when Eval.JitLoops is off.  This diff gets rid of that, and
translateRegion now properly follows the region description passed to
it.  If any region former doesn't want to expose loops, it should not
include backedge arcs in the produced region.

Reviewed By: @bertmaher

Differential Revision: D1442450
Remove temporary hacks relating to the closure naming race

Summary: We believe this was fixed.  Leaving the assertions about unique
classes actually being unique, but we don't need to merge closure use var types
into a list of closures anymore.

Reviewed By: @ptarjan

Differential Revision: D1439704
Fix interp for VGetN

Summary: It was not popping one of its inputs.  Found in D1346023; putting up
this diff to decouple the fix from that.

Reviewed By: @alexmalyshev

Differential Revision: D1439827
Add stats in hhbbc about persistent static properties

Summary: We're going to have to redo this in hhbbc if we want to turn off
inferTypes, so I was looking at how many there are.  (Right now there's also an
issue: if you turn off inferTypes, it appears that every static property gets
marked as persistent, because isIndirectAltered defaults false everywhere, and
we'll behave horribly wrongly at runtime.)

I think it would probably be pretty trivial to do this for private statics
right now, but a huge majority of the cases of this are public statics from
thrift classes, so it's probably necessary to make something that can track
generally which statics could be assigned to.

Reviewed By: @alexmalyshev

Differential Revision: D1439901
Don't make use of HNI property type hints if AllFuncsInterceptable is true

Summary: It's too easy for systemlib code to violate the constraints in this
case.  (There's a case that can do so if you turn hphpc optimizations
off---it's only not doing so right now because hphpc makes some transformations
first that make it so renaming the func in question wouldn't break the type
hint.)

Reviewed By: @bertmaher

Differential Revision: D1443244
Make eval stack pushes in interp.cpp use TInitGen instead of TGen

Summary: The cases where it's pushing an F that it doesn't know if it's boxed.
You can't have an Uninit on the stack in these cases.

Reviewed By: @alexmalyshev

Differential Revision: D1445006
Fix a missing "return" in interp-minstr.cpp for a CGetM with final MW

Summary: This wasn't being tripped because it never happens, but it crashes
hhbbc at compile time.  An unrelated change to the emitter made it possible for
one of the unit tests to do this.

Reviewed By: mwang, alexanderm

Differential Revision: D1445466
Remove some dead code from hhbbc/class-util.h

Summary: This used to be used.

Reviewed By: @alexmalyshev

Differential Revision: D1444887
more complete hhi for LibXMLError

Summary: ... previous hhi was missing the properties
  http://php.net/manual/en/class.libxmlerror.php

Reviewed By: @paulcavallaro

Differential Revision: D1449908
Handle multiple end-of-region points in a translation

Summary: Any block in a region that doesn't have any successors is an end point.  Handle
this by checking for end-of-region at the end of each block, and resetting the
m_hasExit flag at each region end so that each exit can be generated correctly.

Reviewed By: @ottoni

Differential Revision: D1431292
Allow any conditional branching opcode to have both paths included in a region

Summary: We were artificially limiting the control flow within regions to come
from JmpZ/JmpNZ, but there's no good reason for that.  So, let's lift the
restriction.

Reviewed By: @alexmalyshev

Differential Revision: D1445273
Bump timeout more, retry on server out-of-date

Summary: 300s was chosen because it was the p90 of hack server startup times
as observed here: https://fburl.com/29184831

Reviewed By: pad, eladg

Differential Revision: D1449428
Sink stack adjustment into emitBindCall()

Summary: And remove dead toSave argument to emitRB().

Reviewed By: @ottoni

Differential Revision: D1449455
typechecker: case insensitive naming lookup

Summary: HHVM continues to be an environment that treats classnames as
 case insensitive (like PHP) and will remain so for some time. In
 order to smooth the transition to <?hh code, the typechecker should
 *not* allow ##class CamelCase## and ##class CaMeLcAsE## to both be
 defined names, nor should it treat typehints that refer to such
 mis-capitalizations in partial mode as referring to an unknown PHP
 class.

 This is accomplished by having an additional map of
 ##lowercase(classname) => classname## as part of naming, and spitting
 out an error when a lowercase(classname) is present in this map but
 standard naming lookup fails. The recovery from this error is
 **rewriting** the offending hint to the canonical name and proceeding
 with lookup as normal.

Reviewed By: @jwatzman

Differential Revision: D1447845
Replace regexes with string functions in DynamicYield

Summary: As @elgenie suggested in D1440297, instead of my hacky fix, I've rewritten the regexes to not be regexes.

I also deleted str.ml completely. I do not know if we want to do this or not. This would prevent people from using Str regexes in any part of the codebase that is being compiled to javascript, so that nobody starts adding them without realizing that they don't really work in javascript.

Reviewed By: jwatzman, eletuchy

Differential Revision: D1444831
Support "yield x => y" syntax

Summary: This syntax has existed for a while but the typechecker never
supported it. Let's do it. Mostly involves changing `Yield` to take an
`afield` instead of an expression, as well as a little bit of cleanup of
cruft from the days when we faked `async` with `yield` that makes no
sense nowadays and got in the way.

Reviewed By: @elgenie

Differential Revision: D1447853
Removed HOTPROFILER compile flag

Summary: This diff removes the HOTPROFILER flag.

I'm not sure if this is the best approach or if this should even be done at
all, but @swtaarrs said he thought this made sense so I figured I'd send this
out for review.

Currently the HOTPROFILER flags is always set, but the hooks into the
hotprofiler are still guarded by ifdefs. @swtaarrs said this was because it
used to have a non-zero overhead, but this is no longer the case. The
overhead would be in `event-hooks.cpp` but we don't run the hotprofiler code
unless event hooks have been enabled- and we have this check even
without the HOTPROFILER flag.

This matters for external profilers, namely xdebug. Since HOTPROFILER is
always set, this isn't actually required, but I'm not sure if it makes sense
for external profilers (implementations of `Profiler`) in general to
rely on the HOTPROFILER flag being set to work.

I just added anyone who commented on this in IRC as a reviewer. So feel free
to remove yourself if you'd like.

Reviewed By: @swtaarrs

Differential Revision: D1433761