Bug 717805 - Remove CopyArrayElement. r=jwalden
authorReuben Morais <reuben.morais@gmail.com>
Tue, 17 Jan 2012 12:33:08 +0100
changeset 85892 762fa6f964a9f3ea192a7e6525d45f6c0b2984f9
parent 85891 a79c86c9392515ccc00ccd06de0b05663d5e1492
child 85893 b3435ec4db1d4c1d8beef39b590230d995b1936c
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs717805
milestone12.0a1
Bug 717805 - Remove CopyArrayElement. r=jwalden
js/src/jsarray.cpp
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -2576,29 +2576,16 @@ CanOptimizeForDenseStorage(JSObject *arr
     if (JS_UNLIKELY(arr->getType(cx)->hasAllFlags(OBJECT_FLAG_ITERATED)))
         return false;
 
     /* Now just watch out for getters and setters along the prototype chain. */
     return !js_PrototypeHasIndexedProperties(cx, arr) &&
            startingIndex + count <= arr->getDenseArrayInitializedLength();
 }
 
-static inline bool
-CopyArrayElement(JSContext *cx, JSObject *source, uint32_t sourceIndex,
-                 JSObject *target, uint32_t targetIndex)
-{
-    if (!JS_CHECK_OPERATION_LIMIT(cx))
-        return false;
-
-    JSBool hole;
-    Value fromValue;
-    return GetElement(cx, source, sourceIndex, &hole, &fromValue) &&
-           SetOrDeleteArrayElement(cx, target, targetIndex, hole, fromValue);
-}
-
 /* ES5 15.4.4.12. */
 static JSBool
 array_splice(JSContext *cx, uintN argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
     JSObject *obj = ToObject(cx, &args.thisv());