Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (228575 => 228576)
--- trunk/Source/_javascript_Core/ChangeLog 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,3 +1,46 @@
+2018-02-16 Filip Pizlo <fpi...@apple.com>
+
+ Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a
+ progression.
+
+ * assembler/AssemblerBuffer.h:
+ (JSC::AssemblerBuffer::append):
+ * heap/LargeAllocation.cpp:
+ (JSC::LargeAllocation::tryCreate):
+ * heap/MarkedBlock.cpp:
+ (JSC::MarkedBlock::Handle::didAddToDirectory):
+ * runtime/ArrayBuffer.cpp:
+ (JSC::ArrayBufferContents::tryAllocate):
+ (JSC::ArrayBufferContents::copyTo):
+ (JSC::ArrayBuffer::createInternal):
+ * runtime/ArrayBufferView.h:
+ (JSC::ArrayBufferView::zeroRangeImpl):
+ * runtime/ArrayConventions.cpp:
+ (JSC::clearArrayMemset):
+ * runtime/ArrayConventions.h:
+ (JSC::clearArray):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoPrivateFuncConcatMemcpy):
+ * runtime/ButterflyInlines.h:
+ (JSC::Butterfly::tryCreate):
+ (JSC::Butterfly::createOrGrowPropertyStorage):
+ (JSC::Butterfly::growArrayRight):
+ (JSC::Butterfly::resizeArray):
+ * runtime/GenericTypedArrayViewInlines.h:
+ (JSC::GenericTypedArrayView<Adaptor>::create):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::appendMemcpy):
+ (JSC::JSArray::fastSlice):
+ * runtime/JSArrayBufferView.cpp:
+ (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
+ * runtime/JSGenericTypedArrayViewInlines.h:
+ (JSC::JSGenericTypedArrayView<Adaptor>::set):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::constructConvertedArrayStorageWithoutCopyingElements):
+ (JSC::JSObject::shiftButterflyAfterFlattening):
+ * runtime/PropertyTable.cpp:
+ (JSC::PropertyTable::PropertyTable):
+
2018-02-16 Saam Barati <sbar...@apple.com>
Fix bugs from r228411
Modified: trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h (228575 => 228576)
--- trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/assembler/AssemblerBuffer.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2012, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -277,7 +277,7 @@
if (!isAvailable(size))
grow(size);
- fastCopyBytes(m_storage.buffer() + m_index, data, size);
+ memcpy(m_storage.buffer() + m_index, data, size);
m_index += size;
}
Modified: trunk/Source/_javascript_Core/heap/LargeAllocation.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/heap/LargeAllocation.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/heap/LargeAllocation.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -45,7 +45,7 @@
return nullptr;
// Make sure that the padding does not contain useful things.
- fastZeroFillBytes(static_cast<char*>(space) + sizeBeforeDistancing, distancing);
+ memset(static_cast<char*>(space) + sizeBeforeDistancing, 0, distancing);
if (scribbleFreeCells())
scribble(space, size);
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -358,7 +358,7 @@
if (m_attributes.securityKind != SecurityKind::JSValueOOB
|| m_securityOriginToken != securityOriginToken)
- fastZeroFillBytes(&block(), m_endAtom * atomSize);
+ memset(&block(), 0, m_endAtom * atomSize);
}
m_attributes = directory->attributes();
Modified: trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -113,7 +113,7 @@
}
if (policy == ZeroInitialize)
- fastZeroFillBytes(m_data.get(), size);
+ memset(m_data.get(), 0, size);
m_sizeInBytes = numElements * elementByteSize;
m_destructor = [] (void* p) { Gigacage::free(Gigacage::Primitive, p); };
@@ -141,7 +141,7 @@
other.tryAllocate(m_sizeInBytes, sizeof(char), ArrayBufferContents::DontInitialize);
if (!other.m_data)
return;
- fastCopyBytes(other.m_data.get(), m_data.get(), m_sizeInBytes);
+ memcpy(other.m_data.get(), m_data.get(), m_sizeInBytes);
other.m_sizeInBytes = m_sizeInBytes;
}
@@ -246,7 +246,7 @@
{
ASSERT(!byteLength || source);
auto buffer = adoptRef(*new ArrayBuffer(WTFMove(contents)));
- fastCopyBytes(buffer->data(), source, byteLength);
+ memcpy(buffer->data(), source, byteLength);
return buffer;
}
Modified: trunk/Source/_javascript_Core/runtime/ArrayBufferView.h (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ArrayBufferView.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ArrayBufferView.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -215,7 +215,7 @@
}
uint8_t* base = static_cast<uint8_t*>(baseAddress());
- fastZeroFillBytes(base + byteOffset, rangeByteLength);
+ memset(base + byteOffset, 0, rangeByteLength);
return true;
}
Modified: trunk/Source/_javascript_Core/runtime/ArrayConventions.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ArrayConventions.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ArrayConventions.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -31,6 +31,21 @@
namespace JSC {
#if USE(JSVALUE64)
+void clearArrayMemset(WriteBarrier<Unknown>* base, unsigned count)
+{
+#if CPU(X86_64) && COMPILER(GCC_OR_CLANG)
+ uint64_t zero = 0;
+ asm volatile (
+ "rep stosq\n\t"
+ : "+D"(base), "+c"(count)
+ : "a"(zero)
+ : "memory"
+ );
+#else // not CPU(X86_64)
+ memset(base, 0, count * sizeof(WriteBarrier<Unknown>));
+#endif // generic CPU
+}
+
void clearArrayMemset(double* base, unsigned count)
{
#if CPU(X86_64) && COMPILER(GCC_OR_CLANG)
Modified: trunk/Source/_javascript_Core/runtime/ArrayConventions.h (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ArrayConventions.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ArrayConventions.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -117,6 +117,7 @@
}
#if USE(JSVALUE64)
+JS_EXPORT_PRIVATE void clearArrayMemset(WriteBarrier<Unknown>* base, unsigned count);
JS_EXPORT_PRIVATE void clearArrayMemset(double* base, unsigned count);
#endif // USE(JSVALUE64)
@@ -123,11 +124,15 @@
ALWAYS_INLINE void clearArray(WriteBarrier<Unknown>* base, unsigned count)
{
#if USE(JSVALUE64)
- fastZeroFill(base, count);
-#else
+ const unsigned minCountForMemset = 100;
+ if (count >= minCountForMemset) {
+ clearArrayMemset(base, count);
+ return;
+ }
+#endif
+
for (unsigned i = count; i--;)
base[i].clear();
-#endif
}
ALWAYS_INLINE void clearArray(double* base, unsigned count)
Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1341,18 +1341,19 @@
if (type == ArrayWithDouble) {
double* buffer = result->butterfly()->contiguousDouble().data();
- fastCopy(buffer, firstButterfly->contiguousDouble().data(), firstArraySize);
- fastCopy(buffer + firstArraySize, secondButterfly->contiguousDouble().data(), secondArraySize);
+ memcpy(buffer, firstButterfly->contiguousDouble().data(), sizeof(JSValue) * firstArraySize);
+ memcpy(buffer + firstArraySize, secondButterfly->contiguousDouble().data(), sizeof(JSValue) * secondArraySize);
} else if (type != ArrayWithUndecided) {
WriteBarrier<Unknown>* buffer = result->butterfly()->contiguous().data();
auto copy = [&] (unsigned offset, void* source, unsigned size, IndexingType type) {
if (type != ArrayWithUndecided) {
- fastCopy(buffer + offset, static_cast<WriteBarrier<Unknown>*>(source), size);
+ memcpy(buffer + offset, source, sizeof(JSValue) * size);
return;
}
- clearArray(buffer + offset, size);
+ for (unsigned i = size; i--;)
+ buffer[i + offset].clear();
};
copy(0, firstButterfly->contiguous().data(), firstArraySize, firstType);
Modified: trunk/Source/_javascript_Core/runtime/ButterflyInlines.h (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/ButterflyInlines.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/ButterflyInlines.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -93,7 +93,7 @@
Butterfly* result = fromBase(base, preCapacity, propertyCapacity);
if (hasIndexingHeader)
*result->indexingHeader() = indexingHeader;
- fastZeroFill(result->propertyStorage() - propertyCapacity, propertyCapacity);
+ memset(result->propertyStorage() - propertyCapacity, 0, propertyCapacity * sizeof(EncodedJSValue));
return result;
}
@@ -129,13 +129,14 @@
bool hasIndexingHeader = structure->hasIndexingHeader(intendedOwner);
Butterfly* result = createUninitialized(
vm, intendedOwner, preCapacity, newPropertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
- fastCopyBytes(
+ memcpy(
result->propertyStorage() - oldPropertyCapacity,
oldButterfly->propertyStorage() - oldPropertyCapacity,
totalSize(0, oldPropertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes));
- fastZeroFill(
+ memset(
result->propertyStorage() - newPropertyCapacity,
- newPropertyCapacity - oldPropertyCapacity);
+ 0,
+ (newPropertyCapacity - oldPropertyCapacity) * sizeof(EncodedJSValue));
return result;
}
@@ -167,7 +168,8 @@
void* newBase = vm.jsValueGigacageAuxiliarySpace.allocateNonVirtual(vm, newSize, nullptr, AllocationFailureMode::ReturnNull);
if (!newBase)
return nullptr;
- fastCopyBytes(newBase, theBase, oldSize);
+ // FIXME: This probably shouldn't be a memcpy.
+ memcpy(newBase, theBase, oldSize);
return fromBase(newBase, 0, propertyCapacity);
}
@@ -197,7 +199,7 @@
size_t size = std::min(
totalSize(0, propertyCapacity, oldHasIndexingHeader, oldIndexingPayloadSizeInBytes),
totalSize(0, propertyCapacity, newHasIndexingHeader, newIndexingPayloadSizeInBytes));
- fastCopyBytes(to, from, size);
+ memcpy(to, from, size);
return result;
}
Modified: trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -52,7 +52,7 @@
const typename Adaptor::Type* array, unsigned length)
{
RefPtr<GenericTypedArrayView> result = create(length);
- fastCopy(result->data(), array, length);
+ memcpy(result->data(), array, length * sizeof(typename Adaptor::Type));
return result;
}
Modified: trunk/Source/_javascript_Core/runtime/JSArray.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/JSArray.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/JSArray.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -553,9 +553,9 @@
butterfly->contiguousInt32().at(this, i).setWithoutWriteBarrier(JSValue());
}
} else if (type == ArrayWithDouble)
- fastCopy(butterfly()->contiguousDouble().data() + startIndex, otherArray->butterfly()->contiguousDouble().data(), otherLength);
+ memcpy(butterfly()->contiguousDouble().data() + startIndex, otherArray->butterfly()->contiguousDouble().data(), sizeof(JSValue) * otherLength);
else
- fastCopy(butterfly()->contiguous().data() + startIndex, otherArray->butterfly()->contiguous().data(), otherLength);
+ memcpy(butterfly()->contiguous().data() + startIndex, otherArray->butterfly()->contiguous().data(), sizeof(JSValue) * otherLength);
return true;
}
@@ -761,9 +761,9 @@
auto& resultButterfly = *resultArray->butterfly();
if (arrayType == ArrayWithDouble)
- fastCopy(resultButterfly.contiguousDouble().data(), butterfly()->contiguousDouble().data() + startIndex, count);
+ memcpy(resultButterfly.contiguousDouble().data(), butterfly()->contiguousDouble().data() + startIndex, sizeof(JSValue) * count);
else
- fastCopy(resultButterfly.contiguous().data(), butterfly()->contiguous().data() + startIndex, count);
+ memcpy(resultButterfly.contiguous().data(), butterfly()->contiguous().data() + startIndex, sizeof(JSValue) * count);
resultButterfly.setPublicLength(count);
return resultArray;
Modified: trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/JSArrayBufferView.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -94,7 +94,7 @@
if (!m_vector)
return;
if (mode == ZeroFill)
- fastZeroFillBytes(m_vector.get(), size);
+ memset(m_vector.get(), 0, size);
vm.heap.reportExtraMemoryAllocated(static_cast<size_t>(length) * elementSize);
Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -246,7 +246,7 @@
const ClassInfo* ci = object->classInfo(vm);
if (ci->typedArrayStorageType == Adaptor::typeValue) {
- // The super fast case: we can just memmove since we're the same type.
+ // The super fast case: we can just memcpy since we're the same type.
JSGenericTypedArrayView* other = jsCast<JSGenericTypedArrayView*>(object);
length = std::min(length, other->length());
Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/JSObject.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1178,10 +1178,10 @@
Butterfly* newButterfly = Butterfly::createUninitialized(
vm, this, 0, propertyCapacity, true, ArrayStorage::sizeFor(neededLength));
- fastCopy(
+ memcpy(
newButterfly->propertyStorage() - propertySize,
m_butterfly->propertyStorage() - propertySize,
- propertySize);
+ propertySize * sizeof(EncodedJSValue));
ArrayStorage* newStorage = newButterfly->arrayStorage();
newStorage->setVectorLength(neededLength);
@@ -3572,7 +3572,7 @@
void* currentBase = oldButterfly->base(0, outOfLineCapacityAfter);
void* newBase = newButterfly->base(0, outOfLineCapacityAfter);
- fastCopyBytes(newBase, currentBase, Butterfly::totalSize(0, outOfLineCapacityAfter, hasIndexingHeader, indexingPayloadSizeInBytes));
+ memcpy(newBase, currentBase, Butterfly::totalSize(0, outOfLineCapacityAfter, hasIndexingHeader, indexingPayloadSizeInBytes));
setButterfly(vm, newButterfly);
}
Modified: trunk/Source/_javascript_Core/runtime/PropertyTable.cpp (228575 => 228576)
--- trunk/Source/_javascript_Core/runtime/PropertyTable.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/_javascript_Core/runtime/PropertyTable.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -74,7 +74,7 @@
{
ASSERT(isPowerOf2(m_indexSize));
- fastCopyBytes(m_index, other.m_index, dataSize());
+ memcpy(m_index, other.m_index, dataSize());
iterator end = this->end();
for (iterator iter = begin(); iter != end; ++iter)
Modified: trunk/Source/WTF/ChangeLog (228575 => 228576)
--- trunk/Source/WTF/ChangeLog 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/ChangeLog 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,3 +1,56 @@
+2018-02-16 Filip Pizlo <fpi...@apple.com>
+
+ Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a
+ progression.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/BitVector.cpp:
+ (WTF::BitVector::setSlow):
+ (WTF::BitVector::clearAll):
+ (WTF::BitVector::resizeOutOfLine):
+ * wtf/BitVector.h:
+ (WTF::BitVector::OutOfLineBits::numWords const):
+ (WTF::BitVector::wordCount): Deleted.
+ * wtf/CMakeLists.txt:
+ * wtf/ConcurrentBuffer.h:
+ (WTF::ConcurrentBuffer::growExact):
+ * wtf/FastBitVector.h:
+ (WTF::FastBitVectorWordOwner::operator=):
+ (WTF::FastBitVectorWordOwner::clearAll):
+ (WTF::FastBitVectorWordOwner::set):
+ * wtf/FastCopy.h: Removed.
+ * wtf/FastMalloc.cpp:
+ (WTF::fastZeroedMalloc):
+ (WTF::fastStrDup):
+ (WTF::tryFastZeroedMalloc):
+ * wtf/FastZeroFill.h: Removed.
+ * wtf/OSAllocator.h:
+ (WTF::OSAllocator::reallocateCommitted):
+ * wtf/StringPrintStream.cpp:
+ (WTF::StringPrintStream::increaseSize):
+ * wtf/Vector.h:
+ * wtf/persistence/PersistentDecoder.cpp:
+ (WTF::Persistence::Decoder::decodeFixedLengthData):
+ * wtf/persistence/PersistentEncoder.cpp:
+ (WTF::Persistence::Encoder::encodeFixedLengthData):
+ * wtf/text/CString.cpp:
+ (WTF::CString::init):
+ (WTF::CString::copyBufferIfNeeded):
+ * wtf/text/LineBreakIteratorPoolICU.h:
+ (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
+ * wtf/text/StringBuilder.cpp:
+ (WTF::StringBuilder::allocateBuffer):
+ (WTF::StringBuilder::append):
+ * wtf/text/StringConcatenate.h:
+ * wtf/text/StringImpl.h:
+ (WTF::StringImpl::copyCharacters):
+ * wtf/text/icu/UTextProvider.cpp:
+ (WTF::uTextCloneImpl):
+ * wtf/text/icu/UTextProviderLatin1.cpp:
+ (WTF::uTextLatin1Clone):
+ (WTF::openLatin1UTextProvider):
+ * wtf/threads/Signals.cpp:
+
2018-02-16 Keith Miller <keith_mil...@apple.com>
Remove unused line from Platform.h
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (228575 => 228576)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-02-16 21:38:53 UTC (rev 228576)
@@ -206,8 +206,6 @@
0F5F3D681F3FEBA600B115A2 /* CagedUniquePtr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CagedUniquePtr.h; sourceTree = "<group>"; };
0F60F32D1DFCBD1B00416D6C /* LockedPrintStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LockedPrintStream.cpp; sourceTree = "<group>"; };
0F60F32E1DFCBD1B00416D6C /* LockedPrintStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockedPrintStream.h; sourceTree = "<group>"; };
- 0F62A8A6202CCC14007B8623 /* FastCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastCopy.h; sourceTree = "<group>"; };
- 0F62A8A7202CCC15007B8623 /* FastZeroFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastZeroFill.h; sourceTree = "<group>"; };
0F66B2801DC97BAB004A1D3F /* ClockType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClockType.cpp; sourceTree = "<group>"; };
0F66B2811DC97BAB004A1D3F /* ClockType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClockType.h; sourceTree = "<group>"; };
0F66B2821DC97BAB004A1D3F /* MonotonicTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MonotonicTime.cpp; sourceTree = "<group>"; };
@@ -866,11 +864,9 @@
A8A4729F151A825A004123FF /* ExportMacros.h */,
0F7C5FB51D885CF20044F5E2 /* FastBitVector.cpp */,
0FD81AC4154FB22E00983E72 /* FastBitVector.h */,
- 0F62A8A6202CCC14007B8623 /* FastCopy.h */,
A8A472A1151A825A004123FF /* FastMalloc.cpp */,
A8A472A2151A825A004123FF /* FastMalloc.h */,
0F79C7C31E73511800EB34D1 /* FastTLS.h */,
- 0F62A8A7202CCC15007B8623 /* FastZeroFill.h */,
B38FD7BC168953E80065C969 /* FeatureDefines.h */,
0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */,
0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
Modified: trunk/Source/WTF/wtf/BitVector.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/BitVector.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/BitVector.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,9 +29,7 @@
#include <algorithm>
#include <string.h>
#include <wtf/Assertions.h>
-#include <wtf/FastCopy.h>
#include <wtf/FastMalloc.h>
-#include <wtf/FastZeroFill.h>
#include <wtf/StdLibExtras.h>
namespace WTF {
@@ -43,7 +41,7 @@
newBitsOrPointer = other.m_bitsOrPointer;
else {
OutOfLineBits* newOutOfLineBits = OutOfLineBits::create(other.size());
- fastCopy(newOutOfLineBits->bits(), other.bits(), wordCount(other.size()));
+ memcpy(newOutOfLineBits->bits(), other.bits(), byteCount(other.size()));
newBitsOrPointer = bitwise_cast<uintptr_t>(newOutOfLineBits) >> 1;
}
if (!isInline() && !isEmptyOrDeletedValue())
@@ -71,7 +69,7 @@
if (isInline())
m_bitsOrPointer = makeInlineBits(0);
else
- fastZeroFill(outOfLineBits()->bits(), wordCount(size()));
+ memset(outOfLineBits()->bits(), 0, byteCount(size()));
}
BitVector::OutOfLineBits* BitVector::OutOfLineBits::create(size_t numBits)
@@ -95,14 +93,14 @@
if (isInline()) {
// Make sure that all of the bits are zero in case we do a no-op resize.
*newOutOfLineBits->bits() = m_bitsOrPointer & ~(static_cast<uintptr_t>(1) << maxInlineBits());
- fastZeroFill(newOutOfLineBits->bits() + 1, newNumWords - 1);
+ memset(newOutOfLineBits->bits() + 1, 0, (newNumWords - 1) * sizeof(void*));
} else {
if (numBits > size()) {
size_t oldNumWords = outOfLineBits()->numWords();
- fastCopy(newOutOfLineBits->bits(), outOfLineBits()->bits(), oldNumWords);
- fastZeroFill(newOutOfLineBits->bits() + oldNumWords, newNumWords - oldNumWords);
+ memcpy(newOutOfLineBits->bits(), outOfLineBits()->bits(), oldNumWords * sizeof(void*));
+ memset(newOutOfLineBits->bits() + oldNumWords, 0, (newNumWords - oldNumWords) * sizeof(void*));
} else
- fastCopy(newOutOfLineBits->bits(), outOfLineBits()->bits(), newOutOfLineBits->numWords());
+ memcpy(newOutOfLineBits->bits(), outOfLineBits()->bits(), newOutOfLineBits->numWords() * sizeof(void*));
OutOfLineBits::destroy(outOfLineBits());
}
m_bitsOrPointer = bitwise_cast<uintptr_t>(newOutOfLineBits) >> 1;
Modified: trunk/Source/WTF/wtf/BitVector.h (228575 => 228576)
--- trunk/Source/WTF/wtf/BitVector.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/BitVector.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -354,11 +354,6 @@
return (bitCount + 7) >> 3;
}
- static size_t wordCount(uintptr_t bits)
- {
- return (bits + bitsInPointer() - 1) / bitsInPointer();
- }
-
static uintptr_t makeInlineBits(uintptr_t bits)
{
ASSERT(!(bits & (static_cast<uintptr_t>(1) << maxInlineBits())));
@@ -423,7 +418,7 @@
class OutOfLineBits {
public:
size_t numBits() const { return m_numBits; }
- size_t numWords() const { return wordCount(m_numBits); }
+ size_t numWords() const { return (m_numBits + bitsInPointer() - 1) / bitsInPointer(); }
uintptr_t* bits() { return bitwise_cast<uintptr_t*>(this + 1); }
const uintptr_t* bits() const { return bitwise_cast<const uintptr_t*>(this + 1); }
Modified: trunk/Source/WTF/wtf/CMakeLists.txt (228575 => 228576)
--- trunk/Source/WTF/wtf/CMakeLists.txt 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/CMakeLists.txt 2018-02-16 21:38:53 UTC (rev 228576)
@@ -59,10 +59,8 @@
Expected.h
ExportMacros.h
FastBitVector.h
- FastCopy.h
FastMalloc.h
FastTLS.h
- FastZeroFill.h
FeatureDefines.h
FilePrintStream.h
FlipBytes.h
Modified: trunk/Source/WTF/wtf/ConcurrentBuffer.h (228575 => 228576)
--- trunk/Source/WTF/wtf/ConcurrentBuffer.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/ConcurrentBuffer.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -26,7 +26,6 @@
#pragma once
#include <wtf/Atomics.h>
-#include <wtf/FastCopy.h>
#include <wtf/FastMalloc.h>
#include <wtf/HashFunctions.h>
#include <wtf/Lock.h>
@@ -66,7 +65,7 @@
Array* newArray = createArray(newSize);
// This allows us to do ConcurrentBuffer<std::unique_ptr<>>.
if (array)
- fastCopy(newArray->data, array->data, array->size);
+ memcpy(newArray->data, array->data, sizeof(T) * array->size);
for (size_t i = array ? array->size : 0; i < newSize; ++i)
new (newArray->data + i) T();
WTF::storeStoreFence();
Modified: trunk/Source/WTF/wtf/FastBitVector.h (228575 => 228576)
--- trunk/Source/WTF/wtf/FastBitVector.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/FastBitVector.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,9 +27,7 @@
#include <string.h>
#include <wtf/Atomics.h>
-#include <wtf/FastCopy.h>
#include <wtf/FastMalloc.h>
-#include <wtf/FastZeroFill.h>
#include <wtf/PrintStream.h>
#include <wtf/StdLibExtras.h>
@@ -97,7 +95,7 @@
if (arrayLength() != other.arrayLength())
setEqualsSlow(other);
else {
- fastCopy(m_words, other.m_words, arrayLength());
+ memcpy(m_words, other.m_words, arrayLength() * sizeof(uint32_t));
m_numBits = other.m_numBits;
}
return *this;
@@ -117,13 +115,13 @@
void clearAll()
{
- fastZeroFill(m_words, arrayLength());
+ memset(m_words, 0, arrayLength() * sizeof(uint32_t));
}
void set(const FastBitVectorWordOwner& other)
{
ASSERT_WITH_SECURITY_IMPLICATION(m_numBits == other.m_numBits);
- fastCopy(m_words, other.m_words, arrayLength());
+ memcpy(m_words, other.m_words, arrayLength() * sizeof(uint32_t));
}
size_t numBits() const
Deleted: trunk/Source/WTF/wtf/FastCopy.h (228575 => 228576)
--- trunk/Source/WTF/wtf/FastCopy.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/FastCopy.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/StdLibExtras.h>
-
-namespace WTF {
-
-template<typename T>
-void fastCopy(T* dst, const T* src, size_t length)
-{
-#if CPU(X86_64) && COMPILER(GCC_OR_CLANG)
- uint64_t tmp = 0;
- size_t count = length * sizeof(T);
- if (!(sizeof(T) % sizeof(uint64_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $3, %%rcx\n\t"
- "rep movsq\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint32_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $2, %%rcx\n\t"
- "rep movsl\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $4, %%rcx\n\t" // FIXME: This isn't really a loop. https://bugs.webkit.org/show_bug.cgi?id=182617
- "4:\n\t"
- "movl (%%rsi, %%rcx), %%eax\n\t"
- "movl %%eax, (%%rdi, %%rcx)\n\t"
- "subq $4, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint16_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $1, %%rcx\n\t"
- "rep movsw\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $6, %%rcx\n\t"
- "4:\n\t"
- "movw (%%rsi, %%rcx), %%ax\n\t"
- "movw %%ax, (%%rdi, %%rcx)\n\t"
- "subq $2, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "rep movsb\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $7, %%rcx\n\t"
- "4:\n\t"
- "movb (%%rsi, %%rcx), %%al\n\t"
- "movb %%al, (%%rdi, %%rcx)\n\t"
- "subq $1, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
-#else
- memcpy(dst, src, length * sizeof(T));
-#endif
-}
-
-inline void fastCopyBytes(void* dst, const void* src, size_t bytes)
-{
- fastCopy(static_cast<char*>(dst), static_cast<const char*>(src), bytes);
-}
-
-} // namespace WTF
-
-using WTF::fastCopy;
-using WTF::fastCopyBytes;
Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/FastMalloc.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005, 2007, Google Inc. All rights reserved.
- * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -31,8 +31,6 @@
#include <limits>
#include <string.h>
#include <wtf/DataLog.h>
-#include <wtf/FastCopy.h>
-#include <wtf/FastZeroFill.h>
#if OS(WINDOWS)
#include <windows.h>
@@ -80,7 +78,7 @@
void* fastZeroedMalloc(size_t n)
{
void* result = fastMalloc(n);
- fastZeroFillBytes(result, n);
+ memset(result, 0, n);
return result;
}
@@ -88,7 +86,7 @@
{
size_t len = strlen(src) + 1;
char* dup = static_cast<char*>(fastMalloc(len));
- fastCopy(dup, src, len);
+ memcpy(dup, src, len);
return dup;
}
@@ -97,7 +95,7 @@
void* result;
if (!tryFastMalloc(n).getValue(result))
return 0;
- fastZeroFillBytes(result, n);
+ memset(result, 0, n);
return result;
}
Deleted: trunk/Source/WTF/wtf/FastZeroFill.h (228575 => 228576)
--- trunk/Source/WTF/wtf/FastZeroFill.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/FastZeroFill.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/StdLibExtras.h>
-
-namespace WTF {
-
-template<typename T>
-void fastZeroFill(T* dst, size_t length)
-{
-#if CPU(X86_64) && COMPILER(GCC_OR_CLANG)
- uint64_t zero = 0;
- size_t count = length * sizeof(T);
- if (!(sizeof(T) % sizeof(uint64_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $3, %%rcx\n\t"
- "rep stosq\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint32_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $2, %%rcx\n\t"
- "rep stosl\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $4, %%rcx\n\t" // FIXME: This isn't really a loop. https://bugs.webkit.org/show_bug.cgi?id=182617
- "4:\n\t"
- "movl %%eax, (%%rdi, %%rcx)\n\t"
- "subq $4, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint16_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $1, %%rcx\n\t"
- "rep stosw\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $6, %%rcx\n\t"
- "4:\n\t"
- "movw %%ax, (%%rdi, %%rcx)\n\t"
- "subq $2, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "rep stosb\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $7, %%rcx\n\t"
- "4:\n\t"
- "movb %%al, (%%rdi, %%rcx)\n\t"
- "sub $1, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
-#else
- memset(dst, 0, length * sizeof(T));
-#endif
-}
-
-inline void fastZeroFillBytes(void* dst, size_t bytes)
-{
- fastZeroFill(static_cast<char*>(dst), bytes);
-}
-
-} // namespace WTF
-
-using WTF::fastZeroFill;
-using WTF::fastZeroFillBytes;
Modified: trunk/Source/WTF/wtf/OSAllocator.h (228575 => 228576)
--- trunk/Source/WTF/wtf/OSAllocator.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/OSAllocator.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,7 +27,6 @@
#define OSAllocator_h
#include <algorithm>
-#include <wtf/FastCopy.h>
#include <wtf/VMTags.h>
namespace WTF {
@@ -91,7 +90,7 @@
inline T* OSAllocator::reallocateCommitted(T* oldBase, size_t oldSize, size_t newSize, Usage usage, bool writable, bool executable)
{
void* newBase = reserveAndCommit(newSize, usage, writable, executable);
- fastCopyBytes(newBase, oldBase, std::min(oldSize, newSize));
+ memcpy(newBase, oldBase, std::min(oldSize, newSize));
decommitAndRelease(oldBase, oldSize);
return static_cast<T*>(newBase);
}
Modified: trunk/Source/WTF/wtf/StringPrintStream.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/StringPrintStream.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/StringPrintStream.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -28,7 +28,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <wtf/FastCopy.h>
#include <wtf/FastMalloc.h>
namespace WTF {
@@ -120,7 +119,7 @@
// fastRealloc will just do malloc+free anyway. Also, this simplifies the code since
// we can't realloc the inline buffer.
char* newBuffer = static_cast<char*>(fastMalloc(m_size));
- fastCopy(newBuffer, m_buffer, m_next + 1);
+ memcpy(newBuffer, m_buffer, m_next + 1);
if (m_buffer != m_inlineBuffer)
fastFree(m_buffer);
m_buffer = newBuffer;
Modified: trunk/Source/WTF/wtf/Vector.h (228575 => 228576)
--- trunk/Source/WTF/wtf/Vector.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/Vector.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -27,9 +27,7 @@
#include <type_traits>
#include <utility>
#include <wtf/CheckedArithmetic.h>
-#include <wtf/FastCopy.h>
#include <wtf/FastMalloc.h>
-#include <wtf/FastZeroFill.h>
#include <wtf/Forward.h>
#include <wtf/MallocPtr.h>
#include <wtf/MathExtras.h>
@@ -88,7 +86,7 @@
{
static void initialize(T* begin, T* end)
{
- fastZeroFill(begin, end - begin);
+ memset(begin, 0, reinterpret_cast<char*>(end) - reinterpret_cast<char*>(begin));
}
};
@@ -128,7 +126,7 @@
{
static void move(const T* src, const T* srcEnd, T* dst)
{
- fastCopy(dst, src, srcEnd - src);
+ memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
}
static void moveOverlapping(const T* src, const T* srcEnd, T* dst)
{
Modified: trunk/Source/WTF/wtf/persistence/PersistentDecoder.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/persistence/PersistentDecoder.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/persistence/PersistentDecoder.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -52,7 +52,7 @@
if (!bufferIsLargeEnoughToContain(size))
return false;
- fastCopy(data, m_bufferPosition, size);
+ memcpy(data, m_bufferPosition, size);
m_bufferPosition += size;
Encoder::updateChecksumForData(m_sha1, data, size);
Modified: trunk/Source/WTF/wtf/persistence/PersistentEncoder.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/persistence/PersistentEncoder.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/persistence/PersistentEncoder.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -58,7 +58,7 @@
updateChecksumForData(m_sha1, data, size);
uint8_t* buffer = grow(size);
- fastCopy(buffer, data, size);
+ memcpy(buffer, data, size);
}
template<typename Type>
Modified: trunk/Source/WTF/wtf/text/CString.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/text/CString.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/CString.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,7 +28,6 @@
#include "CString.h"
#include <string.h>
-#include <wtf/FastCopy.h>
#include <wtf/text/StringHasher.h>
#include <wtf/text/StringMalloc.h>
@@ -67,7 +66,7 @@
ASSERT(str);
m_buffer = CStringBuffer::createUninitialized(length);
- fastCopy(m_buffer->mutableData(), str, length);
+ memcpy(m_buffer->mutableData(), str, length);
m_buffer->mutableData()[length] = '\0';
}
@@ -97,7 +96,7 @@
RefPtr<CStringBuffer> buffer = WTFMove(m_buffer);
size_t length = buffer->length();
m_buffer = CStringBuffer::createUninitialized(length);
- fastCopy(m_buffer->mutableData(), buffer->data(), length + 1);
+ memcpy(m_buffer->mutableData(), buffer->data(), length + 1);
}
bool CString::isSafeToSendToAnotherThread() const
Modified: trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h (228575 => 228576)
--- trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2018 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,8 +26,6 @@
#pragma once
#include <unicode/uloc.h>
-#include <wtf/FastCopy.h>
-#include <wtf/FastZeroFill.h>
#include <wtf/HashMap.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/ThreadSpecific.h>
@@ -53,7 +51,7 @@
if (!utf8Locale.length())
return locale;
Vector<char> scratchBuffer(utf8Locale.length() + 11, 0);
- fastCopy(scratchBuffer.data(), utf8Locale.data(), utf8Locale.length());
+ memcpy(scratchBuffer.data(), utf8Locale.data(), utf8Locale.length());
const char* keywordValue = nullptr;
switch (mode) {
@@ -77,7 +75,7 @@
return AtomicString::fromUTF8(scratchBuffer.data(), lengthNeeded);
if (status == U_BUFFER_OVERFLOW_ERROR) {
scratchBuffer.grow(lengthNeeded + 1);
- fastZeroFill(scratchBuffer.data() + utf8Locale.length(), scratchBuffer.size() - utf8Locale.length());
+ memset(scratchBuffer.data() + utf8Locale.length(), 0, scratchBuffer.size() - utf8Locale.length());
status = U_ZERO_ERROR;
int32_t lengthNeeded2 = uloc_setKeywordValue("lb", keywordValue, scratchBuffer.data(), scratchBuffer.size(), &status);
if (!U_SUCCESS(status) || lengthNeeded != lengthNeeded2)
Modified: trunk/Source/WTF/wtf/text/StringBuilder.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/text/StringBuilder.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/StringBuilder.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -99,7 +99,7 @@
ASSERT(m_is8Bit);
// Copy the existing data into a new buffer, set result to point to the end of the existing data.
auto buffer = StringImpl::createUninitialized(requiredLength, m_bufferCharacters8);
- fastCopy(m_bufferCharacters8, currentCharacters, m_length);
+ memcpy(m_bufferCharacters8, currentCharacters, static_cast<size_t>(m_length) * sizeof(LChar)); // This can't overflow.
// Update the builder state.
m_buffer = WTFMove(buffer);
@@ -114,7 +114,7 @@
ASSERT(!m_is8Bit);
// Copy the existing data into a new buffer, set result to point to the end of the existing data.
auto buffer = StringImpl::createUninitialized(requiredLength, m_bufferCharacters16);
- fastCopy(m_bufferCharacters16, currentCharacters, m_length);
+ memcpy(m_bufferCharacters16, currentCharacters, static_cast<size_t>(m_length) * sizeof(UChar)); // This can't overflow.
// Update the builder state.
m_buffer = WTFMove(buffer);
@@ -276,10 +276,10 @@
allocateBufferUpConvert(m_string.isNull() ? 0 : m_string.characters8(), expandedCapacity(capacity(), requiredLength));
}
- fastCopy(m_bufferCharacters16 + m_length, characters, length);
+ memcpy(m_bufferCharacters16 + m_length, characters, static_cast<size_t>(length) * sizeof(UChar));
m_length = requiredLength;
} else
- fastCopy(appendUninitialized<UChar>(length), characters, length);
+ memcpy(appendUninitialized<UChar>(length), characters, static_cast<size_t>(length) * sizeof(UChar));
ASSERT(m_buffer->length() >= m_length);
}
@@ -291,7 +291,13 @@
if (m_is8Bit) {
LChar* dest = appendUninitialized<LChar>(length);
- fastCopy(dest, characters, length);
+ if (length > 8)
+ memcpy(dest, characters, static_cast<size_t>(length) * sizeof(LChar));
+ else {
+ const LChar* end = characters + length;
+ while (characters < end)
+ *(dest++) = *(characters++);
+ }
} else {
UChar* dest = appendUninitialized<UChar>(length);
const LChar* end = characters + length;
Modified: trunk/Source/WTF/wtf/text/StringConcatenate.h (228575 => 228576)
--- trunk/Source/WTF/wtf/text/StringConcatenate.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/StringConcatenate.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -27,7 +27,6 @@
#define StringConcatenate_h
#include <string.h>
-#include <wtf/FastCopy.h>
#ifndef AtomicString_h
#include <wtf/text/AtomicString.h>
@@ -158,7 +157,7 @@
void writeTo(UChar* destination) const
{
- fastCopy(destination, m_characters, m_length);
+ memcpy(destination, m_characters, m_length * sizeof(UChar));
}
String toString() const { return String(m_characters, m_length); }
Modified: trunk/Source/WTF/wtf/text/StringImpl.h (228575 => 228576)
--- trunk/Source/WTF/wtf/text/StringImpl.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/StringImpl.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1066,7 +1066,7 @@
*destination = *source;
return;
}
- fastCopy(destination, source, numCharacters);
+ memcpy(destination, source, numCharacters * sizeof(CharacterType));
}
ALWAYS_INLINE void StringImpl::copyCharacters(UChar* destination, const LChar* source, unsigned numCharacters)
Modified: trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -28,7 +28,6 @@
#include <algorithm>
#include <string.h>
-#include <wtf/FastCopy.h>
namespace WTF {
@@ -56,10 +55,10 @@
void* extraNew = destination->pExtra;
int32_t flags = destination->flags;
int sizeToCopy = std::min(source->sizeOfStruct, destination->sizeOfStruct);
- fastCopyBytes(destination, source, sizeToCopy);
+ memcpy(destination, source, sizeToCopy);
destination->pExtra = extraNew;
destination->flags = flags;
- fastCopyBytes(destination->pExtra, source->pExtra, extraSize);
+ memcpy(destination->pExtra, source->pExtra, extraSize);
fixPointer(source, destination, destination->context);
fixPointer(source, destination, destination->p);
fixPointer(source, destination, destination->q);
Modified: trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -27,7 +27,6 @@
#include "UTextProviderLatin1.h"
#include "UTextProvider.h"
-#include <wtf/FastZeroFill.h>
#include <wtf/text/StringImpl.h>
namespace WTF {
@@ -83,7 +82,7 @@
result->a = source->a;
result->pFuncs = &uTextLatin1Funcs;
result->chunkContents = (UChar*)result->pExtra;
- fastZeroFill(const_cast<UChar*>(result->chunkContents), UTextWithBufferInlineCapacity);
+ memset(const_cast<UChar*>(result->chunkContents), 0, sizeof(UChar) * UTextWithBufferInlineCapacity);
return result;
}
@@ -229,7 +228,7 @@
text->a = length;
text->pFuncs = &uTextLatin1Funcs;
text->chunkContents = (UChar*)text->pExtra;
- fastZeroFill(const_cast<UChar*>(text->chunkContents), UTextWithBufferInlineCapacity);
+ memset(const_cast<UChar*>(text->chunkContents), 0, sizeof(UChar) * UTextWithBufferInlineCapacity);
return text;
}
Modified: trunk/Source/WTF/wtf/threads/Signals.cpp (228575 => 228576)
--- trunk/Source/WTF/wtf/threads/Signals.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/WTF/wtf/threads/Signals.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -172,7 +172,7 @@
Signal signal = fromMachException(exceptionType);
RELEASE_ASSERT(signal != Signal::Unknown);
- fastCopy(outState, inState, inStateCount);
+ memcpy(outState, inState, inStateCount * sizeof(inState[0]));
*outStateCount = inStateCount;
#if CPU(X86_64)
Modified: trunk/Source/bmalloc/ChangeLog (228575 => 228576)
--- trunk/Source/bmalloc/ChangeLog 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/ChangeLog 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,3 +1,22 @@
+2018-02-16 Filip Pizlo <fpi...@apple.com>
+
+ Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a
+ progression.
+
+ * bmalloc/Algorithm.h:
+ (bmalloc::fastCopy): Deleted.
+ (bmalloc::fastZeroFill): Deleted.
+ * bmalloc/Allocator.cpp:
+ (bmalloc::Allocator::reallocate):
+ * bmalloc/Bits.h:
+ (bmalloc::BitsWordOwner::operator=):
+ (bmalloc::BitsWordOwner::clearAll):
+ (bmalloc::BitsWordOwner::set):
+ * bmalloc/IsoPageInlines.h:
+ (bmalloc::IsoPage<Config>::IsoPage):
+ * bmalloc/Vector.h:
+ (bmalloc::Vector<T>::reallocateBuffer):
+
2018-02-09 Carlos Alberto Lopez Perez <clo...@igalia.com>
Improve of string.h include after r228317.
Modified: trunk/Source/bmalloc/bmalloc/Algorithm.h (228575 => 228576)
--- trunk/Source/bmalloc/bmalloc/Algorithm.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/bmalloc/Algorithm.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -181,221 +181,6 @@
return false;
}
-template<typename T>
-void fastCopy(T* dst, T* src, size_t length)
-{
-#if BCPU(X86_64)
- uint64_t tmp = 0;
- size_t count = length * sizeof(T);
- if (!(sizeof(T) % sizeof(uint64_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $3, %%rcx\n\t"
- "rep movsq\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint32_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $2, %%rcx\n\t"
- "rep movsl\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $4, %%rcx\n\t" // FIXME: This isn't really a loop. https://bugs.webkit.org/show_bug.cgi?id=182617
- "4:\n\t"
- "movl (%%rsi, %%rcx), %%eax\n\t"
- "movl %%eax, (%%rdi, %%rcx)\n\t"
- "subq $4, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint16_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $1, %%rcx\n\t"
- "rep movsw\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $6, %%rcx\n\t"
- "4:\n\t"
- "movw (%%rsi, %%rcx), %%ax\n\t"
- "movw %%ax, (%%rdi, %%rcx)\n\t"
- "subq $2, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
- return;
- }
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "rep movsb\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq (%%rsi, %%rcx), %%rax\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $7, %%rcx\n\t"
- "4:\n\t"
- "movb (%%rsi, %%rcx), %%al\n\t"
- "movb %%al, (%%rdi, %%rcx)\n\t"
- "subq $1, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+S"(src), "+c"(count), "+a"(tmp)
- :
- : "memory"
- );
-#else
- memcpy(dst, src, length * sizeof(T));
-#endif
-}
-
-template<typename T>
-void fastZeroFill(T* dst, size_t length)
-{
-#if BCPU(X86_64)
- uint64_t zero = 0;
- size_t count = length * sizeof(T);
- if (!(sizeof(T) % sizeof(uint64_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $3, %%rcx\n\t"
- "rep stosq\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint32_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $2, %%rcx\n\t"
- "rep stosl\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $4, %%rcx\n\t" // FIXME: This isn't really a loop. https://bugs.webkit.org/show_bug.cgi?id=182617
- "4:\n\t"
- "movl %%eax, (%%rdi, %%rcx)\n\t"
- "subq $4, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- if (!(sizeof(T) % sizeof(uint16_t))) {
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "shrq $1, %%rcx\n\t"
- "rep stosw\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $6, %%rcx\n\t"
- "4:\n\t"
- "movw %%ax, (%%rdi, %%rcx)\n\t"
- "subq $2, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
- return;
- }
- asm volatile (
- "cmpq $200, %%rcx\n\t"
- "jb 1f\n\t"
- "rep stosb\n\t"
- "jmp 2f\n\t"
- "3:\n\t"
- "movq %%rax, (%%rdi, %%rcx)\n\t"
- "1:\n\t"
- "subq $8, %%rcx\n\t"
- "jae 3b\n\t"
- "cmpq $-8, %%rcx\n\t"
- "je 2f\n\t"
- "addq $7, %%rcx\n\t"
- "4:\n\t"
- "movb %%al, (%%rdi, %%rcx)\n\t"
- "sub $1, %%rcx\n\t"
- "jae 4b\n\t"
- "2:\n\t"
- : "+D"(dst), "+c"(count)
- : "a"(zero)
- : "memory"
- );
-#else
- memset(dst, 0, length * sizeof(T));
-#endif
-}
-
} // namespace bmalloc
#endif // Algorithm_h
Modified: trunk/Source/bmalloc/bmalloc/Allocator.cpp (228575 => 228576)
--- trunk/Source/bmalloc/bmalloc/Allocator.cpp 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/bmalloc/Allocator.cpp 2018-02-16 21:38:53 UTC (rev 228576)
@@ -125,7 +125,7 @@
void* result = allocate(newSize);
size_t copySize = std::min(oldSize, newSize);
- fastCopy(static_cast<char*>(result), static_cast<char*>(object), copySize);
+ memcpy(result, object, copySize);
m_deallocator.deallocate(object);
return result;
}
Modified: trunk/Source/bmalloc/bmalloc/Bits.h (228575 => 228576)
--- trunk/Source/bmalloc/bmalloc/Bits.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/bmalloc/Bits.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -80,7 +80,7 @@
BitsWordOwner& operator=(const BitsWordOwner& other)
{
- fastCopy(m_words, other.m_words, arrayLength());
+ memcpy(m_words, other.m_words, arrayLength() * sizeof(uint32_t));
return *this;
}
@@ -91,12 +91,12 @@
void clearAll()
{
- fastZeroFill(m_words, arrayLength());
+ memset(m_words, 0, arrayLength() * sizeof(uint32_t));
}
void set(const BitsWordOwner& other)
{
- fastCopy(m_words, other.m_words, arrayLength());
+ memcpy(m_words, other.m_words, arrayLength() * sizeof(uint32_t));
}
size_t numBits() const
Modified: trunk/Source/bmalloc/bmalloc/IsoPageInlines.h (228575 => 228576)
--- trunk/Source/bmalloc/bmalloc/IsoPageInlines.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/bmalloc/IsoPageInlines.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,7 +47,7 @@
: m_directory(directory)
, m_index(index)
{
- fastZeroFill(m_allocBits, bitsArrayLength(numObjects));
+ memset(m_allocBits, 0, sizeof(m_allocBits));
}
template<typename Config>
Modified: trunk/Source/bmalloc/bmalloc/Vector.h (228575 => 228576)
--- trunk/Source/bmalloc/bmalloc/Vector.h 2018-02-16 21:31:42 UTC (rev 228575)
+++ trunk/Source/bmalloc/bmalloc/Vector.h 2018-02-16 21:38:53 UTC (rev 228576)
@@ -203,7 +203,7 @@
size_t vmSize = bmalloc::vmSize(newCapacity * sizeof(T));
T* newBuffer = vmSize ? static_cast<T*>(vmAllocate(vmSize)) : nullptr;
if (m_buffer) {
- fastCopy(newBuffer, m_buffer, m_size);
+ std::memcpy(newBuffer, m_buffer, m_size * sizeof(T));
vmDeallocate(m_buffer, bmalloc::vmSize(m_capacity * sizeof(T)));
}