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:
@@ -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) {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário