Log more events during build and check operations

Summary: Add some logging endpoints in typecheck and build operations.

Reviewed By: @aryx, @jwatzman

Differential Revision: D1492624
Undef error defined by rouge windows headers

Summary: New case of ERROR being defined by windows.h
and killing the cygwin build

Reviewed By: @JoelMarcey

Differential Revision: D1490180
Don't use fast tls on mingw and cygwin

Summary: Mingw and cygwin both use a pthreads layer for it's __thread usage instead of native tls

Reviewed By: @JoelMarcey

Differential Revision: D1500175
Fix issues with empty, chunked response (retry)

Summary: We call sendRaw at the end of a request, which normally causes
headers to be sent (if they haven't already been sent), and does other
"response started" things. If the response is empty, and chunked encoding
has been requested, we skip sending it.

The result is that onSendEnd fails to close the request, and the client
is left dangling until it times out.

Always send, even if the payload is empty.

Reviewed By: @jasone

Differential Revision: D1499733
Cmake fixes on windows

Summary: This fixes two issues

1. the stack size needs to be slightly larger than the requested size in the app since the check is < not <=
2. the generate embed step had entries being double created after a call to make install - keeping the generation as it's own target makes sure that the embed file is regenerated each time so double entries don't occur in the .rc file
3. when debug is on, make huge hhbc-translator.cpp compile with -Og instead of O0 to avoid "string table overflow" bug

Reviewed By: @JoelMarcey

Differential Revision: D1500173
parser: Catch toplevel break / continue

Summary: Top-level break / continue is always an error, so we should catch it.

Fixes T3385884.

Reviewed By: @elgenie

Differential Revision: D1491627
refactored the raise_message code so that all of the specific raises call raise_message

Summary: refactored the way the runtime error functions work. Now all runtime errors functions will call the runtime message function with the appropriate settings.

Reviewed By: @ptarjan

Differential Revision: D1490671
fix DOMDocument_saveHTMLFile

Summary: Sharing files is bad

Reviewed By: @fredemmott

Differential Revision: D1500141
VASM fixes and instruction counts.

Summary: Add counters for HHIR and asm instructions for testing to make
sure vasm doesn't regress instruction counts. Also squashes various
changes to the vasm code itself, from higher up the vasm diff-stack.

Includes two passes: jump optimizations and dead code elimination,
however separate diffs will actually enable these.

fixes:
* Adds checking to make sure we don't assign to a vreg constant.
* moves pretty-printing code to vasm-print.cpp
* print area and predecesesors of each vasm block
* adds a SrcKey field in each Vinstr, for generating bcmaps
  (will probably change this to an IRInstruction*, thx @swtaarrs)
* actually populate bcmaps
* ripped out the area-coalescing logic; even if areas map
  to the same CodeBlock, we still want to order blocks by
  main/cold/frozen.
* only the last block in main can be closed with end{}.
* remove nops (useless copies, etc) after vasm-xls
* handle loop-carried live ranges in vasm-xls (yay, loops!)
* only use xor r,r for explicit ldimm{0}s, not xls-inserted ones.
  (so we don't accidentally clobber flags)

Reviewed By: @alexmalyshev

Differential Revision: D1494657
JSON_NUMERIC_CHECK shouldn't cast keys to numbers

Summary: See php bug 55543
Closes https://github.com/facebook/hhvm/pull/3470

Reviewed By: @fredemmott

Differential Revision: D1500288

Pulled By: svcscm
VASM part 1: convert a few HHIR ops to exersize ldimm,copy,branching

Summary: First in a series of diffs to migrate to VASM. Vauto makes this easy-ish
by collecting vasm instructions, then generating X64 asm when it's
destructor runs. By inserting Vauto uses into wider and wider contexts,
RAII style, more swaths of CodeGenerator can be converted.

Reviewed By: @alexmalyshev

Differential Revision: D1460360
Fix error message and returnvalue in fread

Summary: Closes https://github.com/facebook/hhvm/pull/3374

Reviewed By: svcscm

Differential Revision: D1483009

Pulled By: @fredemmott
Decrease timeout for framework installation commands

Summary: There's a higher level timeout of 300 somewhere. Set to 1 minute less at 240. We successfuly skip if this timeout is hit, but don't if the whole process gets killed

Reviewed By: @ptarjan

Differential Revision: D1498591
Makes HHVM recognize <<Memoize>> and generates a new param and changes the function name

Summary: This is the first part of making a <<Memoize>> attribute.
Specifically, this recognizes the attribute on a method, generates a param to hold the result, and changes the name of the underlying funciton.
It currently throws an error so people don't accidentally stumble upon it. The next step will be to make this work for methods with zero args

The admarket test failure was not possibly related to this

Reviewed By: @ptarjan

Differential Revision: D1490770
Makes <<__Memoize>> work for zero-arg methods

Summary: As the test shows, this works for normal methods, async methods, and overridden methods. It should just take a few tweaks to make it work for static methods. I'll do that in the next diff

As @jano said, these failures are clearly unrelated.

Reviewed By: @jano

Differential Revision: D1496765
Temp fix for cygwin linking

Summary: This is the quick and dirty version of dealing with no __register_frame with windows SEH frame unwind handling
this will be replaced with rtladdfunctiontable when that is ready to go

This allows cygwin to build and link

Reviewed By: @edwinsmith

Differential Revision: D1500365
added new raise_error family functions that skip the top frame of the backtrace.

Summary: There were not functions for raising errors skipping the top frame of the backtrace. Ideally, I would have made this an optional argument to the existing functions, however, the current functions are overloaded with formatting strings and thus that is not simple. This is useful for functions raising errors from systemlib code as otherwise the top frame of the stack will not contain file and line information. See D1486927

Reviewed By: @ptarjan

Differential Revision: D1488146
Updating Xenon to use :: always

Summary: Sometimes it generates -> and sometimes ::, based on how the data was
logged when created.  This will make it consistent.

Reviewed By: @jano

Differential Revision: D1499577
Added support for calling non user errors from systemlib code. This also fixes the lack of file and line info in systemlib trigger_errors

Summary: Added checks for trigger_error that allow the use of E_<USER/WARNING/...> from systemlib functions. This also happens to fix file and line information for some of the warnings raised by systemlib functions. Depends on D1488146

Reviewed By: @ptarjan

Differential Revision: D1486927
ArrayObject::append() should delegate to ArrayObject::offsetSet()

Summary: Match php5 implementation by delegating rather than direct manipulation of internal state.
Fixes issue #3403.
Closes https://github.com/facebook/hhvm/pull/3404

Reviewed By: @fredemmott

Differential Revision: D1486300

Pulled By: svcscm