Gráfico de Commits

32 Commits

Autor SHA1 Mensagem Data
jan 6822bc55cc Early release of m_received value
Continuation::send() uses m_received field to transfer the value inside
the continuation. This field remains set until the continuation is
iterated the next time.

Unset this field early by ContReceive so that the memory can be
reclaimed.
2013-03-28 11:05:42 -07:00
andrewparoski ee2d13b031 Add add() API for collections 2013-03-27 17:38:50 -07:00
andrewparoski d61c30ded8 Add containsKey() API 2013-03-27 15:56:06 -07:00
andrewparoski bb2df58a2f Add items(), keys(), and fromItems() APIs for collections 2013-03-27 15:30:16 -07:00
mwilliams 4c6cb0a577 Fix getContextClassName and getParentContextClassName
They both returned the late static bound class, not the context
class. This meant that eg "constant('self::FOO')" was actually
returning what "constant('static::FOO')" should have done.

In addition, we often want the Class*, not its name, so
change them to return Class*. The remaining places that then
read the name from the Class* should be fixed to use the Class*
directly (in a later diff).

Finally, noticed that while "defined()" was recently fixed to
support "static::", "constant()" was not. Pulled out a common
function to find the correct Class*.
2013-03-25 13:31:17 -07:00
philikon d79cb16bfe Implement UConverter::getStandardName()
Making ucnv_getStandardName() available as
UConverter::getStandardName().
2013-03-21 19:23:54 -07:00
ptarjan 4d7004e955 :Allow $this on closures
In Zend 5.3 they decided that closures should inherit the ##$this## from the containing scope. This brings us close to paraity with them. The remaining thing is to make

    function() use ($this) {}

fatal after we purge it from WWW.
2013-03-21 16:50:12 -07:00
andrewparoski a8b6ba6962 Implement Tuple
Implement a Tuple class as part of collections.
2013-03-19 14:11:00 -07:00
Sara Golemon 2027ae7e7e array_keys($arr) and array_keys($arr, NULL) should behave differently
In Zend, the latter form only returns keys which have a NULL
(or NULL-like if $strict==false) value.  The former returns all keys.
2013-03-18 15:12:15 -07:00
bsimmers 0f9b92c2bb Implement known property offsets in VectorTranslator
This diff implements VectorTranslator::emitPropSpecialized and uses it
in three places: emitProp, emitSetProp, and emitCGetProp. The new test case in
test_code_run.cpp used to crash TranslatorX64; now it throws a fatal to keep
things simple. VectorTranslator has better control flow support at its disposal
and is able to get that case right.
2013-03-15 09:07:30 -07:00
andrewparoski cc858b73db Collections updates
Replace "collection" with "collections" in various file names since
we typically use the plural form in conversation and documentation.

Add set() and removeAt() methods needed for collection interfaces. Also
add the KeyedIterable and KeyedIterator interfaces.

Add __construct() methods for collections
2013-03-14 14:27:16 -07:00
hermanv 96350d1a66 add support for late bound constants to the defined function
The defined function did not have code to deal with "static::const" expressions. Added the necessary logic.
2013-03-12 14:22:14 -07:00
Daniel Sloof e3c7403906 Support $classname parameter to simplexml_load_string/file
Argument was being ignored.  Allow specifying
custom children of SimpleXMLElement.
2013-03-09 16:41:07 -08:00
ptarjan fd2f07d1f1 Revert allowing $this in closures
I'm going to do a replacement diff anyways, so all this does is delays it a week.
2013-03-09 12:49:43 -08:00
mwilliams 10f9f6b239 const bool hhvm is dead 2013-03-09 12:49:37 -08:00
mwilliams a4c6fec8e9 Get rid of lots of non-hhvm code
Kill #ifdef HHVM
Kill lots of unused code
2013-03-08 18:44:01 -08:00
mwilliams c59f2ae71f Remove outputCPP support from hphp 2013-03-08 17:52:38 -08:00
andrewparoski 2fe9a69916 Support == and != for collections
Support == and != operators for collections. Also fix some bugs the <, <=,
>, and >= operators when comparing two objects or when comparing an array
with an object.
2013-03-08 17:52:30 -08:00
mwilliams 7e321f8d5a Fix uninitialized variable
chars_len holds the capacity of the buffer on input,
and is filled in with the number of chars written.

It was not being set, causing random behavior (including
potential buffer overrun). The testcase actually relied
on it being set to a too-small value.
2013-03-07 21:29:29 -08:00
andrewparoski 9be42ffc84 Fix weakRemove() to handle collections 2013-03-06 11:15:50 -08:00
mwilliams ecdd06cebe Fix array_walk_recursive test
It wasnt testing what it was supposed to
2013-03-05 22:27:43 -08:00
Nick Harper 5744173e90 Fix array_walk_recursive() recursion check
We only have recursion if what we're currently looking at is the same as
one of its parents in the nested arrays. We don't need to keep track of
everything that's been seen, only the elements seen in a path down to that
element.
2013-03-05 22:27:43 -08:00
ptarjan 8c6d77deef Put the body of a closure on the class intead of in the __invoke of the closure
Instead of having the body of the closure be in the ##__invoke()## on the ##Closure## class, instead we make an anonymous function on the real class and put the body there. The signature for this function is:

  function methodForClosure$1234($arg1, $arg2, ..., $use1, $use2, ...)

and then ##__invoke## now just takes all the params that were passed to it, puts them as the first args to the anonymous function, then takes all the use variables it had saved up and passed them in as the next params.

I tried to not have an ##__invoke## at all, but I ended up basically doing the same parameter and use var repacking in iopFCall (and would have had to do it in x86 code too). I opted for doing the rejiggering in bytecode. If I did it in raw PHP I think it would have been much slower with many ##func_get_args()## and array operations.
2013-03-05 22:07:56 -08:00
bsimmers a9a021e739 Turn on HHIRDisableTx64 for IR automated tests 2013-02-19 13:41:27 -08:00
Sara Golemon c1a8c937f1 Add support for user-defined streams wrappers 2013-02-19 13:41:26 -08:00
aalexandre b3b41e08bb Replaced NULL with nullptr 2013-02-19 06:57:54 -08:00
andrewparoski bc6703d03f Improve the 'key not present' error message for collections 2013-02-13 06:42:47 -08:00
bsimmers 7fd841e6c1 Limit number of test jobs to 20 max 2013-02-13 06:42:43 -08:00
andrewparoski 4196354f4f Fix parse issues with function types
Fix the parser to handle function types for functions that have no formal
parameters and for functions that take variable arguments.
2013-02-11 06:07:22 -08:00
andrewparoski f7dd399bd6 Fix handling of "$obj->{__FUNCTION__}" and "$obj->{__CLASS__}"
For "$obj->{__FUNCTION__}" and "$obj->{__CLASS__}", we currently don't
recognize __FUNCTION__ and __CLASS__ as "magic constants" and we just use
the literal strings "__FUNCTION__" and "__CLASS__" for the property names.
This is wrong. Same goes for object method calls (ex. "$obj->{..}(..)").

This diff fixes HipHop to recognize magic constants for properties names in
"$obj->{..}" expressions and method names in "$obj->{..}(..)" expressions.
2013-02-11 06:07:22 -08:00
mwilliams 0b586489c9 Remove a too aggressive assert
There was an assert that the statically inferred type was at least
as good as the runtime type. The new test case shows clearly why
that cannot be the case (and we were tripping over this assert
in production).
2013-02-11 06:07:21 -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