Gráfico de Commits

15 Commits

Autor SHA1 Mensagem Data
Andrei Alexandrescu a2e76eb7b2 Eliminate static noise from .h files
The codebase had several namespace-level static data definitions and function definitions. Using namespace-level "static" in a .h file is near-always a bad idea, as follows:

  - for simple types, static is implied. Example: "const int x = 42;" is the same as "static const int x = 42;"
  - for aggregate types, static linkage implies that a copy of the aggregate will appear in every compilation unit that includes the header.
  - for functions, static means the function will have a separate body generated in each compilation unit including the header.
  - in several places functions were defined 'static inline', which is just as bad. 'inline' is just a hint which means the function may end up having a body (and actually more due to 'static').

True, gnu's linker has means to remove duplicate definition, but that's not always guaranteed or possible (think e.g. static functions that define static data inside, ouch). So static is useless at best and pernicious at worst. We should never, ever use static at namespace level in headers. I will create a bootcamp task for a lint rule.

I expected the performance to be neutral after the change, but in fact there's a significant drop in instruction count and therefore a measurable reduction in CPU time: https://our.intern.facebook.com/intern/perflab/details.php?eq_id=431903
2013-06-06 11:39:13 -07:00
Tim Starling 998951619f update copyright date
We did not intend to imply our copyrights last forever

Closes #759
2013-06-03 12:43:56 -07:00
Mark Williams 86d9acaf6e Undo some #include renames
sys/*.h should use angle brackets.
Also, fix most of the lint errors for the affected files
2013-05-15 13:05:10 -07:00
Sara Golemon 6ec64e8bf9 make #includes consistent
I was learning from @jdelong and he said that you should use
double quotes for local includes and angle brackets for library
includes. I asked why our code was the way it was, and he said he wanted
to clean it up. I beat him to it :)

Conflicts:

	hphp/runtime/base/server/admin_request_handler.cpp
	hphp/runtime/vm/named_entity.h
2013-05-15 13:05:06 -07:00
Sara Golemon 497a22c04f Fix endianness for all tiger algos
The PHP version the implementations in hphp were based off of
had wrong byte ordering.  Fix them in line with PHP having been fixed.
2013-05-06 10:31:24 -07:00
Sara Golemon 2dcca1dded Add fnv1a?(32|64) hash algos
Split out of my previous "fix varios hash algos" diff.
This diff adds the fnv132, fnv1a32, fnv164, and fnv1a64 algorithms
2013-05-06 10:31:24 -07:00
Sara Golemon c121b10e13 Add SHA224 hash algo
Split out of my earlier "fix varios hash algos" diff
This diff only adds sha224.
The fix for tiger and the add of fnv are in different diffs.
2013-05-06 10:31:24 -07:00
bsimmers 41f2b117ee Revert "Fix varios ext/hash algorithms"
This was causing an unexplainable perf regression.
Revert it for now pending deeper analysis.
2013-04-26 09:31:13 -07:00
Sara Golemon b10a27e178 Generate ext_hhvm/infotabs files on the fly rather than as pre-builds 2013-04-25 15:33:05 -07:00
Owen Yamauchi 781359b60d Rewrite gen_ext_hhvm and gen_infotabs in C++
This is a near-straight translation of gen_ext_hhvm.php into C++. The
main goal of this change is to break the bootstrap cycle in the build
process: we have to run PHP scripts to build our PHP interpreter. This
isn't so bad for us internally, but in the open-source build, it's
philosophically lame to depend on an external PHP interpreter (i.e.
Zend) to build HHVM. To get around this, we have to check in the
generated ext_hhvm files: no good.

There's nothing particularly sophisticated in this program; it's just a
bunch of grunt work. I took the opportunity to make a few improvements
to the generated code -- there was some int-width confusion, and a bunch of
duplicated code to transfer return values to the right place.
2013-04-25 00:50:04 -07:00
Sara Golemon d5ea8ff20f Add PHP 5.5's array_column() function
http://wiki.php.net/rfc/array_column
2013-04-25 00:50:00 -07:00
Sara Golemon 182995353f Fix varios ext/hash algorithms
Added sha224 algo (derivative of sha256)
Added fnv132, fnv1a32, fnv164, fnv1a64 algos
Fixed tiger* finalization (endianess was backwards)

I fixed the endianness of tiger*,* and added Zend's
unit tests, but I forgot to update these tests.
2013-04-25 00:50:00 -07:00
Jordan DeLong 3db2140e3e Fix some cpplint errors about illegal symbols
Various perling.
2013-04-22 14:43:49 -07:00
aalexandre 26178124a4 Eliminate int32, uint32, int16, uint16, int8, uint8.
This concludes the inttypes replacement.
These replacement have been mostly mechanical
with the use of cxx_replace.
2013-03-09 10:25:16 -08:00
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00