util.h sanitization

Fix indenting and attribute name usage in util.h

Reviewed By: @meyering

Differential Revision: D970714
Suport attribute for disabling ASan analysis

Our custom unwinder code is something ASan knows it can't
analyze properly per Google's documentation. Add support for disabling
the checks (and cleaned up macro indentation to be consistent in
util.h.)

Reviewed By: @meyering

Differential Revision: D970675
Move most remaining service request code into its own module

This moves the emitBindJmp, emitBindJcc, and emitBindCall functions, as
well as some supporting players, into a new module
service-requests-x64.cpp. The two functions freeRequestStub and
getFreeStub are still in tx64, but I think that makes sense.

The way this structure is turning out still doesn't sit well with me,
but I can't quite pin down why. At least now all the nasty-looking
helpers for the emitBind* functions are behind a clean module boundary,
and the external interface (in service-requests-x64.h) is pretty clean.

Getting the new file compiling forced me to clean up some includes, and
move DataBlock up to the HPHP namespace (it was in Transl before).

Reviewed By: @jdelong

Differential Revision: D957725
Don't run session shutdown during request event handlers

These things can run user-level PHP and have to occur with a
still-functional ExecutionContext.  Sara and I think it's reasonable
to consider it part of PSP.  Intended to addresses a bug report from
yermo (https://gist.github.com/Yermo/6528678).

Reviewed By: @markw65

Differential Revision: D965421
Allow ConcurrentTableSharedStore to use a StringData for the hashcode when a StringData is provided

StringData carry the hashcode once it has been computed once and it makes sense not to recompute it when accessing ConcurrentTableSharedStore for APC

Reviewed By: @jdelong

Differential Revision: D969504
Debug-fill popped eval stack slots when running in interpreter

Was hoping to catch a bug from D891329.  Only caught a benign
use-after-pop of an ActRec in the unwinder.  Maybe worth it anyway?

Reviewed By: @edwinsmith

Differential Revision: D907772
Use allocm() to make string capacity to be malloc size classes

When a string is big enough to go to malloc, we might as well
use the whole size class malloc gives back.

Reviewed By: @edwinsmith

Differential Revision: D969024
Add some debug assertions in smartMallocSize-related functions

Asserts that the thing being freed came from our allocator
and is not double-freed, and that the size it's being free'd with is
acceptable per the size it was allocated with.

Reviewed By: @edwinsmith

Differential Revision: D970449
Replace remaining SmartAllocator use with the MM() size-specified allocator

Reviewed By: @edwinsmith

Differential Revision: D970490
Fix precoloring read overflow on certain opcodes

For opcodes with a variable number of arguments, if the number
exceeds the number of argument registers, the precoloring hint code will
read overflow.

Reviewed By: @markw65

Differential Revision: D971071
Add HNI constant binding

Global constants pushed directly into the global constants table:

  static const StaticString s_mpi("M_PI");
  virtual moduleLoad(Hdf config) {
    Native::RegisterConstantDouble(s_mpi.get(), 3.1415926535);
  }

While Class constants are queued into a temporary table,
then picked up during PCE emit as Systemlib is parsed:

  static const StaticString s_math("Math");
  static const StaticString s_pi("PI");
  virtual moduleLoad(Hdf config) {
    Native::RegisterClassConstantDouble(s_math.get(), s_pi.get(),
                                        3.1415926535);
  }

.

  <?php
  class Math {
    // PI will be injected here at emit time
  }

Reviewed By: @jdelong

Differential Revision: D963642
Directly restore line table from repo to unit

The line table is a shorter version of the source location table and is needed for run time behavior beyond on-line debugging. When a unit is read from a repo, the line table is converted to a pseudo source location table, which is then converted back to a line table when the unit emitter creates the unit. This line table to source location table to line table conversion seems silly in itself. It also does not round trip faithfully, with the result that code that depends on the line table will behave differently the first time than the second time. This may have be the source of flaky tests in the past. Right now, the debugger's small step flow test fails if run a second time.

This diff gets rid of the conversion and directly propagates the line table from the repo to the unit.

Reviewed By: @mikemag

Differential Revision: D969062
Parameterize host specific test output

hphp/test/slow/ext_collator/1810.php produces output that is host specific. Renamed expect to expectf and replaced the host specific output with %s.

Reviewed By: @ptarjan

Differential Revision: D971536
Fix a bug when FPushFunc throws an exception

We need to create the catch trace before we pop the object,
since we're throwing with the marker set to before this instruction
has started.  Also it needs Refs, because it can invoke the autoload
map code.

Reviewed By: @ottoni

Differential Revision: D970481
f_eval doesn't really work and isn't an extension function; remove it (take 2)

Reviewed By: @ptarjan

Differential Revision: D907074
Convert CREATE_{VECTOR,MAP} from macros to variadic templates

Reviewed By: @andralex

Differential Revision: D970885
Remove SPropCache::lookup since it is dead

Rename lookupIR to lookup in its place.

Reviewed By: @jdelong

Differential Revision: D972020
make stream_set_write_buffer not segfault

If you use proc_open, we get `File` objects that don't have an underlying stream. This shouldn't segfault.

Reviewed By: @jdelong

Differential Revision: D972360
add missing .expect file

I forgot to flatten this in
sosorry

Reviewed By: @jdelong

Differential Revision: D972435
make parse_str more Zend compliant

parse_str should handle its second argument being null

Closes #1063

Reviewed By: @ptarjan

Differential Revision: D971664

Pulled By: @scannell