summaryrefslogtreecommitdiffstats
path: root/js/src/jit/BaselineIC.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-23 15:20:34 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-23 15:20:34 +0000
commita42bed2e9a78715889240ff900e2391bef923285 (patch)
tree202c502b7e964384fb7f0639b756353374b0c045 /js/src/jit/BaselineIC.cpp
parent9a2224a97c7d258fc1f0e5fad30706987880ce22 (diff)
parent276f6583e00edf2a217a3092471ca2aa3aab5a09 (diff)
downloadUXP-a42bed2e9a78715889240ff900e2391bef923285.tar
UXP-a42bed2e9a78715889240ff900e2391bef923285.tar.gz
UXP-a42bed2e9a78715889240ff900e2391bef923285.tar.lz
UXP-a42bed2e9a78715889240ff900e2391bef923285.tar.xz
UXP-a42bed2e9a78715889240ff900e2391bef923285.zip
Merge branch 'master' into remove-unboxed
# Conflicts: # js/src/jit/BaselineIC.cpp # js/src/jsarray.cpp
Diffstat (limited to 'js/src/jit/BaselineIC.cpp')
-rw-r--r--js/src/jit/BaselineIC.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
index b6fcf85c1..64cdf01a6 100644
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -5752,10 +5752,18 @@ CopyArray(JSContext* cx, HandleArrayObject arr, MutableHandleValue result)
ArrayObject* nobj = NewFullyAllocatedArrayTryReuseGroup(cx, arr, length, TenuredObject);
if (!nobj)
return false;
+
+ MOZ_ASSERT(arr->isNative());
+ MOZ_ASSERT(nobj->isNative());
+ MOZ_ASSERT(nobj->as<NativeObject>().getDenseInitializedLength() == 0);
+ MOZ_ASSERT(arr->as<NativeObject>().getDenseInitializedLength() >= length);
+ MOZ_ASSERT(nobj->as<NativeObject>().getDenseCapacity() >= length);
+
nobj->as<NativeObject>().setDenseInitializedLength(length);
+
const Value* vp = arr->as<NativeObject>().getDenseElements();
nobj->as<NativeObject>().initDenseElements(0, vp, length);
-
+
result.setObject(*nobj);
return true;
}