Remove comment referring to closed task

Differential Revision: D903869
StringData::m_count doesn't need to be protected

Also move private helpers ahead of private data.

Differential Revision: D903874
Some String-related micro cleanups, comments and unneeded function removal

String::set was one of two users of StringData::Escalate.
Leaving the remaining use alone for now until I know where it'll go.
Reordered some members and updated some comments.

Differential Revision: D903882
Remove buildStringData(litstr)

Barely used.

Differential Revision: D903895
(Re)move a few more unused/out-of-place functions on StringData

StringData::getPrecomputedHash was unused.  The
isValidVariableName thing was a thin wrapper on a zend function that
is hardly used, and it shouldn't be a member function anyway.  The
convert_double_helper and convert_integer_helper also shouldn't be
member functions, and the former duplicated buildStringData(double)
too much for me so I removed it.

Differential Revision: D903915
Fix region translator tests

A few of the diffs I rebased onto each other and pushed last
night didn't play nice with each other.

Differential Revision: D908416
Fix bug in mysql_next_result's return value that confused "done" with "error"

The MySQL documention states that mysql_next_result's return
values are:

0	Successful and there are more results
-1	Successful and there are no more results
>0	An error occurred

However, we were casting it to a bool, meaning errors and "all done"
were mixed into the same result.

This diff brings back the full error range.

Differential Revision: D907075
Remove now-redundant convCellToBoolHelper

It's just cellToBool.

Differential Revision: D903823
Store CppCall objects instead of TCAs from native-calls.cpp

I did this because I thought we couldn't call member
functions the way things are, but apparently the direct interface
check stuff was already doing it, just with appropriate casting
through Util::getMethodPtr.  This still seems nice though, so I'm
putting it up (less casting in the actual table...).

Differential Revision: D903831
Directly call several conversion functions from the TC

Skip little wrapper functions for few non-virtual member
functions, and add support for immediates to native-calls so we can
call StringData::toInt64 directly with the defaulted argument.

Differential Revision: D903835
Cut down some on cgCallHelper overloading

Factor destType and the destination register/ssa situation
into one parameter instead of a family of up to 3.  Remove the TCA
overload (casting to TCA at every callsite is no more convenient than
making a CppCall at every callsite).

Differential Revision: D903862
Convert LdGblAddrDef to use native-calls

Differential Revision: D903863
Expose specialized class guards to IR

Guards on object class (and, eventually, array kind) need to
load the ObjectData to get at the class.  This is the same operation
as a LdLoc, so if we use that IR instruction to implement the class
guard we can CSE the LdLoc where the object is actually used.

Differential Revision: D906267
Fix isset($string[$k]) and empty($string[$k]) to match PHP 5.5

The behavior of isset($x[$k]) and empty($x[$k]) where $x is a string has
changed in a recent version of PHP. This diff updates HHVM to match PHP
5.5's behavior. Note that HHVM still does not match Zend PHP 5.5 perfectly
in terms of warnings for these expressions; I've decided to put that off
into a separate diff.

This also brings HHVM up-to-date with respect to some edge cases for
automagically converting integer-like string keys to integer keys when
indexing into PHP arrays.

Closes #844

https://github.com/facebook/hiphop-php/issues/844

Differential Revision: D905081
Log unexpected exceptions that occur when carrying out debugger commands

When we hit a breakpoint while processing a CmdEval, we print the line that we hit the breakpoint (which we see), then we send a nested CmdList to the proxy to get the source file. There is no handling of exceptions in CmdList::onServer(), so any exception would bubble out of the server-side command execution. Normally an exception at such a point would cause the proxy to shutdown, but there is a ton of quite general error handling around eval, and it looks like it will swallow the exception and merrily attempt to complete the processing of outstanding CmdEval, thus sending a CmdEval to the client and generating the output we see.

This diff adjusts the code in the catch(...) block in DebuggerProxy::processInterrupt() to log instead of trace, and introduce a similar catch of Exception to dump what we can about the exception. That would give us more data to start to track this very transient problem down.

Differential Revision: D908369
fix license script after zend folder flattening

- don't add zend license to all files in runtime/base
- exclude vixl from license path

Differential Revision: D910454
Delete atomic_dec

Resurrecting this thing I did ages ago. It's mostly similar and
mechanical, except for the stuff in SharedVariant. I got rid of the
anonymous union and struct because that doesn't play nice with the
std::atomic constructor. The static asserts below should give us all the
same guarantees we had before.

Note that I'm freely using operator++ and operator--, which use the
sequentially-consistent memory order for their underlying ops. However,
I've looked on both x64 and ARMv8, and these ops in particular do the
exact same thing regardless of what memory order specifier you pass.

Differential Revision: D909344
Make ctrl-c in hphpd just a little less annoying

Modify ctrl-c handling in the debugger to give up and kill the client after three presses, rather than 10 seconds. Change the wording as ctrl-c is pressed to hopefully be more clear.

Differential Revision: D908728
Do not cache units containing eval code created by debugger

A number of debugger commands end up doing an eval inside the VM. These eval's are ad-hoc and are performed in human time scales. There is no need to cache them. Consequently, call compile_string directly, rather than call it via compileEvalString (which does caching). Also make sure that the result of compile_string is always interpreted so that no JIT caching happens.

In principle, caching ought not to matter, but another bug is causing the JIT to fail an assertion if a cached eval string is recompiled in a context where variables that were bound are no longer bound.

Differential Revision: D904873
Type profiling implementation

I've implemented type profiling in the jit, I added an ir opcode that will log one parameter or return value of a function. I emit that opcode during an FCall, and during a RetC. Each Func object maintains an array of atomic hashmaps (for each parameter), and the atomic hashmaps are basically just counters for each type at runtime.

Differential Revision: D890038