Changeset 64684 in webkit


Ignore:
Timestamp:
Aug 4, 2010 3:21:13 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-08-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r64655.
http://trac.webkit.org/changeset/64655
https://bugs.webkit.org/show_bug.cgi?id=43496

JavaScriptCore references patch seems to have caused
regressions in QT and GTK builds (Requested by nlawrence on
#webkit).

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::markAggregate):
  • runtime/Collector.cpp: (JSC::Heap::markConservatively):
  • runtime/JSCell.h: (JSC::JSValue::asCell): (JSC::MarkStack::append):
  • runtime/JSGlobalObject.cpp: (JSC::markIfNeeded):
  • runtime/JSONObject.cpp: (JSC::Stringifier::Holder::object):
  • runtime/JSObject.h: (JSC::JSObject::prototype):
  • runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::markChildren):
  • runtime/JSValue.h: (JSC::JSValue::): (JSC::JSValue::JSValue): (JSC::JSValue::asCell):
  • runtime/MarkStack.h:
  • runtime/NativeErrorConstructor.cpp:
  • runtime/NativeErrorConstructor.h:
  • runtime/Structure.h: (JSC::Structure::storedPrototype):

2010-08-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r64655.
http://trac.webkit.org/changeset/64655
https://bugs.webkit.org/show_bug.cgi?id=43496

