[INFER] Don't add undefined type to arrays which holes were read from.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 14 Apr 2011 06:56:43 -0700
changeset 74943 eee58bb8f36703548e7a170637f09b6eee0c15d1
parent 74942 f3acaebac193105d97236099082f8b6dac613851
child 74944 dca50d9a5047bc9865bdb7390d8d39e24968a329
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
[INFER] Don't add undefined type to arrays which holes were read from.
js/src/jsinterp.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/StubCalls.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -4655,17 +4655,16 @@ BEGIN_CASE(JSOP_GETELEM)
     if (!JSID_IS_INT(id) && !script->typeMonitorUnknown(cx, regs.pc))
         goto error;
 
   end_getelem:
     regs.sp--;
     regs.sp[-1] = *copyFrom;
     assertSameCompartment(cx, regs.sp[-1]);
     if (copyFrom->isUndefined()) {
-        cx->addTypeProperty(obj->getType(), NULL, TYPE_UNDEFINED);
         if (!script->typeMonitorUndefined(cx, regs.pc))
             goto error;
     }
 }
 END_CASE(JSOP_GETELEM)
 
 BEGIN_CASE(JSOP_CALLELEM)
 {
--- a/js/src/methodjit/PolyIC.cpp
+++ b/js/src/methodjit/PolyIC.cpp
@@ -2565,18 +2565,16 @@ ic::GetElement(VMFrame &f, ic::GetElemen
         }
     }
 
     if (!obj->getProperty(cx, id, &f.regs.sp[-2]))
         THROW();
     if (!JSID_IS_INT(id) && !f.script()->typeMonitorUnknown(cx, f.pc()))
         THROW();
     if (f.regs.sp[-2].isUndefined()) {
-        if (idval.isInt32())
-            cx->addTypeProperty(obj->getType(), NULL, types::TYPE_UNDEFINED);
         if (!f.script()->typeMonitorUndefined(cx, f.pc()))
             THROW();
     }
 }
 
 #define APPLY_STRICTNESS(f, s)                          \
     (FunctionTemplateConditional(s, f<true>, f<false>))
 
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -514,17 +514,16 @@ stubs::GetElem(VMFrame &f)
 
     if (!JSID_IS_INT(id) && !f.script()->typeMonitorUnknown(cx, f.pc()))
         THROW();
 
   end_getelem:
     f.regs.sp[-2] = *copyFrom;
 
     if (copyFrom->isUndefined()) {
-        cx->addTypeProperty(obj->getType(), NULL, TYPE_UNDEFINED);
         if (!f.script()->typeMonitorUndefined(cx, f.pc()))
             THROW();
     }
 }
 
 static inline bool
 FetchElementId(VMFrame &f, JSObject *obj, const Value &idval, jsid &id, Value *vp)
 {