Bug 932769 - Increase the maximum value for type set definite property slots, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 01 Nov 2013 09:04:52 -0600
changeset 153079 2b4bd02c330055622bca30aa56f0682143a7fe81
parent 153078 44b7462b5de3db68ab246a940dce93caeef2ff2a
child 153080 29b8e502a2963b59358fd81ceea92ae7f998f2a3
push id25566
push userryanvm@gmail.com
push dateFri, 01 Nov 2013 18:40:05 +0000
treeherdermozilla-central@5bb07c1ae9f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs932769
milestone28.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 932769 - Increase the maximum value for type set definite property slots, r=jandem.
js/src/jsinfer.h
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -348,58 +348,58 @@ enum {
 
     /* Mask/shift for the number of objects in objectSet */
     TYPE_FLAG_OBJECT_COUNT_MASK   = 0x1f00,
     TYPE_FLAG_OBJECT_COUNT_SHIFT  = 8,
     TYPE_FLAG_OBJECT_COUNT_LIMIT  =
         TYPE_FLAG_OBJECT_COUNT_MASK >> TYPE_FLAG_OBJECT_COUNT_SHIFT,
 
     /* Whether the contents of this type set are totally unknown. */
-    TYPE_FLAG_UNKNOWN             = 0x00010000,
+    TYPE_FLAG_UNKNOWN             = 0x00002000,
 
     /* Mask of normal type flags on a type set. */
-    TYPE_FLAG_BASE_MASK           = 0x000100ff,
+    TYPE_FLAG_BASE_MASK           = 0x000020ff,
 
     /*
      * Flags describing the kind of type set this is.
      *
      * - StackTypeSet are associated with TypeScripts, for arguments and values
      *   observed at property reads. These are implicitly frozen on compilation
      *   and do not have constraints attached to them.
      *
      * - HeapTypeSet are associated with the properties of TypeObjects. These
      *   may have constraints added to them to trigger invalidation of compiled
      *   code.
      *
      * - TemporaryTypeSet are created during compilation and do not outlive
      *   that compilation.
      */
-    TYPE_FLAG_STACK_SET           = 0x00020000,
-    TYPE_FLAG_HEAP_SET            = 0x00040000,
+    TYPE_FLAG_STACK_SET           = 0x00004000,
+    TYPE_FLAG_HEAP_SET            = 0x00008000,
 
     /* Additional flags for HeapTypeSet sets. */
 
     /*
      * Whether the property has ever been deleted or reconfigured to behave
      * differently from a normal native property (e.g. made non-writable or
      * given a scripted getter or setter).
      */
-    TYPE_FLAG_CONFIGURED_PROPERTY = 0x00080000,
+    TYPE_FLAG_CONFIGURED_PROPERTY = 0x00010000,
 
     /*
      * Whether the property is definitely in a particular slot on all objects
      * from which it has not been deleted or reconfigured. For singletons
      * this may be a fixed or dynamic slot, and for other objects this will be
      * a fixed slot.
+     *
+     * If the property is definite, mask and shift storing the slot + 1.
+     * Otherwise these bits are clear.
      */
-    TYPE_FLAG_DEFINITE_PROPERTY   = 0x00100000,
-
-    /* If the property is definite, mask and shift storing the slot. */
-    TYPE_FLAG_DEFINITE_MASK       = 0xffe00000,
-    TYPE_FLAG_DEFINITE_SHIFT      = 21
+    TYPE_FLAG_DEFINITE_MASK       = 0xfffe0000,
+    TYPE_FLAG_DEFINITE_SHIFT      = 17
 };
 typedef uint32_t TypeFlags;
 
 /* Flags and other state stored in TypeObject::flags */
 enum {
     /*
      * UNUSED FLAG                    = 0x1,
      */
@@ -519,20 +519,20 @@ class TypeSet
     bool hasAnyFlag(TypeFlags flags) const {
         JS_ASSERT((flags & TYPE_FLAG_BASE_MASK) == flags);
         return !!(baseFlags() & flags);
     }
 
     bool configuredProperty() const {
         return flags & TYPE_FLAG_CONFIGURED_PROPERTY;
     }
-    bool definiteProperty() const { return flags & TYPE_FLAG_DEFINITE_PROPERTY; }
+    bool definiteProperty() const { return flags & TYPE_FLAG_DEFINITE_MASK; }
     unsigned definiteSlot() const {
         JS_ASSERT(definiteProperty());
-        return flags >> TYPE_FLAG_DEFINITE_SHIFT;
+        return (flags >> TYPE_FLAG_DEFINITE_SHIFT) - 1;
     }
 
     /* Join two type sets into a new set. The result should not be modified further. */
     static TemporaryTypeSet *unionSets(TypeSet *a, TypeSet *b, LifoAlloc *alloc);
 
     /* Add a type to this set using the specified allocator. */
     inline bool addType(Type type, LifoAlloc *alloc, bool *padded = nullptr);
 
@@ -562,21 +562,21 @@ class TypeSet
 
     /* The Class of an object in this set. */
     inline const Class *getObjectClass(unsigned i) const;
 
     void setConfiguredProperty() {
         flags |= TYPE_FLAG_CONFIGURED_PROPERTY;
     }
     bool canSetDefinite(unsigned slot) {
-        return slot <= (TYPE_FLAG_DEFINITE_MASK >> TYPE_FLAG_DEFINITE_SHIFT);
+        return (slot + 1) <= (TYPE_FLAG_DEFINITE_MASK >> TYPE_FLAG_DEFINITE_SHIFT);
     }
     void setDefinite(unsigned slot) {
         JS_ASSERT(canSetDefinite(slot));
-        flags |= TYPE_FLAG_DEFINITE_PROPERTY | (slot << TYPE_FLAG_DEFINITE_SHIFT);
+        flags |= ((slot + 1) << TYPE_FLAG_DEFINITE_SHIFT);
     }
 
     bool isStackSet() {
         return flags & TYPE_FLAG_STACK_SET;
     }
     bool isHeapSet() {
         return flags & TYPE_FLAG_HEAP_SET;
     }