Title: [144957] trunk/Source/_javascript_Core
Revision
144957
Author
[email protected]
Date
2013-03-06 11:43:24 -0800 (Wed, 06 Mar 2013)

Log Message

Pack Structure members better.
<http://webkit.org/b/111593>
<rdar://problem/13359200>

Reviewed by Mark Hahnenberg.

Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.

* runtime/Structure.cpp:
(JSC::Structure::Structure):
* runtime/Structure.h:
(Structure):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (144956 => 144957)


--- trunk/Source/_javascript_Core/ChangeLog	2013-03-06 19:34:32 UTC (rev 144956)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-03-06 19:43:24 UTC (rev 144957)
@@ -1,5 +1,20 @@
 2013-03-06  Andreas Kling  <[email protected]>
 
+        Pack Structure members better.
+        <http://webkit.org/b/111593>
+        <rdar://problem/13359200>
+
+        Reviewed by Mark Hahnenberg.
+
+        Shrink Structure by 8 bytes (now at 104 bytes) on 64-bit by packing the members better.
+
+        * runtime/Structure.cpp:
+        (JSC::Structure::Structure):
+        * runtime/Structure.h:
+        (Structure):
+
+2013-03-06  Andreas Kling  <[email protected]>
+
         Unreviewed, fix Windows build after r144910.
 
         * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:

Modified: trunk/Source/_javascript_Core/runtime/Structure.cpp (144956 => 144957)


--- trunk/Source/_javascript_Core/runtime/Structure.cpp	2013-03-06 19:34:32 UTC (rev 144956)
+++ trunk/Source/_javascript_Core/runtime/Structure.cpp	2013-03-06 19:43:24 UTC (rev 144957)
@@ -153,14 +153,14 @@
 
 Structure::Structure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo, IndexingType indexingType, unsigned inlineCapacity)
     : JSCell(globalData, globalData.structureStructure.get())
-    , m_typeInfo(typeInfo)
-    , m_indexingType(indexingType)
     , m_globalObject(globalData, this, globalObject, WriteBarrier<JSGlobalObject>::MayBeNull)
     , m_prototype(globalData, this, prototype)
     , m_classInfo(classInfo)
     , m_transitionWatchpointSet(InitializedWatching)
+    , m_offset(invalidOffset)
+    , m_typeInfo(typeInfo)
+    , m_indexingType(indexingType)
     , m_inlineCapacity(inlineCapacity)
-    , m_offset(invalidOffset)
     , m_dictionaryKind(NoneDictionaryKind)
     , m_isPinnedPropertyTable(false)
     , m_hasGetterSetterProperties(false)
@@ -181,13 +181,13 @@
 
 Structure::Structure(JSGlobalData& globalData)
     : JSCell(CreatingEarlyCell)
-    , m_typeInfo(CompoundType, OverridesVisitChildren)
-    , m_indexingType(0)
     , m_prototype(globalData, this, jsNull())
     , m_classInfo(&s_info)
     , m_transitionWatchpointSet(InitializedWatching)
+    , m_offset(invalidOffset)
+    , m_typeInfo(CompoundType, OverridesVisitChildren)
+    , m_indexingType(0)
     , m_inlineCapacity(0)
-    , m_offset(invalidOffset)
     , m_dictionaryKind(NoneDictionaryKind)
     , m_isPinnedPropertyTable(false)
     , m_hasGetterSetterProperties(false)
@@ -203,13 +203,13 @@
 
 Structure::Structure(JSGlobalData& globalData, const Structure* previous)
     : JSCell(globalData, globalData.structureStructure.get())
-    , m_typeInfo(previous->typeInfo())
-    , m_indexingType(previous->indexingTypeIncludingHistory())
     , m_prototype(globalData, this, previous->storedPrototype())
     , m_classInfo(previous->m_classInfo)
     , m_transitionWatchpointSet(InitializedWatching)
+    , m_offset(invalidOffset)
+    , m_typeInfo(previous->typeInfo())
+    , m_indexingType(previous->indexingTypeIncludingHistory())
     , m_inlineCapacity(previous->m_inlineCapacity)
-    , m_offset(invalidOffset)
     , m_dictionaryKind(previous->m_dictionaryKind)
     , m_isPinnedPropertyTable(false)
     , m_hasGetterSetterProperties(previous->m_hasGetterSetterProperties)

Modified: trunk/Source/_javascript_Core/runtime/Structure.h (144956 => 144957)


--- trunk/Source/_javascript_Core/runtime/Structure.h	2013-03-06 19:34:32 UTC (rev 144956)
+++ trunk/Source/_javascript_Core/runtime/Structure.h	2013-03-06 19:43:24 UTC (rev 144957)
@@ -437,9 +437,6 @@
     static const int s_maxTransitionLength = 64;
 
     static const unsigned maxSpecificFunctionThrashCount = 3;
-
-    TypeInfo m_typeInfo;
-    IndexingType m_indexingType;
         
     WriteBarrier<JSGlobalObject> m_globalObject;
     WriteBarrier<Unknown> m_prototype;
@@ -459,18 +456,21 @@
 
     mutable InlineWatchpointSet m_transitionWatchpointSet;
 
-    uint8_t m_inlineCapacity;
     COMPILE_ASSERT(firstOutOfLineOffset < 256, firstOutOfLineOffset_fits);
 
     // m_offset does not account for anonymous slots
     PropertyOffset m_offset;
 
+    TypeInfo m_typeInfo;
+    IndexingType m_indexingType;
+
+    uint8_t m_inlineCapacity;
     unsigned m_dictionaryKind : 2;
     bool m_isPinnedPropertyTable : 1;
     bool m_hasGetterSetterProperties : 1;
     bool m_hasReadOnlyOrGetterSetterPropertiesExcludingProto : 1;
     bool m_hasNonEnumerableProperties : 1;
-    unsigned m_attributesInPrevious : 22;
+    unsigned m_attributesInPrevious : 14;
     unsigned m_specificFunctionThrashCount : 2;
     unsigned m_preventExtensions : 1;
     unsigned m_didTransition : 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to