Use more ephemeral service requests

Summary: Use ephemeral service requests for BIND_JCC, BIND_SIDE_EXIT and BIND_ADDR.
BIND_CALL is a little more complex, and I'll do it in a separate diff.

Reviewed By: @jdelong

Differential Revision: D1362410
MySQLi port can now take an int-ish string

Summary: Fixes #2823
See f03f434
Closes #2824

Reviewed By: @fredemmott

Differential Revision: D1359972

Pulled By: @JoelMarcey
Make paramters for mysqli->begin_transaction() optional

Summary: Fixes #2838
Closes #2839

Reviewed By: @WizKid

Differential Revision: D1361612

Pulled By: @JoelMarcey
Do not process sleep / external thread events preemptively

Summary: There's not much point in processing I/O events preemptively. Their
process method just moves them from one queue to another queue, so let's
process them only when the queue of runnable resumables is empty.

Makes it easier to move the loop thru runnable resumables to JIT.

Reviewed By: @jdelong

Differential Revision: D1360684
Fix tc-print's handling of bytecode regions

Summary: tc-print has always treated a translation as a single, continuous
range of bytecode instructions. This was almost never true: we've been tracing
through forward Jmps since before tc-print was born. Inlining and PGO have just
made the problem worse. I hacked in rough inlining support a while ago but this
diff fixes it more.

The TC dump now has a list of bytecode blocks contained in the translation
rather than just a starting and stopping offset. Blocks contain a unit md5 (may
differ due to inlining) and a range of bytecode offsets. This is used to print
the correct bytecodes at the beginning of the translation's disassembly. I also
changed the bytecode that we print inline with the assembly to only print
bytecodes that have code directly assigned to them. The previous logic of
attempting to fill in the gaps didn't work when we had more than one block in a
translation, and as a result it often printed some bytecodes that weren't
actually in the translation.

Two more small improvements: guards are now printed in tc-print, and we
shouldn't falsely attribute time spent in the guards to the first bytecode
instruction of the translation anymore.

Reviewed By: @ottoni

Differential Revision: D1362151
Improve type-arith for bitwise operators.

Summary: When it doesn't get two constants it just returns TInitCell. We can do
better than that. php.net says that &, ^, and | will always return an
int, unless both operands are strings, then they will return a string.

Reviewed By: jdelong, eletuchy

Differential Revision: D1360657
Add a really fast API to fetch a custom bool setting from config

Summary: Add a builtin API to return a custom bool setting from
config.hdf. Since this value is constant during the lifetime of the hhvm
process, we can replace the call with the actual value at JIT time.
Note that I'm planning on adding server_get_custom_int_setting and
server_get_custom_string_setting in a follow up diff.

Reviewed By: @jdelong

Differential Revision: D1358762
Assert that VMFP is forced into rbp

Summary: Trying to catch a potential register allocation bug in action

Reviewed By: @jdelong

Differential Revision: D1359461
MysqlResults that have been mysql_free_result()'d should not be valid

Summary: In particular now

```php
mysql_free_result($result);
assert(is_resource($result) === false);
```
This is tested for in a still-failing-for-other-reasons Zend test.
Closes #1946

Reviewed By: @ptarjan

Differential Revision: D1317868

Pulled By: @fredemmott
Merge adjacent T_INLINE_HTML tokens in `token_get_all`

Summary: The scanner splits inline html into 400 character chunks, presumably to prevent it from looking ahead too far. Since some PHP code relies on these inline html tokens being a single token, merge them together in `token_get_all`.

Fixes #2807 and hopefully fixes #2841
Closes #2847

Reviewed By: @fredemmott

Differential Revision: D1363605

Pulled By: @JoelMarcey
improve performance in simplexml

Summary: When casting a SimpleXML element to boolean, we're only concerned with
the object having an XML node, *or* having attributes. Building
attributes is done by sxe_get_prop_hash that also recursively builds the
entire element tree starting from that element.

We shortcircuit when the object has a valid XML node to prevent excessive
amount of object creation when all your program is doing is loading
XML strings and doing read/toBool operations.

Before: http://i.imgur.com/TFFj97u.gif
After:  http://i.imgur.com/3kNpwIM.gif
Closes #2855

Reviewed By: @scannell

Differential Revision: D1364022

Pulled By: @JoelMarcey
add missing include in gperftools build

Summary: When building with -DUSE_GOOGLE_CPU_PROFILER=1, we end up calling into
FileUtil::mkdir, but file-util.h was never included.
Closes #2853

Reviewed By: @fredemmott

Differential Revision: D1364000

Pulled By: @JoelMarcey
Stop HHBBC from assuming class constants are uncounted

Summary: HHBBC assumed class constants are always not refcounted.
However, php5.6 made it possible to make constant values able to store ref counted values.

Reviewed By: @jdelong

Differential Revision: D1360070
Travis refactoring

Summary: - Official stable version: boost 1.55.
- Simplified regexp expressions during tests.
- minor changes

Please check, thanks.
Closes #2848

Reviewed By: @ptarjan

Differential Revision: D1363601

Pulled By: @JoelMarcey
Run skipif files for repo mode tests

Summary: We were just trying to run it without building the repo at all.

While I'm in there, I'm going to make sure there wasn't anything printed on stderr while running a .skipif

Reviewed By: @fredemmott

Differential Revision: D1346226
Remove UNLIKELY from JIT-only places

Summary: These aren't hot enough for micro-optimization so it seems
cleaner to omit the annotations.

Reviewed By: @scannell

Differential Revision: D1363649
Tweaks to improve JIT time with tracelet region selector

Summary: 1) Don't reflow types in tracelet formation's call to relaxGuards.

2) Lazily create exits in HhbcTranslator::guardTypeLocal (should help in general).

Reviewed By: @swtaarrs

Differential Revision: D1364825
Implemented SoapHeader properties

Summary: SoapHeader has public facing properties that can be manipulated. Those properties are undocumented.

Fixes #2822

Reviewed By: @fredemmott

Differential Revision: D1360488
Punt if framep is constant

Summary: Band-aid to prevent crashing; we still need to find out why
we're generating bogus IR.

Reviewed By: @markw65

Differential Revision: D1366150
Implement __toString() for reflection classes

Summary: ReflectionFunction
ReflectionMethod
ReflectionClass
ReflectionObject
ReflectionProperty
ReflectionParameter

Also...
* Found/fixed a crash in ReflectionClass::getOrderedConstants()
* Added missing function ReflectionClass::isIterable()

Closes #1571

Reviewed By: @fredemmott

Differential Revision: D1363317