add low memory counters to ods

Summary: add fields for tracking low memory usage to jemalloc stats page. This will get picked up by ods automatically.

Reviewed By: @jasone

Differential Revision: D1537171
Use smart_calloc in NameValueTable

Summary: Don't leak memory.

Reviewed By: @mclarkelauer

Differential Revision: D1545494
More wordpress unfreezing

Summary: sadpanda

Reviewed By: @JoelMarcey

Differential Revision: D1545919
Fix guard relaxation to work with bytecode control flow

Summary: Due to control flow, a local may have multiple type sources at each program point. So change FrameState to keep the set of type sources for each local, instead of a single one. Also, get rid of None type-source kind.

Reviewed By: @alexmalyshev

Differential Revision: D1535860
Fix flush_evaluation_stack

Summary: A test had been inserted to prevent it flushing the stack and rds
for rpc threads; but the test disabled it entirely.

Added a better check.

Reviewed By: @bertmaher, @edwinsmith

Differential Revision: D1545777
Allow vm-stack flushing in rpc threads

Summary: We disabled the flush in rpc threads, on the grounds that the
execution context lives across requests. However, the execution context
is never *required* to live across requests, and could be reset for a
number of reasons at the start of the next request.

So instead, we reset the request, and then flush. This also solves (at
least in practice) the issue of rpc requests keeping treadmill fromd
working.

Reviewed By: @bertmaher, @dariorussi

Differential Revision: D1546288
Add some support for readline.

Summary: I think it would be nice to move parts of hphpd over to PHP-land, and having readline available would help with that.

Reviewed By: @ptarjan

Differential Revision: D1538831
Attempt to fix t5058784

Summary: Avoid a possible race condition with static properties

Reviewed By: @markw65

Differential Revision: D1547427
Fix cmake jemalloc check

Summary: Escaped backslashes or it will fail with "unexpected CAL_symbol, expecting $end"
See 28108aeb
Closes https://github.com/facebook/hhvm/pull/3716

Reviewed By: @sgolemon

Differential Revision: D1547302
Remove some modifications in tests from import_zend_test.py

Summary: These are all invalid now.
Closes https://github.com/facebook/hhvm/pull/3717

Reviewed By: @sgolemon

Differential Revision: D1547305
migrate many callsites from Config::GetFoo to Config::Bind

Summary: codemod -m --extensions cpp '([^ ]*)\s*=\s*Config::Get(Bool|String|Byte|UByte|Int16|UInt16|Int32|UInt32|Int64|UInt64)[(]ini,\s*([^\s]*),\s*([^\s]*)[)];' 'Config::Bind(\1, ini, \2, \3);'

and some manual rebasing to current behavior

Reviewed By: @ptarjan

Differential Revision: D1371389
Add hhvm.pcre.jit ini flag to check build config

Summary: Want the benchmark script to check this.

Reviewed By: @oyamauchi

Differential Revision: D1545388
Add hhvm.build_type ini setting

Summary: Also want the benchmark script to check this === release

Reviewed By: @JoelMarcey

Differential Revision: D1545461
Implement RegexIterator::INVERT_MATCH

Summary: Closes https://github.com/facebook/hhvm/pull/3718

Reviewed By: @sgolemon

Differential Revision: D1547317
Re-fix CMake jemalloc check

Summary: Get rid of backslashes that nobody
fully understands and add 0x to the version
constant, 'cause it's supposed to be hex.

Reviewed By: @fredemmott

Differential Revision: D1547859
Improve siege flags

Reviewed By: @​aravind

Differential Revision: D1548017
Make benchmarking script check HHVM build is suitable

Summary: ```
[fredemmott@devbig076 ~/fbcode/hphp/test/frameworks/perf] hhvm perf.php --toys --hhvm=/data/fio/fbcode/_bin/hphp/hhvm/hhvm
HHVM build is not suitable for benchmarking:
  HHVM build type: Debug
  Required: Release
Existing due to invalid config. You can run anyway with --i-am-not-benchmarking, but the results will not be suitable for any kind of comparison.
[fredemmott@devbig076 ~/fbcode/hphp/test/frameworks/perf] hhvm perf.php --toys --hhvm=/data/fio/fbcode/_bin/hphp/hhvm/hhvm --i-am-not-benchmarking

***********************
** 2014-09-09 21:40:42
** Installing framework

**********************
** 2014-09-09 21:40:42
** Starting Nginx
```

Reviewed By: @JoelMarcey

Differential Revision: D1545572
--wrap is specific to linux's gcc linker

Summary: This broke the Mac OSX build.

Reviewed By: @JoelMarcey

Differential Revision: D1546684
Fix race in user*Handler destruction

Summary: Closes #3329

Reviewed By: @ptarjan

Differential Revision: D1546084
try not to use ThreadInfo::s_threadInfo before it is constructed

Summary: I'm seeing lots of segfaults like:

  0  HPHP::File::TranslatePathKeepRelative(HPHP::String const&) at hphp/runtime/base/file.cpp:62
  1  _M_invoke at hphp/runtime/base/request-injection-data.cpp:144
  2  std::_Function_handler<bool (folly::dynamic const&), void HPHP::IniSetting::Bind<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >(HPHP::Extension const*, HPHP::IniSetting::Mode, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&, char const*, HPHP::IniSetting::SetAndGet<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >*)::{lambda(folly::dynamic const&) 1}>::_M_invoke(std::_Any_data const&, folly::dynamic const&) at third-party2/libgcc/4.8.1/gcc-4.8.1-glibc-2.17-fb/8aac7fc/include/c++/4.8.1/functional:2468
  3  void HPHP::IniSetting::Bind<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >(HPHP::Extension const*, HPHP::IniSetting::Mode, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&, char const*, HPHP::IniSetting::SetAndGet<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >*) at hphp/runtime/base/ini-setting.h:226
  4  HPHP::RequestInjectionData::threadInit() at hphp/runtime/base/ini-setting.h:235
  5  HPHP::RequestInjectionData::RequestInjectionData() at hphp/runtime/base/request-injection-data.h:68
  6  HPHP::ThreadInfo::ThreadInfo() at hphp/runtime/base/thread-info.cpp:52
  7  HPHP::ThreadLocalNoCheck<HPHP::ThreadInfo>::create() at hphp/util/thread-local.h:250
  8  HPHP::ThreadLocalNoCheck<HPHP::ThreadInfo>::getCheck() const at hphp/util/thread-local.h:255
  9  HPHP::init_thread_locals(void*) at hphp/runtime/base/thread-init-fini.cpp:60
  10 HPHP::hphp_process_init() at hphp/runtime/base/program-functions.cpp:1628
  11 HPHP::execute_program_impl(int, char**) at hphp/runtime/base/program-functions.cpp:1431
  12 HPHP::execute_program(int, char**) at hphp/runtime/base/program-functions.cpp:944
  13 main at hphp/hhvm/main.cpp:61

I'm not sure what introduced this recently, but it looks like a legit calling order, and this code I'm changing is probably wrong. Instead of trying to read in the global state, I'll use the local instance as we do in other places while binding other INI settings.

I found this crash going all the way back a month:

-rw------- 1 twsvcscm twsvcscm 4285 Aug  6 15:25 stacktrace.3303.log

Reviewed By: @markw65

Differential Revision: D1546487