Title: [170215] branches/ftlopt/Source/_javascript_Core
Revision
170215
Author
[email protected]
Date
2014-06-20 15:27:36 -0700 (Fri, 20 Jun 2014)

Log Message

Merge r169903 to the branch.

    2014-06-12  Mark Hahnenberg  <[email protected]>
    
    Move structureHasRareData out of TypeInfo
    https://bugs.webkit.org/show_bug.cgi?id=133800
    
    Reviewed by Andreas Kling.
    
    StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger, 
    but we have a few spare bits in Structure so it would be nice to remove this hack.
    
    * runtime/JSTypeInfo.h:
    (JSC::TypeInfo::newImpurePropertyFiresWatchpoints):
    (JSC::TypeInfo::structureHasRareData): Deleted.
    * runtime/Structure.cpp:
    (JSC::Structure::Structure):
    (JSC::Structure::allocateRareData):
    (JSC::Structure::cloneRareDataFrom):
    * runtime/Structure.h:
    (JSC::Structure::previousID):
    (JSC::Structure::objectToStringValue):
    (JSC::Structure::setObjectToStringValue):
    (JSC::Structure::setPreviousID):
    (JSC::Structure::clearPreviousID):
    (JSC::Structure::previous):
    (JSC::Structure::rareData):
    * runtime/StructureInlines.h:
    (JSC::Structure::setEnumerationCache):
    (JSC::Structure::enumerationCache):

Modified Paths

Diff

Modified: branches/ftlopt/Source/_javascript_Core/ChangeLog (170214 => 170215)


--- branches/ftlopt/Source/_javascript_Core/ChangeLog	2014-06-20 22:10:37 UTC (rev 170214)
+++ branches/ftlopt/Source/_javascript_Core/ChangeLog	2014-06-20 22:27:36 UTC (rev 170215)
@@ -1,3 +1,36 @@
+2014-06-20  Mark Hahnenberg  <[email protected]>
+
+        Merge r169903 to the branch.
+
+    2014-06-12  Mark Hahnenberg  <[email protected]>
+    
+            Move structureHasRareData out of TypeInfo
+            https://bugs.webkit.org/show_bug.cgi?id=133800
+    
+            Reviewed by Andreas Kling.
+    
+            StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger, 
+            but we have a few spare bits in Structure so it would be nice to remove this hack.
+    
+            * runtime/JSTypeInfo.h:
+            (JSC::TypeInfo::newImpurePropertyFiresWatchpoints):
+            (JSC::TypeInfo::structureHasRareData): Deleted.
+            * runtime/Structure.cpp:
+            (JSC::Structure::Structure):
+            (JSC::Structure::allocateRareData):
+            (JSC::Structure::cloneRareDataFrom):
+            * runtime/Structure.h:
+            (JSC::Structure::previousID):
+            (JSC::Structure::objectToStringValue):
+            (JSC::Structure::setObjectToStringValue):
+            (JSC::Structure::setPreviousID):
+            (JSC::Structure::clearPreviousID):
+            (JSC::Structure::previous):
+            (JSC::Structure::rareData):
+            * runtime/StructureInlines.h:
+            (JSC::Structure::setEnumerationCache):
+            (JSC::Structure::enumerationCache):
+
 2014-06-19  Filip Pizlo  <[email protected]>
 
         [ftlopt] StructureSet::onlyStructure() should return nullptr if it's not a singleton (instead of asserting)

Modified: branches/ftlopt/Source/_javascript_Core/runtime/JSTypeInfo.h (170214 => 170215)


--- branches/ftlopt/Source/_javascript_Core/runtime/JSTypeInfo.h	2014-06-20 22:10:37 UTC (rev 170214)
+++ branches/ftlopt/Source/_javascript_Core/runtime/JSTypeInfo.h	2014-06-20 22:27:36 UTC (rev 170215)
@@ -49,8 +49,7 @@
     static const unsigned ProhibitsPropertyCaching = 1 << 9;
     static const unsigned HasImpureGetOwnPropertySlot = 1 << 10;
     static const unsigned NewImpurePropertyFiresWatchpoints = 1 << 11;
-    static const unsigned StructureHasRareData = 1 << 12;
-    static const unsigned StructureIsImmortal = 1 << 13;
+    static const unsigned StructureIsImmortal = 1 << 12;
 
     class TypeInfo {
     public:
@@ -95,7 +94,6 @@
         bool prohibitsPropertyCaching() const { return isSetOnFlags2(ProhibitsPropertyCaching); }
         bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); }
         bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); }
-        bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); }
         bool structureIsImmortal() const { return isSetOnFlags2(StructureIsImmortal); }
 
         static ptrdiff_t flagsOffset()

Modified: branches/ftlopt/Source/_javascript_Core/runtime/Structure.cpp (170214 => 170215)


--- branches/ftlopt/Source/_javascript_Core/runtime/Structure.cpp	2014-06-20 22:10:37 UTC (rev 170214)
+++ branches/ftlopt/Source/_javascript_Core/runtime/Structure.cpp	2014-06-20 22:27:36 UTC (rev 170215)
@@ -175,10 +175,11 @@
     , m_preventExtensions(false)
     , m_didTransition(false)
     , m_staticFunctionReified(false)
+    , m_hasRareData(false)
 {
     ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity());
     ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset);
-    ASSERT(!typeInfo.structureHasRareData());
+    ASSERT(!m_hasRareData);
     ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm));
     ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm));
 }
@@ -202,6 +203,7 @@
     , m_preventExtensions(false)
     , m_didTransition(false)
     , m_staticFunctionReified(false)
+    , m_hasRareData(false)
 {
     TypeInfo typeInfo = TypeInfo(CellType, OverridesVisitChildren | StructureIsImmortal);
     m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), 0, typeInfo);
@@ -228,13 +230,14 @@
     , m_preventExtensions(previous->m_preventExtensions)
     , m_didTransition(true)
     , m_staticFunctionReified(previous->m_staticFunctionReified)
+    , m_hasRareData(false)
 {
-    TypeInfo typeInfo = TypeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData);
+    TypeInfo typeInfo = previous->typeInfo();
     m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo);
     m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags();
 
     ASSERT(!previous->typeInfo().structureIsImmortal());
-    if (previous->typeInfo().structureHasRareData() && previous->rareData()->needsCloning())
+    if (previous->m_hasRareData && previous->rareData()->needsCloning())
         cloneRareDataFrom(vm, previous);
     else if (previous->previousID())
         m_previousOrRareData.set(vm, this, previous->previousID());
@@ -779,24 +782,21 @@
 
 void Structure::allocateRareData(VM& vm)
 {
-    ASSERT(!typeInfo().structureHasRareData());
+    ASSERT(!m_hasRareData);
     StructureRareData* rareData = StructureRareData::create(vm, previous());
-    TypeInfo oldTypeInfo = typeInfo();
-    TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);
-    m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();
     m_previousOrRareData.set(vm, this, rareData);
-    ASSERT(typeInfo().structureHasRareData());
+    m_hasRareData = true;
+    ASSERT(m_hasRareData);
 }
 
 void Structure::cloneRareDataFrom(VM& vm, const Structure* other)
 {
-    ASSERT(other->typeInfo().structureHasRareData());
+    ASSERT(!m_hasRareData);
+    ASSERT(other->m_hasRareData);
     StructureRareData* newRareData = StructureRareData::clone(vm, other->rareData());
-    TypeInfo oldTypeInfo = typeInfo();
-    TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);
-    m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();
     m_previousOrRareData.set(vm, this, newRareData);
-    ASSERT(typeInfo().structureHasRareData());
+    m_hasRareData = true;
+    ASSERT(m_hasRareData);
 }
 
 #if DUMP_PROPERTYMAP_STATS

Modified: branches/ftlopt/Source/_javascript_Core/runtime/Structure.h (170214 => 170215)


--- branches/ftlopt/Source/_javascript_Core/runtime/Structure.h	2014-06-20 22:10:37 UTC (rev 170214)
+++ branches/ftlopt/Source/_javascript_Core/runtime/Structure.h	2014-06-20 22:27:36 UTC (rev 170215)
@@ -193,7 +193,7 @@
     Structure* previousID() const
     {
         ASSERT(structure()->classInfo() == info());
-        if (typeInfo().structureHasRareData())
+        if (m_hasRareData)
             return rareData()->previousID();
         return previous();
     }
@@ -298,14 +298,14 @@
 
     JSString* objectToStringValue()
     {
-        if (!typeInfo().structureHasRareData())
+        if (!m_hasRareData)
             return 0;
         return rareData()->objectToStringValue();
     }
 
     void setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value)
     {
-        if (!typeInfo().structureHasRareData())
+        if (!m_hasRareData)
             allocateRareData(vm);
         rareData()->setObjectToStringValue(vm, owner, value);
     }
@@ -455,7 +455,7 @@
 
     void setPreviousID(VM& vm, Structure* transition, Structure* structure)
     {
-        if (typeInfo().structureHasRareData())
+        if (m_hasRareData)
             rareData()->setPreviousID(vm, transition, structure);
         else
             m_previousOrRareData.set(vm, transition, structure);
@@ -463,7 +463,7 @@
 
     void clearPreviousID()
     {
-        if (typeInfo().structureHasRareData())
+        if (m_hasRareData)
             rareData()->clearPreviousID();
         else
             m_previousOrRareData.clear();
@@ -482,13 +482,13 @@
 
     Structure* previous() const
     {
-        ASSERT(!typeInfo().structureHasRareData());
+        ASSERT(!m_hasRareData);
         return static_cast<Structure*>(m_previousOrRareData.get());
     }
 
     StructureRareData* rareData() const
     {
-        ASSERT(typeInfo().structureHasRareData());
+        ASSERT(m_hasRareData);
         return static_cast<StructureRareData*>(m_previousOrRareData.get());
     }
         
@@ -544,6 +544,7 @@
     unsigned m_preventExtensions : 1;
     unsigned m_didTransition : 1;
     unsigned m_staticFunctionReified : 1;
+    bool m_hasRareData : 1;
 };
 
 } // namespace JSC

Modified: branches/ftlopt/Source/_javascript_Core/runtime/StructureInlines.h (170214 => 170215)


--- branches/ftlopt/Source/_javascript_Core/runtime/StructureInlines.h	2014-06-20 22:10:37 UTC (rev 170214)
+++ branches/ftlopt/Source/_javascript_Core/runtime/StructureInlines.h	2014-06-20 22:27:36 UTC (rev 170215)
@@ -135,14 +135,14 @@
 inline void Structure::setEnumerationCache(VM& vm, JSPropertyNameIterator* enumerationCache)
 {
     ASSERT(!isDictionary());
-    if (!typeInfo().structureHasRareData())
+    if (!m_hasRareData)
         allocateRareData(vm);
     rareData()->setEnumerationCache(vm, this, enumerationCache);
 }
 
 inline JSPropertyNameIterator* Structure::enumerationCache()
 {
-    if (!typeInfo().structureHasRareData())
+    if (!m_hasRareData)
         return 0;
     return rareData()->enumerationCache();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to