De-virtualize ArrayData::release.

Of the four horsemen of the SmartAllocator, ArrayData was the only virtual
call. This meant an extra layer of indirection when coming from the TC
to allow the c++ compiler to emit its virtual call, and slightly larger
callsites when using non-generic paths.

While we're moving in this direction, consolidate ArrayData introspection
on its type enum. isSharedMap() was previously implemented with a vtable
slot, and we had no way of asking if an ArrayData was a NameValueTable.
Esse commit está contido em:
kma
2013-03-26 09:35:49 -07:00
commit de Sara Golemon
commit 5e603184f5
11 arquivos alterados com 52 adições e 31 exclusões
+4 -4
Ver Arquivo
@@ -787,7 +787,7 @@ HOT_FUNC
int64_t new_iter_array(Iter* dest, ArrayData* ad, TypedValue* valOut) {
TRACE(2, "%s: I %p, ad %p\n", __func__, dest, ad);
valOut = tvToCell(valOut);
if (UNLIKELY(!IsHphpArray(ad))) {
if (UNLIKELY(!ad->isHphpArray())) {
goto cold;
}
{
@@ -823,7 +823,7 @@ int64_t new_iter_array_key(Iter* dest, ArrayData* ad, TypedValue* valOut,
TRACE(2, "%s: I %p, ad %p\n", __func__, dest, ad);
valOut = tvToCell(valOut);
keyOut = tvToCell(keyOut);
if (UNLIKELY(!IsHphpArray(ad))) {
if (UNLIKELY(!ad->isHphpArray())) {
goto cold;
}
{
@@ -1000,7 +1000,7 @@ int64_t iter_next(Iter* iter, TypedValue* valOut) {
}
{
const ArrayData* ad = arrIter->getArrayData();
if (UNLIKELY(!IsHphpArray(ad))) {
if (UNLIKELY(!ad->isHphpArray())) {
goto cold;
}
const HphpArray* arr = (HphpArray*)ad;
@@ -1045,7 +1045,7 @@ int64_t iter_next_key(Iter* iter, TypedValue* valOut, TypedValue* keyOut) {
}
{
const ArrayData* ad = arrIter->getArrayData();
if (UNLIKELY(!IsHphpArray(ad))) {
if (UNLIKELY(!ad->isHphpArray())) {
goto cold;
}
const HphpArray* arr = (HphpArray*)ad;