diff --git a/hphp/runtime/base/type_array.cpp b/hphp/runtime/base/type_array.cpp index eed52627e..d8a969f41 100644 --- a/hphp/runtime/base/type_array.cpp +++ b/hphp/runtime/base/type_array.cpp @@ -83,15 +83,6 @@ Array &Array::operator = (Variant&& v) { return *this; } -HOT_FUNC -Array &Array::operator=(const StaticArray &arr) { - if (m_px != arr.m_px) { - if (m_px) decRefArr(m_px); - m_px = arr.m_px; - } - return *this; -} - Array Array::operator+(ArrayData *data) const { return Array(m_px).operator+=(data); } diff --git a/hphp/runtime/base/type_array.h b/hphp/runtime/base/type_array.h index 0f341a8f4..10d9ddd90 100644 --- a/hphp/runtime/base/type_array.h +++ b/hphp/runtime/base/type_array.h @@ -14,14 +14,14 @@ +----------------------------------------------------------------------+ */ +#ifndef incl_HPHP_ARRAY_H_ +#define incl_HPHP_ARRAY_H_ + #ifndef incl_HPHP_INSIDE_HPHP_COMPLEX_TYPES_H_ #error Directly including 'type_array.h' is prohibited. \ Include 'complex_types.h' instead. #endif -#ifndef incl_HPHP_ARRAY_H_ -#define incl_HPHP_ARRAY_H_ - #include #include @@ -39,7 +39,6 @@ inline int64_t ToKey(double d) { // forward declaration class ArrayIter; -class StaticArray; /** * Array type wrapping around ArrayData to implement reference @@ -80,8 +79,8 @@ class Array : protected SmartPtr { * array value from the parameter, and they are NOT constructing an array * with that single value (then one should use Array::Create() functions). */ - Array(ArrayData *data) : ArrayBase(data) { } - Array(CArrRef arr) : ArrayBase(arr.m_px) { } + /* implicit */ Array(ArrayData *data) : ArrayBase(data) { } + /* implicit */ Array(CArrRef arr) : ArrayBase(arr.m_px) { } // Move ctor Array(Array&& src) : ArrayBase(std::move(src)) { @@ -125,7 +124,6 @@ class Array : protected SmartPtr { Array &operator = (ArrayData *data); Array &operator = (CArrRef v); Array &operator = (CVarRef v); - Array &operator = (const StaticArray &v); Array operator + (ArrayData *data) const; Array operator + (CArrRef v) const; Array operator + (CVarRef v) const; @@ -514,26 +512,6 @@ class Array : protected SmartPtr { } }; -/////////////////////////////////////////////////////////////////////////////// - -/** - * A StaticArray can be co-accessed by multiple threads, therefore they are - * not thread local, and they have to be allocated BEFORE any thread starts, - * so that they won't be garbage collected by MemoryManager. This is used by - * scalar arrays, so they can be pre-allocated before request handling. - */ -class StaticArray : public Array { -public: - StaticArray() { } - StaticArray(ArrayData *data) : Array(data) { - } - ~StaticArray() { - // prevent ~SmartPtr from calling decRefCount after data is released - m_px = nullptr; - } -}; - - /////////////////////////////////////////////////////////////////////////////// // ArrNR diff --git a/hphp/runtime/base/type_variant.h b/hphp/runtime/base/type_variant.h index f3af79496..1132d7471 100644 --- a/hphp/runtime/base/type_variant.h +++ b/hphp/runtime/base/type_variant.h @@ -129,12 +129,6 @@ class Variant : private TypedValue { assert(s); m_data.pstr = s; } - Variant(const StaticArray &v) { - m_type = KindOfArray; - ArrayData *a = v.get(); - assert(a); - m_data.parr = a; - } Variant(CStrRef v); Variant(CArrRef v); diff --git a/hphp/runtime/vm/translator/hopt/ir.cpp b/hphp/runtime/vm/translator/hopt/ir.cpp index 8ca0c98d4..a75eae438 100644 --- a/hphp/runtime/vm/translator/hopt/ir.cpp +++ b/hphp/runtime/vm/translator/hopt/ir.cpp @@ -1029,7 +1029,7 @@ Variant SSATmp::getValVariant() const { return (litstr)m_inst->getExtra() ->as()->data(); case KindOfArray: - return StaticArray(ArrayData::GetScalarArray(m_inst->getExtra() + return Array(ArrayData::GetScalarArray(m_inst->getExtra() ->as())); case KindOfObject: return m_inst->getExtra()->as();