Bug 1038038 (part 1) - Reduce ShapeTable::MIN_SIZE_LOG2. r=bhackett.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 13 Jul 2014 23:27:44 -0700
changeset 216206 4f65e26da8b4b511bf2ed631c65a2e370951dc65
parent 216205 ae7ad782c7125c6bc37eb731f8d65ed15f28a477
child 216207 6761558449da2a8db7b5ae6e0edf5469610dd324
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1038038
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1038038 (part 1) - Reduce ShapeTable::MIN_SIZE_LOG2. r=bhackett. An entryCount of zero is common, due to initBoundFunction(), so it's worth choosing a value that doesn't waste too much space in that case.
js/src/vm/Shape.h
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -125,17 +125,20 @@ static const uint32_t SHAPE_MAXIMUM_SLOT
 
 /*
  * Shapes use multiplicative hashing, but specialized to
  * minimize footprint.
  */
 struct ShapeTable {
     static const uint32_t HASH_BITS     = mozilla::tl::BitSize<HashNumber>::value;
     static const uint32_t MIN_ENTRIES   = 7;
-    static const uint32_t MIN_SIZE_LOG2 = 4;
+
+    // This value is low because it's common for a ShapeTable to be created
+    // with an entryCount of zero.
+    static const uint32_t MIN_SIZE_LOG2 = 2;
     static const uint32_t MIN_SIZE      = JS_BIT(MIN_SIZE_LOG2);
 
     int             hashShift;          /* multiplicative hash shift */
 
     uint32_t        entryCount;         /* number of entries in table */
     uint32_t        removedCount;       /* removed entry sentinels in table */
     uint32_t        freelist;           /* SHAPE_INVALID_SLOT or head of slot
                                            freelist in owning dictionary-mode