Gráfico de Commits

21 Commits

Autor SHA1 Mensagem Data
jan 3adce96fdc Remove markCurrentAs{Succeeded,TailCall}
Tail calls were eliminated, results are set thru ContRetC opcode, these
functions are no longer needed.
2013-03-28 12:02:53 -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
Alex Suhan b41346c929 Fix ext_asio callback checks
The callback passed to asio_set_on_{failed, started}_callback was
never null because the way types for input parameters work in
extensions. Null from user PHP code was converted to a stdClass
object, triggering an exception.
2013-03-25 13:31:09 -07:00
jan 10b770d342 Simplify hphp_unpack_continuation
Do not generate yield labels as normal goto labels in the parser. Create
them at YieldExpression and use m_yieldLabels array in emitter.
2013-03-25 12:43:42 -07:00
jan 06713e6226 Eliminate transform_yield_break()
The only places where ReturnStatement is constructed are:

- onReturn(check_yield=true) -> not allowed in generator
- onReturn(check_yield=false) -> coming from transform_yield_break, right after creating hphp_continuation_done()
- MethodStatement, end of function call -> hphp_continuation_done() is created at end of generator in prepare_generator()

Emitter is emitting ContExit in ReturnStatements used in generators. As
can be seen from the analysis above, it's always preceded by emitting
ContDone from hphp_continuation_done(). Let's emit ContDone inside the
ReturnStatement directly and kill usage of hphp_continuation_done().

transform_yield_break() becomes a simple onReturn(check_yield=false), so
let's inline it into onYield and create ReturnStatement directly. After
this change, check_yield flag is always true and can be killed.

ContExit was also used after emitting a generator method in case the end
of method is still reachable. ContDone is added so that the generator is
properly closed. I believe this is never actually used, as MethodStatement
creates ReturnStatement at the end of method anyway.
2013-03-25 11:31:17 -07:00
jan 7b7343b56a Introduce YieldExpression
Unhack the parser and introduce YieldExpression that emits the
equivalent set of opcodes that were emitted by bunch of
expressions/statements generated by parser before.

YieldExpression expects evaluation stack to contain just the value
being yielded, so {,List}AssignmentExpression need to evaluate RHS
first. The previous code had the same behavior.

This will let us consolidate continuation-related opcodes and make
them less tied with continuation objects.
2013-03-22 13:01:05 -07:00
philikon d79cb16bfe Implement UConverter::getStandardName()
Making ucnv_getStandardName() available as
UConverter::getStandardName().
2013-03-21 19:23:54 -07:00
mwilliams 737a8c87b1 Cleanup more unused code in Continuation
m_method was unused, and __construct had a couple of
unused parameters. Also bring the idl back into sync.
2013-03-21 17:52:28 -07:00
jan 06aefe7e37 Remove deprecated support for priority in ContinuationWaitHandle::start()
PHP code does not use this anymore. Let's remove the support.
2013-03-21 17:31:09 -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
Alex Suhan 1742a79189 Add on started callback to AsioSession
The PHP code using Awaitable interface will need this.
2013-03-21 15:55:58 -07:00
Alex Suhan 903a2444bc Add Awaitable interface
Our PHP code can be simplified by using a common interface
instead of relying on instanceof for proper dispatch.
2013-03-21 15:01:49 -07:00
andrewparoski a8b6ba6962 Implement Tuple
Implement a Tuple class as part of collections.
2013-03-19 14:11:00 -07:00
aalexandre 505c17f357 replaced null with uninit_null() 2013-03-18 16:05:53 -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
Sara Golemon e0d098ef70 Add http_response_code(), behavior matching Zend 2013-03-09 20:23:28 -08:00
ptarjan 23b681e872 allow closures to be cloned
In HPHPc it didn't allow closures to be cloned but in HHVM it did. When I migrated to a C++ closure then i left the HPHPc code. Zend 5.4 allows them to be cloned so lets go with this.
2013-03-09 14:04:11 -08:00
jan 94f8158ca5 Expose reflection thru API
Expose the following data to the PHP:
- asio_get_current_context_idx(): get current context index
- asio_get_running_in_context(): get running wait handle in a given context
- asio_get_running(): get running wait handle in a current context (renamed asio_get_current())
- WaitableWaitHandle::getContextIdx(): get context the wait handle operates in
- WaitableWaitHandle::getCreator(): get continuation wait handle that constructed this wait handle
2013-03-09 10:50:49 -08:00
mwilliams 4eaf40d7aa Generate g_class_map directly from the idl
This is the last step to being able to get rid of the c++ code
gen in hphp. "make -Chphp/system" is now a no-op.

I'll rip out the actual c++ generating code as a separate diff.
2013-03-08 17:52:31 -08:00