Ignore:
Timestamp:
Jul 27, 2010, 5:36:56 PM (15 years ago)
Author:
[email protected]
Message:

Temporarily rolling out http://trac.webkit.org/changeset/64177,
this seems to give QT ARM/Win a headache (specifically, looks
like structure layour differs, objects get too large -
"..\..\..\JavaScriptCore\runtime\ArrayPrototype.cpp:41:"
"error: size of array 'dummyclass_fits_in_cell' is negative").

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):

  • runtime/JSArray.cpp:

(JSC::increasedVectorLength):
(JSC::JSArray::JSArray):
(JSC::JSArray::~JSArray):
(JSC::JSArray::getOwnPropertySlot):
(JSC::JSArray::getOwnPropertyDescriptor):
(JSC::JSArray::put):
(JSC::JSArray::putSlowCase):
(JSC::JSArray::deleteProperty):
(JSC::JSArray::getOwnPropertyNames):
(JSC::JSArray::increaseVectorLength):
(JSC::JSArray::setLength):
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::sortNumeric):
(JSC::JSArray::sort):
(JSC::JSArray::fillArgList):
(JSC::JSArray::copyToRegisters):
(JSC::JSArray::compactForSorting):
(JSC::JSArray::subclassData):
(JSC::JSArray::setSubclassData):
(JSC::JSArray::checkConsistency):

  • runtime/JSArray.h:

(JSC::JSArray::length):
(JSC::JSArray::canGetIndex):
(JSC::JSArray::getIndex):
(JSC::JSArray::setIndex):
(JSC::JSArray::uncheckedSetIndex):
(JSC::JSArray::markChildrenDirect):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSArray.h

    r64177 r64184  
    3030    typedef HashMap<unsigned, JSValue> SparseArrayValueMap;
    3131
    32     // This struct holds the actual data values of an array.  A JSArray object points to it's contained ArrayStorage
    33     // struct by pointing to m_vector.  To access the contained ArrayStorage struct, use the getStorage() and
    34     // setStorage() methods.  It is important to note that there may be space before the ArrayStorage that
    35     // is used to quick unshift / shift operation.  The actual allocated pointer is available by using:
    36     //     getStorage() - m_indexBias * sizeof(JSValue)
    3732    struct ArrayStorage {
    38         unsigned m_length; // The "length" property on the array
     33        unsigned m_length;
    3934        unsigned m_numValuesInVector;
    4035        SparseArrayValueMap* m_sparseValueMap;
     
    7368
    7469        static JS_EXPORTDATA const ClassInfo info;
    75        
    76         unsigned length() const { return arrayStorage()->m_length; }
     70
     71        unsigned length() const { return m_storage->m_length; }
    7772        void setLength(unsigned); // OK to use on new arrays, but not if it might be a RegExpMatchArray.
    7873
     
    8479        JSValue pop();
    8580
    86         void shiftCount(ExecState*, int count);
    87         void unshiftCount(ExecState*, int count);
    88 
    89         bool canGetIndex(unsigned i) { return i < m_vectorLength && m_vector[i]; }
     81        bool canGetIndex(unsigned i) { return i < m_vectorLength && m_storage->m_vector[i]; }
    9082        JSValue getIndex(unsigned i)
    9183        {
    9284            ASSERT(canGetIndex(i));
    93             return m_vector[i];
     85            return m_storage->m_vector[i];
    9486        }
    9587
     
    9890        {
    9991            ASSERT(canSetIndex(i));
    100            
    101             JSValue& x = m_vector[i];
     92            JSValue& x = m_storage->m_vector[i];
    10293            if (!x) {
    103                 ArrayStorage *storage = arrayStorage();
    104                 ++storage->m_numValuesInVector;
    105                 if (i >= storage->m_length)
    106                     storage->m_length = i + 1;
     94                ++m_storage->m_numValuesInVector;
     95                if (i >= m_storage->m_length)
     96                    m_storage->m_length = i + 1;
    10797            }
    10898            x = v;
    10999        }
    110        
     100
    111101        void uncheckedSetIndex(unsigned i, JSValue v)
    112102        {
    113103            ASSERT(canSetIndex(i));
    114             ArrayStorage *storage = arrayStorage();
    115104#if CHECK_ARRAY_CONSISTENCY
    116             ASSERT(storage->m_inCompactInitialization);
     105            ASSERT(m_storage->m_inCompactInitialization);
    117106#endif
    118             storage->m_vector[i] = v;
     107            m_storage->m_vector[i] = v;
    119108        }
    120109
     
    139128        void* subclassData() const;
    140129        void setSubclassData(void*);
    141        
    142         inline ArrayStorage *arrayStorage() const
    143         {
    144             return reinterpret_cast<ArrayStorage*>(reinterpret_cast<char*>(m_vector) - (sizeof(ArrayStorage) - sizeof(JSValue)));
    145         }
    146 
    147         inline void setArrayStorage(ArrayStorage *storage)
    148         {
    149             m_vector = &storage->m_vector[0];
    150         }
    151130
    152131    private:
     
    156135        void putSlowCase(ExecState*, unsigned propertyName, JSValue);
    157136
    158         unsigned getNewVectorLength(unsigned desiredLength);
    159137        bool increaseVectorLength(unsigned newLength);
    160         bool increaseVectorPrefixLength(unsigned newLength);
    161138       
    162139        unsigned compactForSorting();
     
    165142        void checkConsistency(ConsistencyCheckType = NormalConsistencyCheck);
    166143
    167         unsigned m_vectorLength; // The valid length of m_vector
    168         int m_indexBias; // The number of JSValue sized blocks before ArrayStorage.
    169         JSValue* m_vector; // Copy of ArrayStorage.m_vector.  Used for quick vector access and to materialize ArrayStorage ptr.
     144        unsigned m_vectorLength;
     145        ArrayStorage* m_storage;
    170146    };
    171147
     
    193169        JSObject::markChildrenDirect(markStack);
    194170       
    195         ArrayStorage* storage = arrayStorage();
     171        ArrayStorage* storage = m_storage;
    196172
    197173        unsigned usedVectorLength = std::min(storage->m_length, m_vectorLength);
Note: See TracChangeset for help on using the changeset viewer.