Enable most optimizations on loopy translations.

Summary: Only refcount-opts is disabled.

Reviewed By: @ottoni

Differential Revision: D1531690
Correct spelling of 'pseudomain'

Summary: We had it as psuedomain in several places.

Reviewed By: @bertmaher

Differential Revision: D1536955
Add runtime support for null-safe method call operator "?->"

Summary: Hack supports instance method calls via the "->" operator, which throws if
the base is null (or any non-object type). This diff adds HHVM runtime
support for null-safe instance methods calls via a new operator "?->".

Method calls using the "?->" operator will return null if the base is null.
If the base is non-null, the "?->" operator behaves the same as "->". For
now using the "?->" operator to access properties not support and will
cause an error at parse time, though support could be added in the future
if desired. At present the "?->" operator punts to the interpreter when the
base is null; JIT support will be addressed in a separate diff.

Reviewed By: @elgenie

Differential Revision: D1524304
Don't drop FP in FrameState when entering a loop header.

Summary: Now that we only have one FP per frame, we no longer need this.

Reviewed By: @ottoni

Differential Revision: D1531721
typechecker: report error codes for hh_client / json (2/2)

Summary: ... when no --from argument is supplied, the error printing
 goes down a different path. After this diff, that path includes the
 error code at the end of the line for the primary error. So:

  <file>:54,56: Invalid argument (Typing[4110])

 The json output also gains a "code" field.

Reviewed By: @jwatzman

Differential Revision: D1537048
typechecker: annotate explode()

Summary: ... it's common enough that it should catch errors. There's one case (empty delimiter) where ##false## is returned, but that's not sufficiently common to matter.

Reviewed By: @jwatzman

Differential Revision: D1536358
Add typechecker support for null-safe method call operator "?->"

Summary: Hack supports instance method calls via the "->" operator, which throws if
the base is null (or any non-object type). This diff adds Hack typechecker
support for null-safe instance methods calls via a new operator "?->".

Method calls using the "?->" operator will return null if the base is null.
If the base is non-null, the "?->" operator behaves the same as "->". For
now using the "?->" operator to access properties not support and will
cause an error at parse time, though support could be added in the future
if desired.

This diff follows the scheme suggested by@jwatzman, where "?->" is
converted into a ternary expression during the naming phase, which has the
advantage that it avoids the need to update typing logic or other code that
works with the naming ast (nast).

Reviewed By: @elgenie, @jwatzman

Differential Revision: D1524942
Initial vasm -> llvm backend

Summary: This can't emit any useful code yet, but I'm going to spend some time
working on vasm before I can make more progress so I'd rather get this in
now. It contains shell code to convert vasm to llir and emit machine code from
that, with support for punting if an unsupported operation is encountered. I
wrote up maybe-correct translations for a couple instructions and verified that
llvm is able to at least emit some code into a, and we're able to rewind the
frontier and then emit real code using vasm-x64.

Reviewed By: @jasone

Differential Revision: D1534862
Remove dead field from ActRec.

Summary: Comment says this was used by debugger macros, but grepping for
"m_savedRbp" or "Rbp" shows nothing.

The field was part of a union, so the size of ActRec hasn't changed.

Reviewed By: @markw65

Differential Revision: D1537639
Trivial improvements to hphp/test/frameworks/perf

Summary: - fix markdown formatting in 'Usage' section of README.md
- make Usage section say bin/php-cgi, not bin/php
- make Usage section say it will run as a regular user
- specify a log file (/dev/null) to siege in warmup mode
- add a timestmap to print_progress

refs facebook/hhvm#3664

Reviewed By: @JoelMarcey

Differential Revision: D1536535
Add sanity test system to OSS benchmarker

Summary: Check that we're getting an expected substring in the response.

Reviewed By: @JoelMarcey

Differential Revision: D1536933
Fix double deallocation of object in zend conversion of object to string

Summary: fixes #2844

runtime/ext_zend_compat/hhvm/zend-wrap-func.cpp line 80 - 102 deallocates the object twice.
The first time is when the object is parsed as a string, and the second time is in
frame_free_local_inl.

parse_arg_object_to_string is only called from one place, so I don't think it will have
side effects on other code.

Reviewed By: @ptarjan

Differential Revision: D1526334
Add manpages for conversion tools

Summary: Last two. These are very minimal -- their usage really requires
a holistic description of the conversion process, for which I heavily
encourage readers to look at the HHVM docs site instead.

Reviewed By: @elgenie

Differential Revision: D1537420
Makes <<__Memoize>> work with arbitrary args

Summary: This is the last piece needed to make <<__Memoize>> a full replacement for DynamicYield.

For serialization, I chose to extend fb_compact_serialize for a couple reasons. The main reason is that it's nearly ideal for this purpose. It runs in one pass with a StringBuffer (as opposed to two passes one for length, one for serialization with fb_serialize). It also correctly handles differentiating falsey types and produces shorter strings than either fb_serialize or json_encode for faster lookup. The only two parts that were not ideal were the fact that it doesn't throw on error, and can't handle objects. Those are the two things I modified. I think I extended an existing pattern, but let me know if I should move the implementation somewhere common.

By the way, IKeyableObjectUtils does a pass through input arrays to look for serializable objects, copying the input array in the process. Once this is in, it would be interesting to see if IKeyableObjectUtils::serialze() could be turned into a wrapper to HH\serialize_memoize_param(). There are other places than DynamicYield that use IKeyableObjectUtils::serialize(), and this is bound to be faster.

Reviewed By: @jano

Differential Revision: D1526762
OSS perf: add another MySQL grant, make instructions clearer

Summary: Feedback from joelp and rrh.

refs facebook/hhvm#3664

Reviewed By: @JoelMarcey

Differential Revision: D1539137
Change ports to less-frequently-used ones

Summary: :8080 is very commonly used - fbide grabs it, as does something on rrh's machine.

Reviewed By: @JoelMarcey

Differential Revision: D1539501
Fix some typos in manpages.

Summary: As subject.  Tyops are bad.

Reviewed By: @jwatzman

Differential Revision: D1539805
Make OSS perf runner complain if ports needed are in use

Reviewed By: @JoelMarcey

Differential Revision: D1539467
Added the PHP port of several of Google's Octane suite of benchmarks.

Summary: I've ported the Octane benchmark harness (see: https://developers.google.com/octane/benchmark) and several of the Octane benchmarks to PHP. This is handy for comparing the performance of HHVM to other PHP implementations as well as to other dynamic language implementations like V8/JavaScriptCore.

Reviewed By: @ottoni

Differential Revision: D1534471
Capture entire interim work on hhvm tree.
This contains speculative and potentially incorrect work.

Don't echo json from hotprofiler return if are using External profiler.
Have hphp/test/run use the flags to run NewRelic profiler.

Don't compile for profiling.  The newrelic.so can be compiled for profiling.

update third-party