[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:43:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 23e4617453b5444c0cf7460969c9e3a9ec02285b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 4 22:21:13 2010 +0000

    2010-08-04  Sheriff Bot  <webkit.review.bot at 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 at 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):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64684 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 9ccd932..6889efc 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,38 @@
+2010-08-04  Sheriff Bot  <webkit.review.bot at 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  Gavin Barraclough  <barraclough at apple.com>
 
         Rubber stamped by Sam Weinig.
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp
index aa9ac5d..0e55d6a 100644
--- a/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1513,7 +1513,7 @@ void CodeBlock::refStructures(Instruction* vPC) const
 void CodeBlock::markAggregate(MarkStack& markStack)
 {
     for (size_t i = 0; i < m_constantRegisters.size(); ++i)
-        markStack.append(m_constantRegisters[i]);
+        markStack.append(m_constantRegisters[i].jsValue());
     for (size_t i = 0; i < m_functionExprs.size(); ++i)
         m_functionExprs[i]->markAggregate(markStack);
     for (size_t i = 0; i < m_functionDecls.size(); ++i)
diff --git a/JavaScriptCore/runtime/Collector.cpp b/JavaScriptCore/runtime/Collector.cpp
index f5cdba5..93649dd 100644
--- a/JavaScriptCore/runtime/Collector.cpp
+++ b/JavaScriptCore/runtime/Collector.cpp
@@ -691,13 +691,7 @@ void Heap::markConservatively(MarkStack& markStack, void* start, void* end)
             for (size_t block = 0; block < usedBlocks; block++) {
                 if (m_heap.collectorBlock(block) != blockAddr)
                     continue;
-                // While markStack.append normally takes a reference to update,
-                // we don't actually want the heap to be updated since we don't
-                // know for sure that it's actually a pointer. In the future
-                // this will be replaced by some appendRoot function for this
-                // specific case.
-                JSCell* cell = reinterpret_cast<JSCell*>(xAsBits);
-                markStack.append(cell);
+                markStack.append(reinterpret_cast<JSCell*>(xAsBits));
                 markStack.drain();
             }
         }
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index a556506..72f81df 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -35,7 +35,6 @@
 namespace JSC {
 
     class JSCell : public NoncopyableCustomAllocated {
-        friend class CollectorHeap;
         friend class GetterSetter;
         friend class Heap;
         friend class JIT;
@@ -238,13 +237,7 @@ namespace JSC {
     }
 
 #if !USE(JSVALUE32_64)
-    ALWAYS_INLINE JSCell*& JSValue::asCell()
-    {
-        ASSERT(isCell());
-        return m_ptr;
-    }
-
-    ALWAYS_INLINE JSCell* const& JSValue::asCell() const
+    ALWAYS_INLINE JSCell* JSValue::asCell() const
     {
         ASSERT(isCell());
         return m_ptr;
@@ -336,41 +329,7 @@ namespace JSC {
         return isCell() ? asCell()->toThisObject(exec) : toThisObjectSlowCase(exec);
     }
 
-    template<typename T>
-    ALWAYS_INLINE void MarkStack::append(T*& cell)
-    {
-        // References in C++ are not covariant.  JSObject* being a subtype of JSCell*
-        // does not mean that JSObject*& can be used as a subtype of JSCell*& because
-        // treating a JSObject*& as a JSCell*& would allow us to change the pointer to
-        // point to something that is a JSCell but not a JSObject.
-        //
-        // In this case, we need to be able to change the pointer, and although we know
-        // it to be safe, C++ doesn't, requiring us to use templated functions that
-        // pass a casted version to an internal function.
-        //
-        // Currently we're not doing anything with the value of the pointer, so nothing
-        // unsafe will happen.  In the future, when we have movable objects, we will be
-        // changing the value of the pointer to be the new location, in which case the
-        // type will be preserved.
-        JSCell*& ptr = *reinterpret_cast<JSCell**>(&cell);
-        appendInternal(ptr);
-    }
-
-    ALWAYS_INLINE void MarkStack::append(JSValue& value)
-    {
-        ASSERT(value);
-        if (value.isCell())
-            appendInternal(value.asCell());
-    }
-
-    ALWAYS_INLINE void MarkStack::append(Register& reg)
-    {
-        JSValue value = reg.jsValue();
-        append(value);
-        reg = value;
-    }
-
-    inline void MarkStack::appendInternal(JSCell*& cell)
+    ALWAYS_INLINE void MarkStack::append(JSCell* cell)
     {
         ASSERT(!m_isCheckingForDefaultMarkViolation);
         ASSERT(cell);
@@ -381,6 +340,13 @@ namespace JSC {
             m_values.append(cell);
     }
 
+    ALWAYS_INLINE void MarkStack::append(JSValue value)
+    {
+        ASSERT(value);
+        if (value.isCell())
+            append(value.asCell());
+    }
+
     inline Heap* Heap::heap(JSValue v)
     {
         if (!v.isCell())
diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp
index 89b5aa5..c317e13 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -80,16 +80,16 @@ static const int initialTickCountThreshold = 255;
 // Preferred number of milliseconds between each timeout check
 static const int preferredScriptCheckTimeInterval = 1000;
 
-template<typename T> static inline void markIfNeeded(MarkStack& markStack, T*& v)
+static inline void markIfNeeded(MarkStack& markStack, JSValue v)
 {
     if (v)
         markStack.append(v);
 }
 
-static inline void markIfNeeded(MarkStack& markStack, RefPtr<Structure>& s)
+static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s)
 {
     if (s)
-        markStack.append(s->storedPrototype());
+        markIfNeeded(markStack, s->storedPrototype());
 }
 
 JSGlobalObject::~JSGlobalObject()
diff --git a/JavaScriptCore/runtime/JSONObject.cpp b/JavaScriptCore/runtime/JSONObject.cpp
index 895a1f9..ccfd43a 100644
--- a/JavaScriptCore/runtime/JSONObject.cpp
+++ b/JavaScriptCore/runtime/JSONObject.cpp
@@ -82,13 +82,12 @@ private:
     public:
         Holder(JSObject*);
 
-        JSObject*& object() { return m_object; }
-        JSObject* const& object() const { return m_object; }
+        JSObject* object() const { return m_object; }
 
         bool appendNextProperty(Stringifier&, StringBuilder&);
 
     private:
-        JSObject* m_object;
+        JSObject* const m_object;
         const bool m_isArray;
         bool m_isJSArray;
         unsigned m_index;
diff --git a/JavaScriptCore/runtime/JSObject.h b/JavaScriptCore/runtime/JSObject.h
index 5a218d1..4201703 100644
--- a/JavaScriptCore/runtime/JSObject.h
+++ b/JavaScriptCore/runtime/JSObject.h
@@ -86,8 +86,7 @@ namespace JSC {
         // in the class as it results in the vtable being generated as a weak symbol
         virtual ~JSObject();
 
-        JSValue& prototype();
-        const JSValue& prototype() const;
+        JSValue prototype() const;
         void setPrototype(JSValue prototype);
         bool setPrototypeWithCycleCheck(JSValue prototype);
         
@@ -313,12 +312,7 @@ inline JSObject::~JSObject()
     m_structure->deref();
 }
 
-inline JSValue& JSObject::prototype()
-{
-    return m_structure->storedPrototype();
-}
-
-inline const JSValue& JSObject::prototype() const
+inline JSValue JSObject::prototype() const
 {
     return m_structure->storedPrototype();
 }
diff --git a/JavaScriptCore/runtime/JSStaticScopeObject.cpp b/JavaScriptCore/runtime/JSStaticScopeObject.cpp
index 339ec46..ad10218 100644
--- a/JavaScriptCore/runtime/JSStaticScopeObject.cpp
+++ b/JavaScriptCore/runtime/JSStaticScopeObject.cpp
@@ -34,7 +34,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSStaticScopeObject);
 void JSStaticScopeObject::markChildren(MarkStack& markStack)
 {
     JSVariableObject::markChildren(markStack);
-    markStack.append(d()->registerStore);
+    markStack.append(d()->registerStore.jsValue());
 }
 
 JSObject* JSStaticScopeObject::toThisObject(ExecState* exec) const
diff --git a/JavaScriptCore/runtime/JSValue.h b/JavaScriptCore/runtime/JSValue.h
index b0af83c..3c6bc09 100644
--- a/JavaScriptCore/runtime/JSValue.h
+++ b/JavaScriptCore/runtime/JSValue.h
@@ -199,8 +199,7 @@ namespace JSC {
         JSValue getJSNumber(); // JSValue() if this is not a JSNumber or number object
 
         bool isCell() const;
-        JSCell*& asCell();
-        JSCell* const& asCell() const;
+        JSCell* asCell() const;
         bool isValidCallee();
 
 #ifndef NDEBUG
@@ -241,19 +240,11 @@ namespace JSC {
                 int32_t tag;
                 int32_t payload;
             } asBits;
-            struct {
-                int32_t tag;
-                JSCell* ptr;
-            } asPtr;
 #else
             struct {
                 int32_t payload;
                 int32_t tag;
             } asBits;
-            struct {
-                JSCell* ptr;
-                int32_t tag;
-            } asPtr;
 #endif
         } u;
 #else // USE(JSVALUE32_64)
@@ -500,7 +491,7 @@ namespace JSC {
             u.asBits.tag = CellTag;
         else
             u.asBits.tag = EmptyValueTag;
-        u.asPtr.ptr = ptr;
+        u.asBits.payload = reinterpret_cast<int32_t>(ptr);
 #if ENABLE(JSC_ZOMBIES)
         ASSERT(!isZombie());
 #endif
@@ -512,7 +503,7 @@ namespace JSC {
             u.asBits.tag = CellTag;
         else
             u.asBits.tag = EmptyValueTag;
-        u.asPtr.ptr = const_cast<JSCell*>(ptr);
+        u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
 #if ENABLE(JSC_ZOMBIES)
         ASSERT(!isZombie());
 #endif
@@ -607,16 +598,10 @@ namespace JSC {
         return u.asDouble;
     }
     
-    ALWAYS_INLINE JSCell* const& JSValue::asCell() const
-    {
-        ASSERT(isCell());
-        return u.asPtr.ptr;
-    }
-
-    ALWAYS_INLINE JSCell*& JSValue::asCell()
+    ALWAYS_INLINE JSCell* JSValue::asCell() const
     {
         ASSERT(isCell());
-        return u.asPtr.ptr;
+        return reinterpret_cast<JSCell*>(u.asBits.payload);
     }
 
     ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, ExecState*, double d)
diff --git a/JavaScriptCore/runtime/MarkStack.h b/JavaScriptCore/runtime/MarkStack.h
index be4d972..c551bac 100644
--- a/JavaScriptCore/runtime/MarkStack.h
+++ b/JavaScriptCore/runtime/MarkStack.h
@@ -46,9 +46,8 @@ namespace JSC {
         {
         }
 
-        template<typename T> ALWAYS_INLINE void append(T*& cell);
-        ALWAYS_INLINE void append(JSValue&);
-        ALWAYS_INLINE void append(Register&);
+        ALWAYS_INLINE void append(JSValue);
+        void append(JSCell*);
         
         ALWAYS_INLINE void appendValues(Register* values, size_t count, MarkSetProperties properties = NoNullValues)
         {
@@ -71,8 +70,6 @@ namespace JSC {
         }
 
     private:
-        void appendInternal(JSCell*&);
-
         void markChildren(JSCell*);
 
         struct MarkSet {
diff --git a/JavaScriptCore/runtime/NativeErrorConstructor.cpp b/JavaScriptCore/runtime/NativeErrorConstructor.cpp
index 83fee3b..31f9bc3 100644
--- a/JavaScriptCore/runtime/NativeErrorConstructor.cpp
+++ b/JavaScriptCore/runtime/NativeErrorConstructor.cpp
@@ -68,16 +68,4 @@ CallType NativeErrorConstructor::getCallData(CallData& callData)
     return CallTypeHost;
 }
 
-PassRefPtr<Structure> NativeErrorConstructor::createStructure(JSObject* prototype)
-{
-    return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
-}
-
-void NativeErrorConstructor::markChildren(MarkStack& markStack)
-{
-    InternalFunction::markChildren(markStack);
-
-    markStack.append(m_errorStructure->storedPrototype());
-}
-
 } // namespace JSC
diff --git a/JavaScriptCore/runtime/NativeErrorConstructor.h b/JavaScriptCore/runtime/NativeErrorConstructor.h
index ba1c8b1..1ff8207 100644
--- a/JavaScriptCore/runtime/NativeErrorConstructor.h
+++ b/JavaScriptCore/runtime/NativeErrorConstructor.h
@@ -36,17 +36,11 @@ namespace JSC {
         static const ClassInfo info;
 
         Structure* errorStructure() { return m_errorStructure.get(); }
-        static PassRefPtr<Structure> createStructure(JSObject* prototype);
-
-    protected:
-        static const unsigned StructureFlags = InternalFunction::StructureFlags | OverridesMarkChildren;
 
     private:
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
 
-        virtual void markChildren(MarkStack&);
-
         virtual const ClassInfo* classInfo() const { return &info; }
 
         RefPtr<Structure> m_errorStructure;
diff --git a/JavaScriptCore/runtime/Structure.h b/JavaScriptCore/runtime/Structure.h
index a5fb35b..968443a 100644
--- a/JavaScriptCore/runtime/Structure.h
+++ b/JavaScriptCore/runtime/Structure.h
@@ -94,8 +94,7 @@ namespace JSC {
 
         const TypeInfo& typeInfo() const { return m_typeInfo; }
 
-        const JSValue& storedPrototype() const { return m_prototype; }
-        JSValue& storedPrototype() { return m_prototype; }
+        JSValue storedPrototype() const { return m_prototype; }
         JSValue prototypeForLookup(ExecState*) const;
         StructureChain* prototypeChain(ExecState*) const;
 
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 357ac7a..5f64601 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-04  Sheriff Bot  <webkit.review.bot at 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):
+
 2010-08-04  Nathan Lawrence  <nlawrence at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/JavaScriptGlue/JSValueWrapper.cpp b/JavaScriptGlue/JSValueWrapper.cpp
index 47fb967..e0879a0 100644
--- a/JavaScriptGlue/JSValueWrapper.cpp
+++ b/JavaScriptGlue/JSValueWrapper.cpp
@@ -192,12 +192,17 @@ CFTypeRef JSValueWrapper::JSObjectCopyCFValue(void *data)
     return result;
 }
 
-void JSValueWrapper::JSObjectMark(void*)
+void JSValueWrapper::JSObjectMark(void *data)
 {
-    // The object doesn't need to be marked here because it is a protected
-    // object and should therefore be marked by
-    // JSC::Heap::markProtectedObjects.
-
-    // We are keeping the function around because the function is passed as a
-    // callback.
+    JSValueWrapper* ptr = (JSValueWrapper*)data;
+    if (ptr)
+    {
+        // This results in recursive marking but will be otherwise safe and correct.
+        // We claim the array vptr is 0 because we don't have access to it here, and
+        // claiming 0 is functionally harmless -- it merely means that we can't
+        // devirtualise marking of arrays when recursing from this point.
+        MarkStack markStack(0);
+        markStack.append(ptr->fValue.get());
+        markStack.drain();
+    }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list