[INFER] Ensure that TypeObject->unknownProperties implies hasSpecialEquality, bug 619433.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 20 Mar 2011 11:54:33 -0700
changeset 74828 55f463c562d4fa3da5a8dd0ee426a8e24801324a
parent 74827 1396825bdbeee9f5567d9026a3e4ca712a872d16
child 74829 0e427e383bfdc706d7c71c2f8211c33a7084a063
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs619433
milestone2.0b13pre
[INFER] Ensure that TypeObject->unknownProperties implies hasSpecialEquality, bug 619433.
js/src/jsinfer.cpp
js/src/jsinferinlines.h
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -1563,16 +1563,17 @@ TypeCompartment::init(JSContext *cx)
     /*
      * Initialize the empty type object. This is not threaded onto the objects list,
      * will never be collected during GC, and does not have a proto or any properties
      * that need to be marked. It *can* have empty shapes, which are weak references.
      */
 #ifdef DEBUG
     typeEmpty.name_ = JSID_VOID;
 #endif
+    typeEmpty.hasSpecialEquality = true;
     typeEmpty.unknownProperties = true;
 
     if (cx && cx->getRunOptions() & JSOPTION_TYPE_INFERENCE)
         inferenceEnabled = true;
 
     JS_InitArenaPool(&pool, "typeinfer", 512, 8, NULL);
 }
 
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -1202,18 +1202,20 @@ inline TypeObject::TypeObject(jsid name,
 #ifdef DEBUG
     this->name_ = name;
 #endif
 
     InferSpew(ISpewOps, "newObject: %s", this->name());
 
     if (proto) {
         TypeObject *prototype = proto->getType();
-        if (prototype->unknownProperties)
+        if (prototype->unknownProperties) {
+            hasSpecialEquality = true;
             unknownProperties = true;
+        }
         instanceNext = prototype->instanceList;
         prototype->instanceList = this;
     }
 }
 
 inline TypeFunction::TypeFunction(jsid name, JSObject *proto)
     : TypeObject(name, proto), handler(NULL), script(NULL), isGeneric(false)
 {