mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 925397 - Add JSObject::initDenseElementsUnbarriered() for use from PJS r=terrence
This commit is contained in:
parent
8439220a83
commit
04f091e6f9
@ -566,7 +566,7 @@ jit::InitRestParameterPar(ForkJoinSlice *slice, uint32_t length, Value *rest,
|
||||
res->ensureDenseElementsPreservePackedFlag(slice, 0, length);
|
||||
if (edr != JSObject::ED_OK)
|
||||
return nullptr;
|
||||
res->initDenseElements(0, rest, length);
|
||||
res->initDenseElementsUnbarriered(0, rest, length);
|
||||
res->as<ArrayObject>().setLengthInt32(length);
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,17 @@ class JSObject : public js::ObjectImpl
|
||||
void initDenseElements(uint32_t dstStart, const js::Value *src, uint32_t count) {
|
||||
JS_ASSERT(dstStart + count <= getDenseCapacity());
|
||||
memcpy(&elements[dstStart], src, count * sizeof(js::HeapSlot));
|
||||
DenseRangeWriteBarrierPost(runtimeFromAnyThread(), this, dstStart, count);
|
||||
DenseRangeWriteBarrierPost(runtimeFromMainThread(), this, dstStart, count);
|
||||
}
|
||||
|
||||
void initDenseElementsUnbarriered(uint32_t dstStart, const js::Value *src, uint32_t count) {
|
||||
/*
|
||||
* For use by parallel threads, which since they cannot see nursery
|
||||
* things do not require a barrier.
|
||||
*/
|
||||
JS_ASSERT(!js::CurrentThreadCanAccessRuntime(runtimeFromAnyThread()));
|
||||
JS_ASSERT(dstStart + count <= getDenseCapacity());
|
||||
memcpy(&elements[dstStart], src, count * sizeof(js::HeapSlot));
|
||||
}
|
||||
|
||||
void moveDenseElements(uint32_t dstStart, uint32_t srcStart, uint32_t count) {
|
||||
|
Loading…
Reference in New Issue
Block a user