diff --git a/hphp/compiler/analysis/emitter.cpp b/hphp/compiler/analysis/emitter.cpp index 7a7cc2d74..60667a706 100644 --- a/hphp/compiler/analysis/emitter.cpp +++ b/hphp/compiler/analysis/emitter.cpp @@ -3941,17 +3941,14 @@ bool EmitterVisitor::visitImpl(ConstructPtr node) { visit(y->getExpression()); emitConvertToCell(e); - // pack continuation and set the return label + // suspend continuation and set the return label assert(m_evalStack.size() == 1); m_metaInfo.addKnownDataType( KindOfObject, false, m_ue.bcPos(), false, 1); - e.PackCont(2 * y->getLabel()); - - // transfer control - assert(m_evalStack.size() == 0); - e.ContExit(); + e.ContSuspend(2 * y->getLabel()); // emit return label for raise() + assert(m_evalStack.size() == 0); e.Null(); m_yieldLabels[2 * y->getLabel() - 1].set(e); diff --git a/hphp/doc/bytecode.specification b/hphp/doc/bytecode.specification index 24c25671f..64d5a9603 100644 --- a/hphp/doc/bytecode.specification +++ b/hphp/doc/bytecode.specification @@ -3683,8 +3683,8 @@ ArrayIdx [C C C] -> [C] CreateCont [] -> [C] Creates a Continuation object and pushes it on the stack. The Continuation - will capture all defined local variables in the current function. The - Continuation will store a reference to the function named by the string + will capture all defined local variables in the current function. The + Continuation will store a reference to the function named by the string immediate to be used as its body. ContEnter [C] -> [] @@ -3694,11 +3694,13 @@ ContEnter [C] -> [] associated with the $this object of the Continuation object. The value on the stack is sent to the Continuation to be retrieved by UnpackCont. -ContExit [] -> [] +ContSuspend