Use int64_t when scanning integers, not int.

Summary: sizeof(int) == 4 means that we'll have overflow on large integers

Closes #3449

Reviewed By: @paulbiss

Differential Revision: D1657453

Signature: t1:1657453:1415121399:a71cf3326274f29caf3b825e7413bea332661cfd
Fixed xpath's php:functionString

Summary: Added CallerFrame before dom_xpath_ext_function_php's call to xmlXPathEvalExpression in case libxml2 needs to call back into HHVM.
The xpath query might contain ```php:functionString``` which triggers a call to any arbitrary php function.

Also fixed a bug where the arguments in an xpath php:functionString were reversed. For example, if the xpath was ```/foo[php:functionString('preg_match', '{$regex}',@​bar)]```, preg_match was being called as ```preg_match($bar, $regex)``` instead of ```preg_match($regex, $bar)```.

Closes https://github.com/facebook/hhvm/pull/4120

Reviewed By: @sgolemon

Differential Revision: D1656106

Signature: t1:1656106:1415132682:3423279074575c41ba3f39136ab2abd3f29ae232
Invert how hh_server gets hhi embeds

Summary: Change some FB-internal build scripts, and add a comment.

Reviewed By: @int3

Differential Revision: D1658042

Signature: t1:1658042:1415126267:110682c52c6711465a9634c6a121adb3d38c285f
Use timelib_diff to calculate datetime intervals

Summary: Fixes #2952

Reviewed By: @JoelMarcey

Differential Revision: D1657306

Signature: t1:1657306:1415077618:3781defe888af49033d1743a7d50aa48612141a0
Convert a few ARM opcodes to DELEGATE

Summary: This is just a few of the easiest ones, to get started with. It helped
to flush out a few issues:

- x64's implementation of DefSP was referring to rbp explicitly, instead
  of the tmp representing the frame pointer.

- ARM was defining a status flag register twice; this looks like a rough
  edge of the conversion to explicit status flags.

Reviewed By: @edwinsmith

Differential Revision: D1658070
Deep initialization for constant properties

Summary: Defined constants may be ref-counted (e.g. resources) and require deep
initialization when used to initialize instance properties.

Fixes #4111

Reviewed By: @fredemmott

Differential Revision: D1658088

Signature: t1:1658088:1415137574:011205e3e604bb711437149f2ef1ed3b3be830b5
Initial sort should be density based

Summary: The initial order of functions influences the final
clustering - so we should use samples/byte, not samples to
sort them.

Reviewed By: @ottoni

Differential Revision: D1657737

Signature: t1:1657737:1415119241:e145694681f86a14ae63a23f73a2011e1dfd6347
Add HH\int/float/bool typehints to PHP

Summary: - Support HH\(string|int|float|bool) in PHP without hhvm.force_hh
- (string|int|float|bool) in PHP without in hhvm.force_hh still refer to classes

These are not intended for direct usage by developers.

Mocking frameworks find the parameter typehints using reflection, then generate
mocks in PHP using the same typehint. 3 ways to fix this came to mind:

 - Always support HH\foo scalar typehints
 - Modify Reflection to not return these
 - Modify these mocking frameworks to filter out scalar typehints

This diff takes the first option.

fixes facebook/hhvm#4021

Reviewed By: @paroski

Differential Revision: D1642075

Signature: t1:1642075:1414634502:1901bd88b334adfa9b0b39925d706675892f6411
Allow systemlib function declarations to use reserved words for function names

Summary: This allows builtin classes to define methods like "include" or "declare".
Necessary for replicating PHP5 extension interfaces in HNI.

  class Foo {
    public function include(string $file): bool {
      include($file);
      return true;
    }
  }

  (new Foo)->include("/bar/baz.php");

Closes #2022

Reviewed By: @paulbiss

Differential Revision: D1658153

Signature: t1:1658153:1415127992:e16e66ff2b5f6bef37e56be7e58d9a0fe86af4d3
Remove uspoof SINGLE_SCRIPT test.

Summary: It's deprecated on ICU >= 51

Closes #3925

Reviewed By: @JoelMarcey

Differential Revision: D1658533

Signature: t1:1658533:1415134838:c7bd38f7fdfed37acbcee497da7e7aed94d16850
Explicitly set -Wno-unused-function in gcc flags

Summary: This should be the default, but for systems
where it isn't, explicitly say so.

Closes #2515

Reviewed By: @JoelMarcey

Differential Revision: D1658664

Signature: t1:1658664:1415134757:d4d26bec54469d0bee379d4134c4d3c3e98b3dd1
Suppress compilation error by undefining basename macro

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

Reviewed By: @sgolemon

Differential Revision: D1658567

Signature: t1:1658567:1415147482:2d83b43e9b00743f939bf36f4377114bdd2568a7