Bug 684110 - Remove/inline array helper (r=pbiggar)
authorLuke Wagner <luke@mozilla.com>
Fri, 02 Sep 2011 17:23:36 -0700
changeset 76499 cf8b35fa1010b700d74b4edf64722f8a09529253
parent 76498 08b6eaf6aad0e7011f2287db663ab5f67404fd58
child 76500 25ee45edabe1cc2bc1fdfc7049718f613ac79426
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerspbiggar
bugs684110
milestone9.0a1
Bug 684110 - Remove/inline array helper (r=pbiggar)
js/src/jsarray.cpp
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -141,23 +141,16 @@
 
 #include "vm/ArgumentsObject-inl.h"
 #include "vm/Stack-inl.h"
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
-static inline bool
-ENSURE_SLOW_ARRAY(JSContext *cx, JSObject *obj)
-{
-    return obj->getClass() == &SlowArrayClass ||
-           obj->makeDenseArraySlow(cx);
-}
-
 JSBool
 js_GetLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp)
 {
     if (obj->isArray()) {
         *lengthp = obj->getArrayLength();
         return true;
     }
 
@@ -1529,17 +1522,17 @@ InitArrayElements(JSContext *cx, JSObjec
             return JS_FALSE;
         }
     }
 
     if (vector == end)
         return JS_TRUE;
 
     /* Finish out any remaining elements past the max array index. */
-    if (obj->isDenseArray() && !ENSURE_SLOW_ARRAY(cx, obj))
+    if (obj->isDenseArray() && !obj->makeDenseArraySlow(cx))
         return JS_FALSE;
 
     JS_ASSERT(start == MAX_ARRAY_INDEX + 1);
     AutoValueRooter tvr(cx);
     AutoIdRooter idr(cx);
     Value idval = DoubleValue(MAX_ARRAY_INDEX + 1);
     do {
         *tvr.addr() = *vector++;