Gráfico de Commits

22 Commits

Autor SHA1 Mensagem Data
Andrei Alexandrescu cfee94b1fc CStrRef sucks
This is the first step of a larger campaign of eliminating goofy types from our codebase. Typedef-ing a reference is unrecommended because references are not first class types and therefore things like construction and copying may do unexpected things. In fact search this diff for 'reinterpret_cast' to see some very odd stuff.

Destroy!

Reviewed By: @jdelong

Differential Revision: D983915
2013-10-02 11:01:08 -07:00
Anton Lunyov 381ab20c73 Hack collections support in json_decode
Two custom flags for json_decode are added:
 - FB_JSON_COLLECTIONS to output Vectors/Maps instead of arrays
 - FB_JSON_STABLE_MAPS to output StableMaps instead of Maps

Differential Revision: D950743
2013-09-06 17:52:39 -07:00
Jordan DeLong 64ca1fc194 Clean up StringBuffer a bit
Privatize several public functions, remove some redundant
functions, make some things non-members (appendJSONEscape), remove
DECLARE_BOOST_TYPES, and document contracts; also some gratuitous
style changes.  I was initially planning to make it include the null
in its capacity, but since capacity is not exposed anywhere I think
it's fine as is.  (And eventually we don't want to require the null
when handing off to String---only when people call data()---but that
is a separate project.)

Differential Revision: D931746
2013-08-27 11:58:31 -07:00
Andrew Gallagher b75d29d968 hphp: fix bug in JSON parser
gcc-4.8 exposed this issue via the end-of-array-subcript warnings.
The issue is that the top pointer is incremented before that check
to see if the push should happen.  If the push failed, the top
pinter is left incremented.

Differential Revision: D923932
2013-08-13 14:24:31 -07:00
Edwin Smith 251ebf9685 Rename files in runtime/base, part 7
Differential Revision: D913883
2013-08-05 14:42:18 -07:00
Edwin Smith 355a49c38f Rename files in runtim/base, part 5
Differential Revision: D913077
2013-08-05 14:42:17 -07:00
Edwin Smith 98fdfc266b Rename files in runtime/base, part 4
type_* and tv_*

Differential Revision: D912522
2013-08-05 14:42:13 -07:00
Edwin Smith 0b6b336922 Rename _ to - in runtime/base, part 2
Differential Revision: D912410
2013-08-05 14:42:11 -07:00
Jordan DeLong 0fa12ac543 Move JSON_parser stuff out of global namespace 2013-07-26 11:31:19 -07:00
Jordan DeLong b38e53d0e7 Add "static" to most InitFiniNodes
Some of them were neither static nor in an unnamed namespace.
2013-07-26 11:31:19 -07:00
Joel Marcey b951f3b42d Implement json_last_error for PHPUnit
PHPUnit calls json_last_error. We need to implement it. Also implemented a simple json_last_error_msg to bring it up to 5.5 parity in that regard. This current implementation does not bring all the json zend tests to passing. But 2 out of the 22 bad tests now pass. And, this allows the PHPUnit self test to run as well.
2013-07-22 11:34:07 -07:00
Edwin Smith 721f89b890 Flatten directories under runtime/base
This moves runtime/base/*/* to runtime/base, and fixes paths.
2013-07-18 17:28:35 -07:00
Drew Paroski 1ee3810e21 Small cleanup for ObjectData and a few other things
This diff addresses most of the diff review feedback from D740016.
2013-07-06 11:12:24 -07:00
Paul Tarjan 140c537a90 add JSON_UNESCAPED_UNICODE
This is giving warnings on wikimedia and was implemented in 5.4
2013-06-15 23:32:07 -07:00
Drew Paroski e6b6aa0b09 Clean up the hphp/system folder
I noticed that directorty structure of hphp/system was a bit scattered, so
I consolidated things to reduce the total number of folders and to put
related things together with each other.

This diff moves the contents of "hphp/system/classes_hhvm" into
"hphp/system", it moves the contents of "hphp/system/lib" into
"hphp/system", moves "hphp/idl" to "hphp/system/idl", and moves the
contents of "hphp/system/globals" into "hphp/system/idl".
2013-06-15 23:29:49 -07:00
Owen Yamauchi f537fa7cc1 JSON parser: fix empty dictionaries inside of dictionaries
I broke this with my change to stop boxing everything. It was dropping
empty dictionaries inside dictionaries, because the "}" of empty
dictionaries is a different parser action from the "}" of nonempty
dictionaries, and I'd neglected to update it. (The fact that no tests
caught this before is a little unsettling.)
2013-05-20 13:52:33 -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
Owen Yamauchi a6663759d2 Stop boxing everything in the JSON parser
The JSON parser was producing structures that held all arrays in
RefData. This was to defeat copy-on-write, since ArrayDatas were
referenced from multiple places (i.e. the parser's internal stack of
in-flight objects, and the actual structure being built) and mutated. I
rectified this by not adding arrays into the overall structure until
they're done being modified. This necessitated introducing a separate
stack for keys, to handle this structure:

  { "key": { ... } }

When we see the opening { of the inner object, we push "key" onto the
stack, so that when we see the closing } of the inner object, we can
store it into the outer object under the right key.
2013-05-10 10:54:37 -07:00
andrewparoski 5b8111f402 Chip away at ClassInfo::FindClass() and ObjectData cruft 2013-04-01 11:51:31 -07:00
aalexandre 505c17f357 replaced null with uninit_null() 2013-03-18 16:05:53 -07:00
aalexandre d09fd3e421 inttypes conversion broken down by steps.
Per @mwilliams' suggestion, this is the first stage in a staggered approach to replacing int64 with int64_t. More precisely I inserted "typedef ::int64_t int64;" in util/base.h and dealt with the consequences.
2013-02-11 06:07:07 -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