Streamline NewTuple and NewArray helpers

Rearrange the code so when we allocate an array from JIT code,
we call one helper where most of the code is inline.

Differential Revision: D917956
Esse commit está contido em:
Edwin Smith
2013-07-26 19:11:06 -07:00
commit de Sara Golemon
commit 860d410367
8 arquivos alterados com 32 adições e 35 exclusões
+4 -5
Ver Arquivo
@@ -3424,18 +3424,17 @@ inline void OPTBLD_INLINE VMExecutionContext::iopArray(PC& pc) {
inline void OPTBLD_INLINE VMExecutionContext::iopNewArray(PC& pc) {
NEXT();
// Clever sizing avoids extra work in HphpArray construction.
auto arr = ArrayData::Make(size_t(3U) << (HphpArray::MinLgTableSize-2));
m_stack.pushArray(arr);
auto arr = ArrayData::MakeReserve(HphpArray::SmallSize);
m_stack.pushArrayNoRc(arr);
}
inline void OPTBLD_INLINE VMExecutionContext::iopNewTuple(PC& pc) {
NEXT();
DECODE_IVA(n);
// This constructor moves values, no inc/decref is necessary.
HphpArray* arr = ArrayData::Make(n, m_stack.topC());
auto* a = HphpArray::MakeTuple(n, m_stack.topC());
m_stack.ndiscard(n);
m_stack.pushArray(arr);
m_stack.pushArrayNoRc(a);
}
inline void OPTBLD_INLINE VMExecutionContext::iopAddElemC(PC& pc) {