Consolidate ContDone into ContRetC
Merge ContDone+ContExit into ContRetC with added support of passing results. This variable passing mechanism is not exposed to the PHP as the ReturnStatements in generators do not contain result expression. However, this is exposed by restored hphp_continuation_done() built-in to allow experimentation. The idea is that once we introduce ContYield opcode (merge of all opcodes used by YieldExpression), we could change ContRetC and ContYield to leave result and done-status on the stack and leave it up to the caller (ContNext/ContSend/ContRaise) to fill in Continuation fields. This will make these opcodes more generic and useful for other things, while allowing us to move some properties to the VM and kill opcodes like ContCurrent.
Esse commit está contido em:
@@ -3650,10 +3650,12 @@ ContReceive [] -> [C]
|
||||
sent to the continuation will be pushed on the stack. The value will be no
|
||||
longer referenced by the Continuation object.
|
||||
|
||||
ContDone [] -> []
|
||||
ContRetC [C] -> []
|
||||
|
||||
Finish continuation. Marks the continuation in local 0 as finished. Further
|
||||
attempts to iterate it will fail.
|
||||
Return from continuation. Marks the continuation in local 0 as finished, sets
|
||||
the result and transfers control flow to the caller of the continuation body,
|
||||
which must be a non-static method of the Continuation class. Further attempts
|
||||
to iterate it will fail.
|
||||
|
||||
ContNext [] -> []
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário