diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-14 11:33:28 +0000 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-14 11:33:28 +0000 |
commit | 7d93d4989f49bfcb1aa6b87f81332332a750c49c (patch) | |
tree | 902bb1f380bbc98145df691536aa652b216c1bfe /js/src/jsarray.cpp | |
parent | e913687dc585606e50550ad77e2d8a744b5e6493 (diff) | |
download | UXP-7d93d4989f49bfcb1aa6b87f81332332a750c49c.tar UXP-7d93d4989f49bfcb1aa6b87f81332332a750c49c.tar.gz UXP-7d93d4989f49bfcb1aa6b87f81332332a750c49c.tar.lz UXP-7d93d4989f49bfcb1aa6b87f81332332a750c49c.tar.xz UXP-7d93d4989f49bfcb1aa6b87f81332332a750c49c.zip |
Replace SetOrExtendBoxedOrUnboxedDenseElements with direct calls.
Diffstat (limited to 'js/src/jsarray.cpp')
-rw-r--r-- | js/src/jsarray.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 1c2b61667..dbbc67732 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -280,8 +280,8 @@ ElementAdder::append(JSContext* cx, HandleValue v) { MOZ_ASSERT(index_ < length_); if (resObj_) { - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, resObj_, index_, v.address(), 1); + NativeObject* resObj = &resObj_->as<NativeObject>(); + DenseElementResult result = resObj->setOrExtendDenseElements(cx, index_, v.address(), 1); if (result == DenseElementResult::Failure) return false; if (result == DenseElementResult::Incomplete) { @@ -390,8 +390,8 @@ SetArrayElement(JSContext* cx, HandleObject obj, double index, HandleValue v) MOZ_ASSERT(index >= 0); if (obj->is<ArrayObject>() && !obj->isIndexed() && index <= UINT32_MAX) { - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, uint32_t(index), v.address(), 1); + NativeObject* nobj = &obj->as<NativeObject>(); + DenseElementResult result = nobj->setOrExtendDenseElements(cx, uint32_t(index), v.address(), 1); if (result != DenseElementResult::Incomplete) return result == DenseElementResult::Success; } @@ -1299,8 +1299,9 @@ InitArrayElements(JSContext* cx, HandleObject obj, uint32_t start, return false; if (!ObjectMayHaveExtraIndexedProperties(obj)) { - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, start, vector, count, updateTypes); + NativeObject* nobj = &obj->as<NativeObject>(); + DenseElementResult result = nobj->setOrExtendDenseElements(cx, uint32_t(start), vector, + count, updateTypes); if (result != DenseElementResult::Incomplete) return result == DenseElementResult::Success; } @@ -2041,8 +2042,8 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp) if (!ObjectMayHaveExtraIndexedProperties(obj)) { DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, length, - args.array(), args.length()); + obj->as<NativeObject>().setOrExtendDenseElements(cx, uint32_t(length), + args.array(), args.length()); if (result != DenseElementResult::Incomplete) { if (result == DenseElementResult::Failure) return false; @@ -3647,8 +3648,7 @@ js::NewCopiedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, if (!obj) return nullptr; - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, 0, vp, length, updateTypes); + DenseElementResult result = obj->setOrExtendDenseElements(cx->asJSContext(), 0, vp, length, updateTypes); if (result == DenseElementResult::Failure) return nullptr; MOZ_ASSERT(result == DenseElementResult::Success); |