Unbreak hh tests in trunk

Summary: Support for idx() is now built-in inside Hack. It should also be HHVM
built-in, so this method should not be needed.

Reviewed By: @markw65

Differential Revision: D1640360
Convert SQLite3 to HNI

Summary: fixes #3965

Reviewed By: @ptarjan

Differential Revision: D1615600
Convert thread to HNI

Summary: fixes #3967

Reviewed By: @ptarjan

Differential Revision: D1615782
Convert XML to HNI

Summary: fixes #3971

Reviewed By: @ptarjan

Differential Revision: D1615864
Convert XMLReader to HNI

Summary: fixes #3972

Reviewed By: @ptarjan

Differential Revision: D1615944
Increase JitPGOThreshold to 100

Summary: Although I wanted to have a higher threshold to allow collecting more
profiling information before producing optimized translations, we
initially settled with a threshold of only 10 based on perflab
experiments.  Now that perflab got smarter about HHVM warmup, it seems
to like 100 better.  (I also tried bumping this up to 1000, but that
didn't seem to provide further wins.)

Reviewed By: @swtaarrs, @alexmalyshev

Differential Revision: D1635551
code cleanup - remove sweep node from StringData

Summary: Remove SweepNode from StringData and make new stringData specific
list node. Remove StringData as friend of MemoryManager

Reviewed By: @edwinsmith

Differential Revision: D1629988
stop ir-opcode-generated from being dirty in my tree

Summary: At Facebook we don't have the top level .gitignore so this has to live in the hphp dir for us to see its benefit.

Reviewed By: @paulbiss

Differential Revision: D1639452
Fixed crash on debug_backtrace() after a declared parameter was unset

Summary: Repro:
1. Pick a function with at least one parameter.
2. Inside the function, unset the parameter, then eval a code that does `debug_backtrace(..)`.
3. Invoke the function.

Failing test:
  src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php

Reviewed By: @markw65

Differential Revision: D1640030
Expose thrift methods to read structs

Summary: The existing thrift methods are great for sending/reading method
calls, but don't work well for thrift processors which need the seqid and
message type that is thrown away by the existing methods. This diff exposes
methods that only read structs and don't expect a message header, for both the
binary and compact protocols.

Reviewed By: @​mcduff

Differential Revision: D1638636
Fix race condition in get_subpat_names()

Summary: A race condition in get_subpat_names() would have caused occasional
incorrect match results and memory leakage. Build the array in a
temporary variable and then atomically swap it in to the shared entry,
instead of overwriting the shared pointer and then progressively building
the array while the cache is in a broken state.

Replace the const_cast with a mutable, since the const_cast is what made
me realise something fishy was going on here. Also make the return value
const, since it points to shared memory, so callers should not modify it
without access to the std::atomic.

Split from D25515 per Bertrand's request.
Closes https://github.com/facebook/hhvm/pull/4067

Reviewed By: @bertmaher

Differential Revision: D1640291
Have BCMarker::operator== take a const BCMarker&.

Summary: It was taking a BCMarker, which wreaked havoc with gdb. Running
a.BCMarker::operator==(b) was returning false, even when
memcmp(&a, &b, sizeof(BCMarker)) was returning 0 (all in gdb).

Reviewed By: @bertmaher

Differential Revision: D1636559
Construct IRBuilder with a BCMarker.

Summary: We're passing in a stack offset and a Func*, this sounds like a BCMarker.

Reviewed By: @ottoni

Differential Revision: D1641166
Silence warning from CMake Policy CMP0026

Summary: get_target_property(... LOCATION) is deprecated and
throws a warning as of CMake 3.0.0.  Switch to using the generator
expression $<TARGET_FILE> instead to silence the warning.

Reviewed By: @JoelMarcey

Differential Revision: D1641895
Implement missing stream metadata for chmod, chown and chgrp, lchown and lchgrp

Summary: PHP added stream metadata in PHP 5.4 for chmod, chown, chgrp, lchmod and lchgrp.
http://php.net/manual/en/streamwrapper.stream-metadata.php

Closes #3687. Closes #4027.
Closes https://github.com/facebook/hhvm/pull/4031

Reviewed By: @ptarjan

Differential Revision: D1629484

Signature: t1:1629484:1414509316:a2f3ceafa61520133dc25f6d58689e156d1fdad3
Fix bug in reffiness checks

Summary: If the mask was all 0s for the second set of 64 parameters, the
nParams SSATmp would be wrong in the following 64-parameter sets.

Reviewed By: @markw65

Differential Revision: D1642597

Signature: t1:1642597:1414504664:f403a7da0170c8a1b83599ef4aef39e7d34590bc
Add a runtime option to limit the maximum number of bytecode instructions in a region

Summary: And enforce it in the region selectors.  The goal of this is to
prevent forming very large regions that are too expensive to JIT.

Reviewed By: @markw65

Differential Revision: D1640217
Shrink collection type field to 8 bits.

Summary: Preparing to either combine it, or overlap it, with ArrayKind.

Reviewed By: @jdelong

Differential Revision: D1641901
Add OSS support for benchy

Summary: This diff adds the ability for open source HHVM to run benchy.
There were a number of build system fixes that needed to be made to
enable out-of-source CMake builds.

Reviewed By: @jdelong

Differential Revision: D1640037
Make autocomplete work with nullsafe operator

Summary: The issue is that the nullsafe operator doesn't work for properties.

$thing->AUTO332 (the autocomplete token) looks like a property.

We were stopping in naming if we had ?-> accessing a property. This makes it add the error, but now it also keeps going now, so that autocomplete works.

As a side effect, we'll get more errors now if accessing a property also produces a typing error.

In a future diff, I'll make the nullsafe operator autocomplete not include properties.

Reviewed By: @jwatzman

Differential Revision: D1630608