Fix block mapping for IRUnit entry

Summary: It was picking which region block corresponds to the unit entry based
on offset.  Just use the first block in the region, which is the
entry.

Reviewed By: @bertmaher

Differential Revision: D1456181
typechecker: infer untyped 'async function' returns 'Awaitable'

Summary: ... because like 'private', 'async function' is a property of
 the language that programmers should not need to explicitly
 reenforce. With this inference, the 'awaitable not being awaited'
 heuristics become even more valuable.

 Going down the road of inferring return types would normally be
 considered a slippery slope of cross-file effects, mutually reentrant
 type recalculation passes, and associated badness. However, in this
 case 'async function' as a language feature is explicitly localized
 to the function declaration, and subject to very very simple
 unification.

Reviewed By: @jwatzman

Differential Revision: D1455175
Fix potential segfault in ICUs error handling

Summary: `vsnprintf` returns the size of the string regardless of the buffer size.

Fixes #3118

Closes https://github.com/facebook/hhvm/pull/3247

Reviewed By: ptarjan, joelm

Differential Revision: D1447245

Pulled By: svcscm
ReflectionProperty::setValue throws an ReflectionException if unaccessible

Summary: Also changed `gettype() != 'object'` to `!is_object()`

Fixes #3128

Closes https://github.com/facebook/hhvm/pull/3251

Reviewed By: @ptarjan

Differential Revision: D1449439

Pulled By: svcscm
Finish Unit and UnitEmitter cleanup

Summary: - Clean up includes for unit{,-emitter}.{h,cpp}.
- Document and clean up UnitEmitter.
- Organize unit{,-emitter}.cpp.

Reviewed By: @jdelong

Differential Revision: D1445825
Additional cmake tweaks for cygwin

Summary: Fixes issues where
embed.rc does not exist (mark it as generated)
debug mode overflows pe/coff section limitations
an issue with cygwin, folly, and the way gcc + windows headers interact (adding an "internal" define makes headers behave)
force zend compat to not to work/turn on for cygwin

Reviewed By: @ptarjan

Differential Revision: D1455421
Add log when memory usage reached the MaxRSS

Summary: Our online system use linux container, now and then it may be killed because of memory leaks.
This log could be useful at this scenario.

Closes https://github.com/facebook/hhvm/pull/3267

Reviewed By: @JoelMarcey

Differential Revision: D1455316

Pulled By: svcscm
Fix name in cmake file

Summary: it's files not file

Reviewed By: @JoelMarcey

Differential Revision: D1458050
Convert ext/mysql to HNI

Summary: Part of #1480

Also includes the commit in #2024
Closes #2027

Reviewed By: ptarjan, joelm

Differential Revision: D1410521

Pulled By: @fredemmott
Don't use -Og for debug build, and add -ggdb

Summary: -Og is great in theory but in practice it produces binaries that aren't very
debuggable. Go back to -O0. -ggdb produces more expressive debug information.

Closes https://github.com/facebook/hhvm/pull/3275

Reviewed By: @bertmaher

Differential Revision: D1457844

Pulled By: @ptarjan
Simplify LdObjInvoke with a persistent const class.

Summary: We can just load the Func* and propagate it.

Reviewed By: @bertmaher

Differential Revision: D1453838
Remove usage of post-4.00 `List.iteri`

Summary: `List.iteri` isn't available on ocaml 3.12, which is what
Debian stable has. Use a replacement.

Reviewed By: @joelbeales

Differential Revision: D1458292
adjust whitespace

Summary: Oof, apparently we're still not quite done bikeshedding how this appears in the terminal...
I didn't realize someone changed these "still going" messages back into hardcoded \r's.
If we still want the spinner to appear normal when piped through arc build (and
the reason we don't just exec from arc build is so that we can still do timeouts
from arc and --rage if the server is unresponsive) we can't use Tty.clear_line,
so just print extra space after the spinner to prevent ghost spinners when the line
length changes.

these false positives are really persistent...

Reviewed By: @aryx

Differential Revision: D1452303
fix yield/await precedence

Summary: cf title.
The diff introduces 2 errors in www: P6377919

Reviewed By: @gabelevi

Differential Revision: D1190948
Platform specific methods of retrieving current thread id

Summary: already had apple/unix path for retrieving thread id
remove syscall include for windows and added
pthreads and windows threads specific versions of getting current thread id

All changes in ifdefs

Reviewed By: @jdelong

Differential Revision: D1458541
Increase stack size limit for cygwin

Summary: Default stack size limit for compiled code for windows is small
windows limits can only be set at compile time (or with some utils that alter pe files, but that's painful)
increase it to the minimum the application expects with the proper linker flag for cygwin

Reviewed By: @ptarjan

Differential Revision: D1458988
getrlimit/setrlimit adjustments for cygwin

Summary: stack size cannot be set on windows (cygwin always returns -1)
although cygwin can have core dump size set (it handles cores through compat layer) other windows cannot
some rlimit values are not available on all systems, check for existence

Reviewed By: @jdelong

Differential Revision: D1458893
Fix Autocomplete damaging incremental mode

Summary: This fixes the behavior of oldify and revive when we have nothing stored at a key.

-If we try to revive on a key than has no old value, we should remove the current value.
-If we try to oldify something that has no value, we should remove the current old value.

Also added missing cache removal when we revive.

I'm not completely sold on relying on revive/oldify for autocomplete/other tools functionality in general. It might be more maintainable (but slower... doesn't seem like the perf hit here would really matter though) to take the classes/funcs out of shared memory and store them when we start, and then put them back when we're done, rather than relying on the good versions being 'one step back' in shared memory.

Reviewed By: @pikatchu

Differential Revision: D1458889
update hhvm-third-party hash to latest
update third-party hash after folly cmake hack to fix build