JavaScriptCore references patch seems to have caused
regressions in QT and GTK builds (Requested by nlawrence on
#webkit).

  • JSValueWrapper.cpp: (JSValueWrapper::JSObjectMark):
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r64658 r64684  
     12010-08-04  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r64655.
     4        http://trac.webkit.org/changeset/64655
     5        https://bugs.webkit.org/show_bug.cgi?id=43496
     6
     7        JavaScriptCore references patch seems to have caused
     8        regressions in QT and GTK builds (Requested by nlawrence on
     9        #webkit).
     10
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::markAggregate):
     13        * runtime/Collector.cpp:
     14        (JSC::Heap::markConservatively):
     15        * runtime/JSCell.h:
     16        (JSC::JSValue::asCell):
     17        (JSC::MarkStack::append):
     18        * runtime/JSGlobalObject.cpp:
     19        (JSC::markIfNeeded):
     20        * runtime/JSONObject.cpp:
     21        (JSC::Stringifier::Holder::object):
     22        * runtime/JSObject.h:
     23        (JSC::JSObject::prototype):
     24        * runtime/JSStaticScopeObject.cpp:
     25        (JSC::JSStaticScopeObject::markChildren):
     26        * runtime/JSValue.h:
     27        (JSC::JSValue::):
     28        (JSC::JSValue::JSValue):
     29        (JSC::JSValue::asCell):
     30        * runtime/MarkStack.h:
     31        * runtime/NativeErrorConstructor.cpp:
     32        * runtime/NativeErrorConstructor.h:
     33        * runtime/Structure.h:
     34        (JSC::Structure::storedPrototype):
     35
    1362010-08-04  Gavin Barraclough  <barraclough@apple.com>
    237
  • trunk/JavaScriptCore/bytecode/CodeBlock.cpp

    r64655 r64684  
    15141514{
    15151515    for (size_t i = 0; i < m_constantRegisters.size(); ++i)
    1516         markStack.append(m_constantRegisters[i]);
     1516        markStack.append(m_constantRegisters[i].jsValue());
    15171517    for (size_t i = 0; i < m_functionExprs.size(); ++i)
    15181518        m_functionExprs[i]->markAggregate(markStack);
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r64655 r64684  
    692692                if (m_heap.collectorBlock(block) != blockAddr)
    693693                    continue;
    694                 // While markStack.append normally takes a reference to update,
    695                 // we don't actually want the heap to be updated since we don't
    696                 // know for sure that it's actually a pointer. In the future
    697                 // this will be replaced by some appendRoot function for this
    698                 // specific case.
    699                 JSCell* cell = reinterpret_cast<JSCell*>(xAsBits);
    700                 markStack.append(cell);
     694                markStack.append(reinterpret_cast<JSCell*>(xAsBits));
    701695                markStack.drain();
    702696            }
  • trunk/JavaScriptCore/runtime/JSCell.h

    r64655 r64684  
    3636
    3737    class JSCell : public NoncopyableCustomAllocated {
    38         friend class CollectorHeap;
    3938        friend class GetterSetter;
    4039        friend class Heap;
     
    239238
    240239#if !USE(JSVALUE32_64)
    241     ALWAYS_INLINE JSCell*& JSValue::asCell()
    242     {
    243         ASSERT(isCell());
    244         return m_ptr;
    245     }
    246 
    247     ALWAYS_INLINE JSCell* const& JSValue::asCell() const
     240    ALWAYS_INLINE JSCell* JSValue::asCell() const
    248241    {
    249242        ASSERT(isCell());
     
    337330    }
    338331
    339     template<typename T>
    340     ALWAYS_INLINE void MarkStack::append(T*& cell)
    341     {
    342         // References in C++ are not covariant.  JSObject* being a subtype of JSCell*
    343         // does not mean that JSObject*& can be used as a subtype of JSCell*& because
    344         // treating a JSObject*& as a JSCell*& would allow us to change the pointer to
    345         // point to something that is a JSCell but not a JSObject.
    346         //
    347         // In this case, we need to be able to change the pointer, and although we know
    348         // it to be safe, C++ doesn't, requiring us to use templated functions that
    349         // pass a casted version to an internal function.
    350         //
    351         // Currently we're not doing anything with the value of the pointer, so nothing
    352         // unsafe will happen.  In the future, when we have movable objects, we will be
    353         // changing the value of the pointer to be the new location, in which case the
    354         // type will be preserved.
    355         JSCell*& ptr = *reinterpret_cast<JSCell**>(&cell);
    356         appendInternal(ptr);
    357     }
    358 
    359     ALWAYS_INLINE void MarkStack::append(JSValue& value)
    360     {
    361         ASSERT(value);
    362         if (value.isCell())
    363             appendInternal(value.asCell());
    364     }
    365 
    366     ALWAYS_INLINE void MarkStack::append(Register& reg)
    367     {
    368         JSValue value = reg.jsValue();
    369         append(value);
    370         reg = value;
    371     }
    372 
    373     inline void MarkStack::appendInternal(JSCell*& cell)
     332    ALWAYS_INLINE void MarkStack::append(JSCell* cell)
    374333    {
    375334        ASSERT(!m_isCheckingForDefaultMarkViolation);
     
    382341    }
    383342
     343    ALWAYS_INLINE void MarkStack::append(JSValue value)
     344    {
     345        ASSERT(value);
     346        if (value.isCell())
     347            append(value.asCell());
     348    }
     349
    384350    inline Heap* Heap::heap(JSValue v)
    385351    {
  • trunk/JavaScriptCore/runtime/JSGlobalObject.cpp

    r64655 r64684  
    8181static const int preferredScriptCheckTimeInterval = 1000;
    8282
    83 template<typename T> static inline void markIfNeeded(MarkStack& markStack, T*& v)
     83static inline void markIfNeeded(MarkStack& markStack, JSValue v)
    8484{
    8585    if (v)
     
    8787}
    8888
    89 static inline void markIfNeeded(MarkStack& markStack, RefPtr<Structure>& s)
     89static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s)
    9090{
    9191    if (s)
    92         markStack.append(s->storedPrototype());
     92        markIfNeeded(markStack, s->storedPrototype());
    9393}
    9494
  • trunk/JavaScriptCore/runtime/JSONObject.cpp

    r64655 r64684  
    8383        Holder(JSObject*);
    8484
    85         JSObject*& object() { return m_object; }
    86         JSObject* const& object() const { return m_object; }
     85        JSObject* object() const { return m_object; }
    8786
    8887        bool appendNextProperty(Stringifier&, StringBuilder&);
    8988
    9089    private:
    91         JSObject* m_object;
     90        JSObject* const m_object;
    9291        const bool m_isArray;
    9392        bool m_isJSArray;
  • trunk/JavaScriptCore/runtime/JSObject.h

    r64655 r64684  
    8787        virtual ~JSObject();
    8888
    89         JSValue& prototype();
    90         const JSValue& prototype() const;
     89        JSValue prototype() const;
    9190        void setPrototype(JSValue prototype);
    9291        bool setPrototypeWithCycleCheck(JSValue prototype);
     
    314313}
    315314
    316 inline JSValue& JSObject::prototype()
    317 {
    318     return m_structure->storedPrototype();
    319 }
    320 
    321 inline const JSValue& JSObject::prototype() const
     315inline JSValue JSObject::prototype() const
    322316{
    323317    return m_structure->storedPrototype();
  • trunk/JavaScriptCore/runtime/JSStaticScopeObject.cpp

    r64655 r64684  
    3535{
    3636    JSVariableObject::markChildren(markStack);
    37     markStack.append(d()->registerStore);
     37    markStack.append(d()->registerStore.jsValue());
    3838}
    3939
  • trunk/JavaScriptCore/runtime/JSValue.h

    r64655 r64684  
    200200
    201201        bool isCell() const;
    202         JSCell*& asCell();
    203         JSCell* const& asCell() const;
     202        JSCell* asCell() const;
    204203        bool isValidCallee();
    205204
     
    242241                int32_t payload;
    243242            } asBits;
    244             struct {
    245                 int32_t tag;
    246                 JSCell* ptr;
    247             } asPtr;
    248243#else
    249244            struct {
     
    251246                int32_t tag;
    252247            } asBits;
    253             struct {
    254                 JSCell* ptr;
    255                 int32_t tag;
    256             } asPtr;
    257248#endif
    258249        } u;
     
    501492        else
    502493            u.asBits.tag = EmptyValueTag;
    503         u.asPtr.ptr = ptr;
     494        u.asBits.payload = reinterpret_cast<int32_t>(ptr);
    504495#if ENABLE(JSC_ZOMBIES)
    505496        ASSERT(!isZombie());
     
    513504        else
    514505            u.asBits.tag = EmptyValueTag;
    515         u.asPtr.ptr = const_cast<JSCell*>(ptr);
     506        u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
    516507#if ENABLE(JSC_ZOMBIES)
    517508        ASSERT(!isZombie());
     
    608599    }
    609600   
    610     ALWAYS_INLINE JSCell* const& JSValue::asCell() const
     601    ALWAYS_INLINE JSCell* JSValue::asCell() const
    611602    {
    612603        ASSERT(isCell());
    613         return u.asPtr.ptr;
    614     }
    615 
    616     ALWAYS_INLINE JSCell*& JSValue::asCell()
    617     {
    618         ASSERT(isCell());
    619         return u.asPtr.ptr;
     604        return reinterpret_cast<JSCell*>(u.asBits.payload);
    620605    }
    621606
  • trunk/JavaScriptCore/runtime/MarkStack.h

    r64655 r64684  
    4747        }
    4848
    49         template<typename T> ALWAYS_INLINE void append(T*& cell);
    50         ALWAYS_INLINE void append(JSValue&);
    51         ALWAYS_INLINE void append(Register&);
     49        ALWAYS_INLINE void append(JSValue);
     50        void append(JSCell*);
    5251       
    5352        ALWAYS_INLINE void appendValues(Register* values, size_t count, MarkSetProperties properties = NoNullValues)
     
    7271
    7372    private:
    74         void appendInternal(JSCell*&);
    75 
    7673        void markChildren(JSCell*);
    7774
  • trunk/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r64655 r64684  
    6969}
    7070
    71 PassRefPtr<Structure> NativeErrorConstructor::createStructure(JSObject* prototype)
    72 {
    73     return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
    74 }
    75 
    76 void NativeErrorConstructor::markChildren(MarkStack& markStack)
    77 {
    78     InternalFunction::markChildren(markStack);
    79 
    80     markStack.append(m_errorStructure->storedPrototype());
    81 }
    82 
    8371} // namespace JSC
  • trunk/JavaScriptCore/runtime/NativeErrorConstructor.h

    r64655 r64684  
    3737
    3838        Structure* errorStructure() { return m_errorStructure.get(); }
    39         static PassRefPtr<Structure> createStructure(JSObject* prototype);
    40 
    41     protected:
    42         static const unsigned StructureFlags = InternalFunction::StructureFlags | OverridesMarkChildren;
    4339
    4440    private:
    4541        virtual ConstructType getConstructData(ConstructData&);
    4642        virtual CallType getCallData(CallData&);
    47 
    48         virtual void markChildren(MarkStack&);
    4943
    5044        virtual const ClassInfo* classInfo() const { return &info; }
  • trunk/JavaScriptCore/runtime/Structure.h

    r64655 r64684  
    9595        const TypeInfo& typeInfo() const { return m_typeInfo; }
    9696
    97         const JSValue& storedPrototype() const { return m_prototype; }
    98         JSValue& storedPrototype() { return m_prototype; }
     97        JSValue storedPrototype() const { return m_prototype; }
    9998        JSValue prototypeForLookup(ExecState*) const;
    10099        StructureChain* prototypeChain(ExecState*) const;
  • trunk/JavaScriptGlue/ChangeLog

    r64655 r64684  
     12010-08-04  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r64655.
     4        http://trac.webkit.org/changeset/64655
     5        https://bugs.webkit.org/show_bug.cgi?id=43496
     6
     7        JavaScriptCore references patch seems to have caused
     8        regressions in QT and GTK builds (Requested by nlawrence on
     9        #webkit).
     10
     11        * JSValueWrapper.cpp:
     12        (JSValueWrapper::JSObjectMark):
     13
    1142010-08-04  Nathan Lawrence  <nlawrence@apple.com>
    215
  • trunk/JavaScriptGlue/JSValueWrapper.cpp

    r64655 r64684  
    193193}
    194194
    195 void JSValueWrapper::JSObjectMark(void*)
    196 {
    197     // The object doesn't need to be marked here because it is a protected
    198     // object and should therefore be marked by
    199     // JSC::Heap::markProtectedObjects.
    200 
    201     // We are keeping the function around because the function is passed as a
    202     // callback.
    203 }
     195void JSValueWrapper::JSObjectMark(void *data)
     196{
     197    JSValueWrapper* ptr = (JSValueWrapper*)data;
     198    if (ptr)
     199    {
     200        // This results in recursive marking but will be otherwise safe and correct.
     201        // We claim the array vptr is 0 because we don't have access to it here, and
     202        // claiming 0 is functionally harmless -- it merely means that we can't
     203        // devirtualise marking of arrays when recursing from this point.
     204        MarkStack markStack(0);
     205        markStack.append(ptr->fValue.get());
     206        markStack.drain();
     207    }
     208}
Note: See TracChangeset for help on using the changeset viewer.