haikuwebkit/Source/WTF/wtf/OSAllocator.h

100 lines
5.0 KiB
C
Raw Permalink Normal View History

Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
/*
Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a progression. Source/bmalloc: * 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): Source/JavaScriptCore: * 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): Source/WTF: * 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: Canonical link: https://commits.webkit.org/198639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 21:38:53 +00:00
* Copyright (C) 2010 Apple Inc. All rights reserved.
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
*
* 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. AND ITS CONTRIBUTORS ``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 ITS 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.
*/
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#pragma once
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
Implement a JIT-code aware sampling profiler for JSC https://bugs.webkit.org/show_bug.cgi?id=76855 Reviewed by Oliver Hunt. To enable the profiler, set the JSC_CODE_PROFILING environment variable to 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively trace all samples). The profiler requires -fomit-frame-pointer to be removed from the build flags. * JavaScriptCore.exp: - Removed an export. * JavaScriptCore.xcodeproj/project.pbxproj: - Added new files * bytecode/CodeBlock.cpp: - For baseline codeblocks, cache the result of canCompileWithDFG. * bytecode/CodeBlock.h: - For baseline codeblocks, cache the result of canCompileWithDFG. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/JITStubs.cpp: - If profiling, don't mask the return address in JIT code. (We do so to provide nicer backtraces in debug builds). * runtime/Completion.cpp: (JSC::evaluate): - Notify the profiler of script evaluations. * tools: Added. * tools/CodeProfile.cpp: Added. (JSC::symbolName): - Helper function to get the name of a symbol in the framework. (JSC::truncateTrace): - Helper to truncate traces into methods know to have uninformatively deep stacks. (JSC::CodeProfile::sample): - Record a stack trace classifying samples. (JSC::CodeProfile::report): - {Print profiler output. * tools/CodeProfile.h: Added. - new class, captures a set of samples associated with an evaluated script, and nested to record samples from subscripts. * tools/CodeProfiling.cpp: Added. (JSC::CodeProfiling::profilingTimer): - callback fired then a timer event occurs. (JSC::CodeProfiling::notifyAllocator): - called when the executable allocator is constructed. (JSC::CodeProfiling::getOwnerUIDForPC): - helper to lookup the codeblock from an address in JIT code (JSC::CodeProfiling::begin): - enter a profiling scope. (JSC::CodeProfiling::end): - exit a profiling scope. * tools/CodeProfiling.h: Added. - new class, instantialed from Completion to define a profiling scope. * tools/ProfileTreeNode.h: Added. - new class, used to construct a tree of samples. * tools/TieredMMapArray.h: Added. - new class, a malloc-free vector (can be used while the main thread is suspended, possibly holding the malloc heap lock). * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocator::allocate): - Allow allocation handles to track information about their owner. * wtf/MetaAllocator.h: (MetaAllocator): - Allow allocation handles to track information about their owner. * wtf/MetaAllocatorHandle.h: (MetaAllocatorHandle): (WTF::MetaAllocatorHandle::ownerUID): - Allow allocation handles to track information about their owner. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): - reallocate an existing, committed memory allocation. Canonical link: https://commits.webkit.org/94168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
#include <algorithm>
#include <wtf/VMTags.h>
Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator https://bugs.webkit.org/show_bug.cgi?id=50653 Reviewed by Sam Weinig. * JavaScriptCore.exp: Updated for new function signature. * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): (JSC::RegisterFile::grow): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::reuse): (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay. OSAllocator is now the central location for verifying that allocation succeeds. This allowed me to remove some complicating cross-platform cruft. * runtime/AlignedMemoryAllocator.h: (JSC::::allocate): Updated for code motion. * wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to support VM features required by clients of PageAllocation and PageReservation. * wtf/OSAllocatorPosix.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Moved PageAllocation support for randomizing executable memory here. * wtf/OSAllocatorSymbian.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Updated for new function signatures. * wtf/OSAllocatorWin.cpp: (WTF::protection): (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::release): Updated for new function signatures. Moved some protection-related and WINCE-related code from PageAllocation here. * wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since it was only used by checkAllocatedOkay, which is now gone. * wtf/PageAllocation.h: (WTF::PageAllocation::allocate): (WTF::PageAllocation::allocateAligned): (WTF::PageAllocation::deallocate): (WTF::PageAllocation::isPowerOfTwo): (WTF::PageAllocation::systemAllocateAligned): Removed system* functions, and replaced calls to them with calls to OSAllocator. * wtf/PageReservation.h: (WTF::PageReservation::commit): (WTF::PageReservation::decommit): (WTF::PageReservation::reserve): (WTF::PageReservation::deallocate): (WTF::PageReservation::PageReservation): Ditto. Added m_writable and m_executable because these flags are now required when committing memory. Canonical link: https://commits.webkit.org/63979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-09 01:30:18 +00:00
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
namespace WTF {
class OSAllocator {
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced https://bugs.webkit.org/show_bug.cgi?id=200611 Reviewed by Saam Barati. Source/JavaScriptCore: This patch aggressively puts many classes into FastMalloc. In JSC side, we grep `std::make_unique` etc. to find potentially system-malloc-allocated classes. After this patch, all the JSC related allocations in JetStream2 cli is done from bmalloc. In the future, it would be nice that we add `WTF::makeUnique<T>` helper function and throw a compile error if `T` is not FastMalloc annotated[1]. Putting WebKit classes in FastMalloc has many benefits. 1. Simply, it is fast. 2. vmmap can tell the amount of memory used for WebKit. 3. bmalloc can isolate WebKit memory allocation from the rest of the world. This is useful since we can know more about what component is corrupting the memory from the memory corruption crash. [1]: https://bugs.webkit.org/show_bug.cgi?id=200620 * API/ObjCCallbackFunction.mm: * assembler/AbstractMacroAssembler.h: * b3/B3PhiChildren.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirDisassembler.h: * bytecode/AccessCaseSnippetParams.h: * bytecode/CallVariant.h: * bytecode/DeferredSourceDump.h: * bytecode/ExecutionCounter.h: * bytecode/GetByIdStatus.h: * bytecode/GetByIdVariant.h: * bytecode/InByIdStatus.h: * bytecode/InByIdVariant.h: * bytecode/InstanceOfStatus.h: * bytecode/InstanceOfVariant.h: * bytecode/PutByIdStatus.h: * bytecode/PutByIdVariant.h: * bytecode/ValueProfile.h: * dfg/DFGAbstractInterpreter.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::newVariableAccessData): * dfg/DFGFlowIndexing.h: * dfg/DFGFlowMap.h: * dfg/DFGLiveCatchVariablePreservationPhase.cpp: (JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData): * dfg/DFGMaximalFlushInsertionPhase.cpp: (JSC::DFG::MaximalFlushInsertionPhase::newVariableAccessData): * dfg/DFGOSRExit.h: * dfg/DFGSpeculativeJIT.h: * dfg/DFGVariableAccessData.h: * disassembler/ARM64/A64DOpcode.h: * inspector/remote/socket/RemoteInspectorMessageParser.h: * inspector/remote/socket/RemoteInspectorSocket.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/PCToCodeOriginMap.h: * runtime/BasicBlockLocation.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/JSRunLoopTimer.h: * runtime/PromiseDeferredTimer.h: (JSC::PromiseDeferredTimer::create): PromiseDeferredTimer should be allocated as `Ref<>` instead of `std::unique_ptr` since it is inheriting ThreadSafeRefCounted<>. Holding such a class with std::unique_ptr could lead to potentially dangerous operations (like, someone holds it with Ref<> while it is deleted by std::unique_ptr<>). * runtime/RandomizingFuzzerAgent.h: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * tools/JSDollarVM.cpp: * tools/SigillCrashAnalyzer.cpp: * wasm/WasmFormat.h: * wasm/WasmMemory.cpp: * wasm/WasmSignature.h: * yarr/YarrJIT.h: Source/WebCore: Changed the accessor since we changed std::unique_ptr to Ref for this field. No behavior change. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): Source/WTF: WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`. Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited. * wtf/Assertions.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/Bag.h: (WTF::Bag::Bag): Deleted. (WTF::Bag::~Bag): Deleted. (WTF::Bag::clear): Deleted. (WTF::Bag::add): Deleted. (WTF::Bag::iterator::iterator): Deleted. (WTF::Bag::iterator::operator! const): Deleted. (WTF::Bag::iterator::operator* const): Deleted. (WTF::Bag::iterator::operator++): Deleted. (WTF::Bag::iterator::operator== const): Deleted. (WTF::Bag::iterator::operator!= const): Deleted. (WTF::Bag::begin): Deleted. (WTF::Bag::begin const): Deleted. (WTF::Bag::end const): Deleted. (WTF::Bag::isEmpty const): Deleted. (WTF::Bag::unwrappedHead const): Deleted. * wtf/BitVector.h: (WTF::BitVector::BitVector): Deleted. (WTF::BitVector::~BitVector): Deleted. (WTF::BitVector::operator=): Deleted. (WTF::BitVector::size const): Deleted. (WTF::BitVector::ensureSize): Deleted. (WTF::BitVector::quickGet const): Deleted. (WTF::BitVector::quickSet): Deleted. (WTF::BitVector::quickClear): Deleted. (WTF::BitVector::get const): Deleted. (WTF::BitVector::contains const): Deleted. (WTF::BitVector::set): Deleted. (WTF::BitVector::add): Deleted. (WTF::BitVector::ensureSizeAndSet): Deleted. (WTF::BitVector::clear): Deleted. (WTF::BitVector::remove): Deleted. (WTF::BitVector::merge): Deleted. (WTF::BitVector::filter): Deleted. (WTF::BitVector::exclude): Deleted. (WTF::BitVector::bitCount const): Deleted. (WTF::BitVector::isEmpty const): Deleted. (WTF::BitVector::findBit const): Deleted. (WTF::BitVector::isEmptyValue const): Deleted. (WTF::BitVector::isDeletedValue const): Deleted. (WTF::BitVector::isEmptyOrDeletedValue const): Deleted. (WTF::BitVector::operator== const): Deleted. (WTF::BitVector::hash const): Deleted. (WTF::BitVector::iterator::iterator): Deleted. (WTF::BitVector::iterator::operator* const): Deleted. (WTF::BitVector::iterator::operator++): Deleted. (WTF::BitVector::iterator::isAtEnd const): Deleted. (WTF::BitVector::iterator::operator== const): Deleted. (WTF::BitVector::iterator::operator!= const): Deleted. (WTF::BitVector::begin const): Deleted. (WTF::BitVector::end const): Deleted. (WTF::BitVector::bitsInPointer): Deleted. (WTF::BitVector::maxInlineBits): Deleted. (WTF::BitVector::byteCount): Deleted. (WTF::BitVector::makeInlineBits): Deleted. (WTF::BitVector::cleanseInlineBits): Deleted. (WTF::BitVector::bitCount): Deleted. (WTF::BitVector::findBitFast const): Deleted. (WTF::BitVector::findBitSimple const): Deleted. (WTF::BitVector::OutOfLineBits::numBits const): Deleted. (WTF::BitVector::OutOfLineBits::numWords const): Deleted. (WTF::BitVector::OutOfLineBits::bits): Deleted. (WTF::BitVector::OutOfLineBits::bits const): Deleted. (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted. (WTF::BitVector::isInline const): Deleted. (WTF::BitVector::outOfLineBits const): Deleted. (WTF::BitVector::outOfLineBits): Deleted. (WTF::BitVector::bits): Deleted. (WTF::BitVector::bits const): Deleted. * wtf/Bitmap.h: (WTF::Bitmap::size): Deleted. (WTF::Bitmap::iterator::iterator): Deleted. (WTF::Bitmap::iterator::operator* const): Deleted. (WTF::Bitmap::iterator::operator++): Deleted. (WTF::Bitmap::iterator::operator== const): Deleted. (WTF::Bitmap::iterator::operator!= const): Deleted. (WTF::Bitmap::begin const): Deleted. (WTF::Bitmap::end const): Deleted. * wtf/Box.h: * wtf/BumpPointerAllocator.h: * wtf/CPUTime.h: * wtf/CheckedBoolean.h: * wtf/CommaPrinter.h: (WTF::CommaPrinter::CommaPrinter): Deleted. (WTF::CommaPrinter::dump const): Deleted. (WTF::CommaPrinter::didPrint const): Deleted. * wtf/CompactPointerTuple.h: (WTF::CompactPointerTuple::encodeType): Deleted. (WTF::CompactPointerTuple::decodeType): Deleted. (WTF::CompactPointerTuple::CompactPointerTuple): Deleted. (WTF::CompactPointerTuple::pointer const): Deleted. (WTF::CompactPointerTuple::setPointer): Deleted. (WTF::CompactPointerTuple::type const): Deleted. (WTF::CompactPointerTuple::setType): Deleted. * wtf/CompilationThread.h: (WTF::CompilationScope::CompilationScope): Deleted. (WTF::CompilationScope::~CompilationScope): Deleted. (WTF::CompilationScope::leaveEarly): Deleted. * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): (WTF::Detail::CallableWrapper<CompletionHandler<Out): (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted. * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::growExact): Deleted. (WTF::ConcurrentBuffer::grow): Deleted. (WTF::ConcurrentBuffer::array const): Deleted. (WTF::ConcurrentBuffer::operator[]): Deleted. (WTF::ConcurrentBuffer::operator[] const): Deleted. (WTF::ConcurrentBuffer::createArray): Deleted. * wtf/ConcurrentPtrHashSet.h: (WTF::ConcurrentPtrHashSet::contains): Deleted. (WTF::ConcurrentPtrHashSet::add): Deleted. (WTF::ConcurrentPtrHashSet::size const): Deleted. (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted. (WTF::ConcurrentPtrHashSet::hash): Deleted. (WTF::ConcurrentPtrHashSet::cast): Deleted. (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted. (WTF::ConcurrentPtrHashSet::addImpl): Deleted. * wtf/ConcurrentVector.h: (WTF::ConcurrentVector::~ConcurrentVector): Deleted. (WTF::ConcurrentVector::size const): Deleted. (WTF::ConcurrentVector::isEmpty const): Deleted. (WTF::ConcurrentVector::at): Deleted. (WTF::ConcurrentVector::at const): Deleted. (WTF::ConcurrentVector::operator[]): Deleted. (WTF::ConcurrentVector::operator[] const): Deleted. (WTF::ConcurrentVector::first): Deleted. (WTF::ConcurrentVector::first const): Deleted. (WTF::ConcurrentVector::last): Deleted. (WTF::ConcurrentVector::last const): Deleted. (WTF::ConcurrentVector::takeLast): Deleted. (WTF::ConcurrentVector::append): Deleted. (WTF::ConcurrentVector::alloc): Deleted. (WTF::ConcurrentVector::removeLast): Deleted. (WTF::ConcurrentVector::grow): Deleted. (WTF::ConcurrentVector::begin): Deleted. (WTF::ConcurrentVector::end): Deleted. (WTF::ConcurrentVector::segmentExistsFor): Deleted. (WTF::ConcurrentVector::segmentFor): Deleted. (WTF::ConcurrentVector::subscriptFor): Deleted. (WTF::ConcurrentVector::ensureSegmentsFor): Deleted. (WTF::ConcurrentVector::ensureSegment): Deleted. (WTF::ConcurrentVector::allocateSegment): Deleted. * wtf/Condition.h: (WTF::Condition::waitUntil): Deleted. (WTF::Condition::waitFor): Deleted. (WTF::Condition::wait): Deleted. (WTF::Condition::notifyOne): Deleted. (WTF::Condition::notifyAll): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::LockHooks::lockHook): Deleted. (WTF::CountingLock::LockHooks::unlockHook): Deleted. (WTF::CountingLock::LockHooks::parkHook): Deleted. (WTF::CountingLock::LockHooks::handoffHook): Deleted. (WTF::CountingLock::tryLock): Deleted. (WTF::CountingLock::lock): Deleted. (WTF::CountingLock::unlock): Deleted. (WTF::CountingLock::isHeld const): Deleted. (WTF::CountingLock::isLocked const): Deleted. (WTF::CountingLock::Count::operator bool const): Deleted. (WTF::CountingLock::Count::operator== const): Deleted. (WTF::CountingLock::Count::operator!= const): Deleted. (WTF::CountingLock::tryOptimisticRead): Deleted. (WTF::CountingLock::validate): Deleted. (WTF::CountingLock::doOptimizedRead): Deleted. (WTF::CountingLock::tryOptimisticFencelessRead): Deleted. (WTF::CountingLock::fencelessValidate): Deleted. (WTF::CountingLock::doOptimizedFencelessRead): Deleted. (WTF::CountingLock::getCount): Deleted. * wtf/CrossThreadQueue.h: * wtf/CrossThreadTask.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/DataMutex.h: * wtf/DateMath.h: * wtf/Deque.h: (WTF::Deque::size const): Deleted. (WTF::Deque::isEmpty const): Deleted. (WTF::Deque::begin): Deleted. (WTF::Deque::end): Deleted. (WTF::Deque::begin const): Deleted. (WTF::Deque::end const): Deleted. (WTF::Deque::rbegin): Deleted. (WTF::Deque::rend): Deleted. (WTF::Deque::rbegin const): Deleted. (WTF::Deque::rend const): Deleted. (WTF::Deque::first): Deleted. (WTF::Deque::first const): Deleted. (WTF::Deque::last): Deleted. (WTF::Deque::last const): Deleted. (WTF::Deque::append): Deleted. * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/Expected.h: * wtf/FastBitVector.h: * wtf/FileMetadata.h: * wtf/FileSystem.h: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.h: (WTF::GregorianDateTime::GregorianDateTime): Deleted. (WTF::GregorianDateTime::year const): Deleted. (WTF::GregorianDateTime::month const): Deleted. (WTF::GregorianDateTime::yearDay const): Deleted. (WTF::GregorianDateTime::monthDay const): Deleted. (WTF::GregorianDateTime::weekDay const): Deleted. (WTF::GregorianDateTime::hour const): Deleted. (WTF::GregorianDateTime::minute const): Deleted. (WTF::GregorianDateTime::second const): Deleted. (WTF::GregorianDateTime::utcOffset const): Deleted. (WTF::GregorianDateTime::isDST const): Deleted. (WTF::GregorianDateTime::setYear): Deleted. (WTF::GregorianDateTime::setMonth): Deleted. (WTF::GregorianDateTime::setYearDay): Deleted. (WTF::GregorianDateTime::setMonthDay): Deleted. (WTF::GregorianDateTime::setWeekDay): Deleted. (WTF::GregorianDateTime::setHour): Deleted. (WTF::GregorianDateTime::setMinute): Deleted. (WTF::GregorianDateTime::setSecond): Deleted. (WTF::GregorianDateTime::setUtcOffset): Deleted. (WTF::GregorianDateTime::setIsDST): Deleted. (WTF::GregorianDateTime::operator tm const): Deleted. (WTF::GregorianDateTime::copyFrom): Deleted. * wtf/HashTable.h: * wtf/Hasher.h: * wtf/HexNumber.h: * wtf/Indenter.h: * wtf/IndexMap.h: * wtf/IndexSet.h: * wtf/IndexSparseSet.h: * wtf/IndexedContainerIterator.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/KeyValuePair.h: * wtf/ListHashSet.h: (WTF::ListHashSet::begin): Deleted. (WTF::ListHashSet::end): Deleted. (WTF::ListHashSet::begin const): Deleted. (WTF::ListHashSet::end const): Deleted. (WTF::ListHashSet::random): Deleted. (WTF::ListHashSet::random const): Deleted. (WTF::ListHashSet::rbegin): Deleted. (WTF::ListHashSet::rend): Deleted. (WTF::ListHashSet::rbegin const): Deleted. (WTF::ListHashSet::rend const): Deleted. * wtf/Liveness.h: * wtf/LocklessBag.h: (WTF::LocklessBag::LocklessBag): Deleted. (WTF::LocklessBag::add): Deleted. (WTF::LocklessBag::iterate): Deleted. (WTF::LocklessBag::consumeAll): Deleted. (WTF::LocklessBag::consumeAllWithNode): Deleted. (WTF::LocklessBag::~LocklessBag): Deleted. * wtf/LoggingHashID.h: * wtf/MD5.h: * wtf/MachSendRight.h: * wtf/MainThreadData.h: * wtf/Markable.h: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.h: * wtf/MessageQueue.h: (WTF::MessageQueue::MessageQueue): Deleted. * wtf/MetaAllocator.h: * wtf/MonotonicTime.h: (WTF::MonotonicTime::MonotonicTime): Deleted. (WTF::MonotonicTime::fromRawSeconds): Deleted. (WTF::MonotonicTime::infinity): Deleted. (WTF::MonotonicTime::nan): Deleted. (WTF::MonotonicTime::secondsSinceEpoch const): Deleted. (WTF::MonotonicTime::approximateMonotonicTime const): Deleted. (WTF::MonotonicTime::operator bool const): Deleted. (WTF::MonotonicTime::operator+ const): Deleted. (WTF::MonotonicTime::operator- const): Deleted. (WTF::MonotonicTime::operator% const): Deleted. (WTF::MonotonicTime::operator+=): Deleted. (WTF::MonotonicTime::operator-=): Deleted. (WTF::MonotonicTime::operator== const): Deleted. (WTF::MonotonicTime::operator!= const): Deleted. (WTF::MonotonicTime::operator< const): Deleted. (WTF::MonotonicTime::operator> const): Deleted. (WTF::MonotonicTime::operator<= const): Deleted. (WTF::MonotonicTime::operator>= const): Deleted. (WTF::MonotonicTime::isolatedCopy const): Deleted. (WTF::MonotonicTime::encode const): Deleted. (WTF::MonotonicTime::decode): Deleted. * wtf/NaturalLoops.h: * wtf/NoLock.h: * wtf/OSAllocator.h: * wtf/OptionSet.h: * wtf/Optional.h: * wtf/OrderMaker.h: * wtf/Packed.h: (WTF::alignof): * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): Deleted. (WTF::PackedIntVector::operator=): Deleted. (WTF::PackedIntVector::size const): Deleted. (WTF::PackedIntVector::ensureSize): Deleted. (WTF::PackedIntVector::resize): Deleted. (WTF::PackedIntVector::clearAll): Deleted. (WTF::PackedIntVector::get const): Deleted. (WTF::PackedIntVector::set): Deleted. (WTF::PackedIntVector::mask): Deleted. * wtf/PageBlock.h: * wtf/ParallelJobsOpenMP.h: * wtf/ParkingLot.h: * wtf/PriorityQueue.h: (WTF::PriorityQueue::size const): Deleted. (WTF::PriorityQueue::isEmpty const): Deleted. (WTF::PriorityQueue::enqueue): Deleted. (WTF::PriorityQueue::peek const): Deleted. (WTF::PriorityQueue::dequeue): Deleted. (WTF::PriorityQueue::decreaseKey): Deleted. (WTF::PriorityQueue::increaseKey): Deleted. (WTF::PriorityQueue::begin const): Deleted. (WTF::PriorityQueue::end const): Deleted. (WTF::PriorityQueue::isValidHeap const): Deleted. (WTF::PriorityQueue::parentOf): Deleted. (WTF::PriorityQueue::leftChildOf): Deleted. (WTF::PriorityQueue::rightChildOf): Deleted. (WTF::PriorityQueue::siftUp): Deleted. (WTF::PriorityQueue::siftDown): Deleted. * wtf/RandomDevice.h: * wtf/Range.h: * wtf/RangeSet.h: (WTF::RangeSet::RangeSet): Deleted. (WTF::RangeSet::~RangeSet): Deleted. (WTF::RangeSet::add): Deleted. (WTF::RangeSet::contains const): Deleted. (WTF::RangeSet::overlaps const): Deleted. (WTF::RangeSet::clear): Deleted. (WTF::RangeSet::dump const): Deleted. (WTF::RangeSet::dumpRaw const): Deleted. (WTF::RangeSet::begin const): Deleted. (WTF::RangeSet::end const): Deleted. (WTF::RangeSet::addAll): Deleted. (WTF::RangeSet::compact): Deleted. (WTF::RangeSet::overlapsNonEmpty): Deleted. (WTF::RangeSet::subsumesNonEmpty): Deleted. (WTF::RangeSet::findRange const): Deleted. * wtf/RecursableLambda.h: * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor const): Deleted. (WTF::RedBlackTree::Node::predecessor const): Deleted. (WTF::RedBlackTree::Node::successor): Deleted. (WTF::RedBlackTree::Node::predecessor): Deleted. (WTF::RedBlackTree::Node::reset): Deleted. (WTF::RedBlackTree::Node::parent const): Deleted. (WTF::RedBlackTree::Node::setParent): Deleted. (WTF::RedBlackTree::Node::left const): Deleted. (WTF::RedBlackTree::Node::setLeft): Deleted. (WTF::RedBlackTree::Node::right const): Deleted. (WTF::RedBlackTree::Node::setRight): Deleted. (WTF::RedBlackTree::Node::color const): Deleted. (WTF::RedBlackTree::Node::setColor): Deleted. (WTF::RedBlackTree::RedBlackTree): Deleted. (WTF::RedBlackTree::insert): Deleted. (WTF::RedBlackTree::remove): Deleted. (WTF::RedBlackTree::findExact const): Deleted. (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted. (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted. (WTF::RedBlackTree::first const): Deleted. (WTF::RedBlackTree::last const): Deleted. (WTF::RedBlackTree::size): Deleted. (WTF::RedBlackTree::isEmpty): Deleted. (WTF::RedBlackTree::treeMinimum): Deleted. (WTF::RedBlackTree::treeMaximum): Deleted. (WTF::RedBlackTree::treeInsert): Deleted. (WTF::RedBlackTree::leftRotate): Deleted. (WTF::RedBlackTree::rightRotate): Deleted. (WTF::RedBlackTree::removeFixup): Deleted. * wtf/ResourceUsage.h: * wtf/RunLoop.cpp: * wtf/RunLoopTimer.h: * wtf/SHA1.h: * wtf/Seconds.h: (WTF::Seconds::Seconds): Deleted. (WTF::Seconds::value const): Deleted. (WTF::Seconds::minutes const): Deleted. (WTF::Seconds::seconds const): Deleted. (WTF::Seconds::milliseconds const): Deleted. (WTF::Seconds::microseconds const): Deleted. (WTF::Seconds::nanoseconds const): Deleted. (WTF::Seconds::minutesAs const): Deleted. (WTF::Seconds::secondsAs const): Deleted. (WTF::Seconds::millisecondsAs const): Deleted. (WTF::Seconds::microsecondsAs const): Deleted. (WTF::Seconds::nanosecondsAs const): Deleted. (WTF::Seconds::fromMinutes): Deleted. (WTF::Seconds::fromHours): Deleted. (WTF::Seconds::fromMilliseconds): Deleted. (WTF::Seconds::fromMicroseconds): Deleted. (WTF::Seconds::fromNanoseconds): Deleted. (WTF::Seconds::infinity): Deleted. (WTF::Seconds::nan): Deleted. (WTF::Seconds::operator bool const): Deleted. (WTF::Seconds::operator+ const): Deleted. (WTF::Seconds::operator- const): Deleted. (WTF::Seconds::operator* const): Deleted. (WTF::Seconds::operator/ const): Deleted. (WTF::Seconds::operator% const): Deleted. (WTF::Seconds::operator+=): Deleted. (WTF::Seconds::operator-=): Deleted. (WTF::Seconds::operator*=): Deleted. (WTF::Seconds::operator/=): Deleted. (WTF::Seconds::operator%=): Deleted. (WTF::Seconds::operator== const): Deleted. (WTF::Seconds::operator!= const): Deleted. (WTF::Seconds::operator< const): Deleted. (WTF::Seconds::operator> const): Deleted. (WTF::Seconds::operator<= const): Deleted. (WTF::Seconds::operator>= const): Deleted. (WTF::Seconds::isolatedCopy const): Deleted. (WTF::Seconds::encode const): Deleted. (WTF::Seconds::decode): Deleted. * wtf/SegmentedVector.h: (WTF::SegmentedVector::~SegmentedVector): Deleted. (WTF::SegmentedVector::size const): Deleted. (WTF::SegmentedVector::isEmpty const): Deleted. (WTF::SegmentedVector::at): Deleted. (WTF::SegmentedVector::at const): Deleted. (WTF::SegmentedVector::operator[]): Deleted. (WTF::SegmentedVector::operator[] const): Deleted. (WTF::SegmentedVector::first): Deleted. (WTF::SegmentedVector::first const): Deleted. (WTF::SegmentedVector::last): Deleted. (WTF::SegmentedVector::last const): Deleted. (WTF::SegmentedVector::takeLast): Deleted. (WTF::SegmentedVector::append): Deleted. (WTF::SegmentedVector::alloc): Deleted. (WTF::SegmentedVector::removeLast): Deleted. (WTF::SegmentedVector::grow): Deleted. (WTF::SegmentedVector::clear): Deleted. (WTF::SegmentedVector::begin): Deleted. (WTF::SegmentedVector::end): Deleted. (WTF::SegmentedVector::shrinkToFit): Deleted. (WTF::SegmentedVector::deleteAllSegments): Deleted. (WTF::SegmentedVector::segmentExistsFor): Deleted. (WTF::SegmentedVector::segmentFor): Deleted. (WTF::SegmentedVector::subscriptFor): Deleted. (WTF::SegmentedVector::ensureSegmentsFor): Deleted. (WTF::SegmentedVector::ensureSegment): Deleted. (WTF::SegmentedVector::allocateSegment): Deleted. * wtf/SetForScope.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SmallPtrSet.h: * wtf/SpanningTree.h: * wtf/Spectrum.h: * wtf/StackBounds.h: * wtf/StackShot.h: * wtf/StackShotProfiler.h: * wtf/StackStats.h: * wtf/StackTrace.h: * wtf/StreamBuffer.h: * wtf/SynchronizedFixedQueue.h: (WTF::SynchronizedFixedQueue::create): Deleted. (WTF::SynchronizedFixedQueue::open): Deleted. (WTF::SynchronizedFixedQueue::close): Deleted. (WTF::SynchronizedFixedQueue::isOpen): Deleted. (WTF::SynchronizedFixedQueue::enqueue): Deleted. (WTF::SynchronizedFixedQueue::dequeue): Deleted. (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted. * wtf/SystemTracing.h: * wtf/ThreadGroup.h: (WTF::ThreadGroup::create): Deleted. (WTF::ThreadGroup::threads const): Deleted. (WTF::ThreadGroup::getLock): Deleted. (WTF::ThreadGroup::weakFromThis): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingPrimitives.h: (WTF::Mutex::impl): Deleted. * wtf/TimeWithDynamicClockType.h: (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted. (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted. (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted. (WTF::TimeWithDynamicClockType::clockType const): Deleted. (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted. (WTF::TimeWithDynamicClockType::operator bool const): Deleted. (WTF::TimeWithDynamicClockType::operator+ const): Deleted. (WTF::TimeWithDynamicClockType::operator- const): Deleted. (WTF::TimeWithDynamicClockType::operator+=): Deleted. (WTF::TimeWithDynamicClockType::operator-=): Deleted. (WTF::TimeWithDynamicClockType::operator== const): Deleted. (WTF::TimeWithDynamicClockType::operator!= const): Deleted. * wtf/TimingScope.h: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/URLParser.cpp: * wtf/URLParser.h: * wtf/Unexpected.h: * wtf/Variant.h: * wtf/WTFSemaphore.h: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::signal): Deleted. (WTF::Semaphore::waitUntil): Deleted. (WTF::Semaphore::waitFor): Deleted. (WTF::Semaphore::wait): Deleted. * wtf/WallTime.h: (WTF::WallTime::WallTime): Deleted. (WTF::WallTime::fromRawSeconds): Deleted. (WTF::WallTime::infinity): Deleted. (WTF::WallTime::nan): Deleted. (WTF::WallTime::secondsSinceEpoch const): Deleted. (WTF::WallTime::approximateWallTime const): Deleted. (WTF::WallTime::operator bool const): Deleted. (WTF::WallTime::operator+ const): Deleted. (WTF::WallTime::operator- const): Deleted. (WTF::WallTime::operator+=): Deleted. (WTF::WallTime::operator-=): Deleted. (WTF::WallTime::operator== const): Deleted. (WTF::WallTime::operator!= const): Deleted. (WTF::WallTime::operator< const): Deleted. (WTF::WallTime::operator> const): Deleted. (WTF::WallTime::operator<= const): Deleted. (WTF::WallTime::operator>= const): Deleted. (WTF::WallTime::isolatedCopy const): Deleted. * wtf/WeakHashSet.h: (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted. (WTF::WeakHashSet::WeakHashSet): Deleted. (WTF::WeakHashSet::begin const): Deleted. (WTF::WeakHashSet::end const): Deleted. (WTF::WeakHashSet::add): Deleted. (WTF::WeakHashSet::remove): Deleted. (WTF::WeakHashSet::contains const): Deleted. (WTF::WeakHashSet::capacity const): Deleted. (WTF::WeakHashSet::computesEmpty const): Deleted. (WTF::WeakHashSet::hasNullReferences const): Deleted. (WTF::WeakHashSet::computeSize const): Deleted. (WTF::WeakHashSet::checkConsistency const): Deleted. * wtf/WeakRandom.h: (WTF::WeakRandom::WeakRandom): Deleted. (WTF::WeakRandom::setSeed): Deleted. (WTF::WeakRandom::seed const): Deleted. (WTF::WeakRandom::get): Deleted. (WTF::WeakRandom::getUint32): Deleted. (WTF::WeakRandom::lowOffset): Deleted. (WTF::WeakRandom::highOffset): Deleted. (WTF::WeakRandom::nextState): Deleted. (WTF::WeakRandom::generate): Deleted. (WTF::WeakRandom::advance): Deleted. * wtf/WordLock.h: (WTF::WordLock::lock): Deleted. (WTF::WordLock::unlock): Deleted. (WTF::WordLock::isHeld const): Deleted. (WTF::WordLock::isLocked const): Deleted. (WTF::WordLock::isFullyReset const): Deleted. * wtf/generic/MainThreadGeneric.cpp: * wtf/glib/GMutexLocker.h: * wtf/linux/CurrentProcessMemoryStatus.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::~Semaphore): Deleted. (WTF::Semaphore::wait): Deleted. (WTF::Semaphore::post): Deleted. * wtf/text/ASCIILiteral.h: (WTF::ASCIILiteral::operator const char* const): Deleted. (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted. (WTF::ASCIILiteral::null): Deleted. (WTF::ASCIILiteral::characters const): Deleted. (WTF::ASCIILiteral::ASCIILiteral): Deleted. * wtf/text/AtomString.h: (WTF::AtomString::operator=): Deleted. (WTF::AtomString::isHashTableDeletedValue const): Deleted. (WTF::AtomString::existingHash const): Deleted. (WTF::AtomString::operator const String& const): Deleted. (WTF::AtomString::string const): Deleted. (WTF::AtomString::impl const): Deleted. (WTF::AtomString::is8Bit const): Deleted. (WTF::AtomString::characters8 const): Deleted. (WTF::AtomString::characters16 const): Deleted. (WTF::AtomString::length const): Deleted. (WTF::AtomString::operator[] const): Deleted. (WTF::AtomString::contains const): Deleted. (WTF::AtomString::containsIgnoringASCIICase const): Deleted. (WTF::AtomString::find const): Deleted. (WTF::AtomString::findIgnoringASCIICase const): Deleted. (WTF::AtomString::startsWith const): Deleted. (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::endsWith const): Deleted. (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::toInt const): Deleted. (WTF::AtomString::toDouble const): Deleted. (WTF::AtomString::toFloat const): Deleted. (WTF::AtomString::percentage const): Deleted. (WTF::AtomString::isNull const): Deleted. (WTF::AtomString::isEmpty const): Deleted. (WTF::AtomString::operator NSString * const): Deleted. * wtf/text/AtomStringImpl.h: (WTF::AtomStringImpl::lookUp): Deleted. (WTF::AtomStringImpl::add): Deleted. (WTF::AtomStringImpl::addWithStringTableProvider): Deleted. * wtf/text/CString.h: (WTF::CStringBuffer::data): Deleted. (WTF::CStringBuffer::length const): Deleted. (WTF::CStringBuffer::CStringBuffer): Deleted. (WTF::CStringBuffer::mutableData): Deleted. (WTF::CString::CString): Deleted. (WTF::CString::data const): Deleted. (WTF::CString::length const): Deleted. (WTF::CString::isNull const): Deleted. (WTF::CString::buffer const): Deleted. (WTF::CString::isHashTableDeletedValue const): Deleted. * wtf/text/ExternalStringImpl.h: (WTF::ExternalStringImpl::freeExternalBuffer): Deleted. * wtf/text/LineBreakIteratorPoolICU.h: * wtf/text/NullTextBreakIterator.h: * wtf/text/OrdinalNumber.h: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.h: * wtf/text/StringConcatenateNumbers.h: * wtf/text/StringHasher.h: * wtf/text/StringImpl.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: (WTF::StringView::left const): Deleted. (WTF::StringView::right const): Deleted. (WTF::StringView::underlyingStringIsValid const): Deleted. (WTF::StringView::setUnderlyingString): Deleted. * wtf/text/SymbolImpl.h: (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted. (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted. (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted. (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted. (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted. (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted. * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.h: * wtf/text/WTFString.h: (WTF::String::swap): Deleted. (WTF::String::adopt): Deleted. (WTF::String::isNull const): Deleted. (WTF::String::isEmpty const): Deleted. (WTF::String::impl const): Deleted. (WTF::String::releaseImpl): Deleted. (WTF::String::length const): Deleted. (WTF::String::characters8 const): Deleted. (WTF::String::characters16 const): Deleted. (WTF::String::is8Bit const): Deleted. (WTF::String::sizeInBytes const): Deleted. (WTF::String::operator[] const): Deleted. (WTF::String::find const): Deleted. (WTF::String::findIgnoringASCIICase const): Deleted. (WTF::String::reverseFind const): Deleted. (WTF::String::contains const): Deleted. (WTF::String::containsIgnoringASCIICase const): Deleted. (WTF::String::startsWith const): Deleted. (WTF::String::startsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixStartingAt const): Deleted. (WTF::String::endsWith const): Deleted. (WTF::String::endsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixEndingAt const): Deleted. (WTF::String::append): Deleted. (WTF::String::left const): Deleted. (WTF::String::right const): Deleted. (WTF::String::createUninitialized): Deleted. (WTF::String::fromUTF8WithLatin1Fallback): Deleted. (WTF::String::isAllASCII const): Deleted. (WTF::String::isAllLatin1 const): Deleted. (WTF::String::isSpecialCharacter const): Deleted. (WTF::String::isHashTableDeletedValue const): Deleted. (WTF::String::hash const): Deleted. (WTF::String::existingHash const): Deleted. * wtf/text/cf/TextBreakIteratorCF.h: * wtf/text/icu/TextBreakIteratorICU.h: * wtf/text/icu/UTextProviderLatin1.h: * wtf/threads/BinarySemaphore.h: (WTF::BinarySemaphore::waitFor): Deleted. (WTF::BinarySemaphore::wait): Deleted. * wtf/unicode/Collator.h: * wtf/win/GDIObject.h: * wtf/win/PathWalker.h: * wtf/win/Win32Handle.h: Canonical link: https://commits.webkit.org/214396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-12 20:57:15 +00:00
WTF_MAKE_FAST_ALLOCATED;
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
public:
Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator https://bugs.webkit.org/show_bug.cgi?id=50653 Reviewed by Sam Weinig. * JavaScriptCore.exp: Updated for new function signature. * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): (JSC::RegisterFile::grow): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::reuse): (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay. OSAllocator is now the central location for verifying that allocation succeeds. This allowed me to remove some complicating cross-platform cruft. * runtime/AlignedMemoryAllocator.h: (JSC::::allocate): Updated for code motion. * wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to support VM features required by clients of PageAllocation and PageReservation. * wtf/OSAllocatorPosix.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Moved PageAllocation support for randomizing executable memory here. * wtf/OSAllocatorSymbian.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Updated for new function signatures. * wtf/OSAllocatorWin.cpp: (WTF::protection): (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::release): Updated for new function signatures. Moved some protection-related and WINCE-related code from PageAllocation here. * wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since it was only used by checkAllocatedOkay, which is now gone. * wtf/PageAllocation.h: (WTF::PageAllocation::allocate): (WTF::PageAllocation::allocateAligned): (WTF::PageAllocation::deallocate): (WTF::PageAllocation::isPowerOfTwo): (WTF::PageAllocation::systemAllocateAligned): Removed system* functions, and replaced calls to them with calls to OSAllocator. * wtf/PageReservation.h: (WTF::PageReservation::commit): (WTF::PageReservation::decommit): (WTF::PageReservation::reserve): (WTF::PageReservation::deallocate): (WTF::PageReservation::PageReservation): Ditto. Added m_writable and m_executable because these flags are now required when committing memory. Canonical link: https://commits.webkit.org/63979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-09 01:30:18 +00:00
enum Usage {
UnknownUsage = -1,
FastMallocPages = VM_TAG_FOR_TCMALLOC_MEMORY,
JSJITCodePages = VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY,
};
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
// These methods are symmetric; reserveUncommitted allocates VM in an uncommitted state,
// releaseDecommitted should be called on a region of VM allocated by a single reservation,
Replace tryLargeMemalignVirtual with tryLargeZeroedMemalignVirtual and use it to allocate large zeroed memory in Wasm https://bugs.webkit.org/show_bug.cgi?id=182064 <rdar://problem/36840132> Reviewed by Geoffrey Garen. Source/bmalloc: This patch replaces the tryLargeMemalignVirtual API with tryLargeZeroedMemalignVirtual. By doing that, we're able to remove the AllocationKind enum. To zero the memory, tryLargeZeroedMemalignVirtual uses mmap(... MAP_ANON ...) over previously mmapped memory. This both purges the any resident memory for the virtual range and ensures that the pages in the range are zeroed. Most OSs should implement this by taking a page fault and zero filling on first access. Therefore, this API is returning pages that will result in page faults on first access. Hence, the name 'virtual' in the API. This API differs from the old API in that users of it need not call madvise themselves. The memory is ready to go. * bmalloc.xcodeproj/project.pbxproj: * bmalloc/AllocationKind.h: Removed. * bmalloc/DebugHeap.cpp: (bmalloc::DebugHeap::memalignLarge): (bmalloc::DebugHeap::freeLarge): * bmalloc/DebugHeap.h: * bmalloc/Heap.cpp: (bmalloc::Heap::splitAndAllocate): (bmalloc::Heap::tryAllocateLarge): (bmalloc::Heap::allocateLarge): (bmalloc::Heap::shrinkLarge): (bmalloc::Heap::deallocateLarge): * bmalloc/Heap.h: * bmalloc/IsoPage.cpp: (bmalloc::IsoPageBase::allocatePageMemory): * bmalloc/VMAllocate.h: (bmalloc::vmZeroAndPurge): * bmalloc/VMHeap.cpp: (bmalloc::VMHeap::tryAllocateLargeChunk): * bmalloc/VMHeap.h: * bmalloc/bmalloc.cpp: (bmalloc::api::tryLargeZeroedMemalignVirtual): (bmalloc::api::freeLargeVirtual): (bmalloc::api::tryLargeMemalignVirtual): Deleted. * bmalloc/bmalloc.h: Source/JavaScriptCore: This patch switches WebAssembly Memory to always use bmalloc's zeroed virtual allocation API. This makes it so that we don't dirty the memory to zero it. It's a huge compile time speedup on WasmBench on iOS. * wasm/WasmMemory.cpp: (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::addressIsInActiveFastMemory): (JSC::Wasm::Memory::grow): (JSC::Wasm::commitZeroPages): Deleted. Source/WTF: * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): (Gigacage::freeVirtualPages): (Gigacage::tryAllocateVirtualPages): Deleted. * wtf/Gigacage.h: * wtf/OSAllocator.h: Canonical link: https://commits.webkit.org/198171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-01 05:36:40 +00:00
// the memory must all currently be in a decommitted state. reserveUncommitted returns to
// you memory that is zeroed.
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
WTF_EXPORT_PRIVATE static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false, bool includesGuardPages = false);
JavaScriptCore: Mark all exported symbols in the header file automatically. https://bugs.webkit.org/show_bug.cgi?id=72855 Reviewed by Darin Adler. Added WTF_EXPORT_PRIVATE and JS_EXPORT_PRIVATE based on JavaScriptCore.exp files. The change is generated by a tool calledListExportables (https://github.com/omo/ListExportables) * API/OpaqueJSString.h: * bytecode/CodeBlock.h: * bytecode/SamplingTool.h: * debugger/Debugger.h: * debugger/DebuggerActivation.h: * debugger/DebuggerCallFrame.h: * heap/AllocationSpace.h: * heap/HandleHeap.h: * heap/Heap.h: * heap/MachineStackMarker.h: * heap/MarkStack.h: * heap/VTableSpectrum.h: * heap/WriteBarrierSupport.h: * parser/Nodes.h: * parser/ParserArena.h: * profiler/Profile.h: * runtime/ArgList.h: * runtime/CallData.h: * runtime/Completion.h: * runtime/ConstructData.h: * runtime/DateInstance.h: * runtime/Error.h: * runtime/ExceptionHelpers.h: * runtime/FunctionConstructor.h: * runtime/Identifier.h: * runtime/InitializeThreading.h: * runtime/InternalFunction.h: * runtime/JSArray.h: * runtime/JSByteArray.h: * runtime/JSCell.h: * runtime/JSFunction.h: * runtime/JSGlobalData.cpp: * runtime/JSGlobalData.h: * runtime/JSGlobalObject.h: * runtime/JSGlobalThis.h: * runtime/JSLock.h: * runtime/JSObject.h: * runtime/JSString.h: * runtime/JSValue.h: * runtime/JSVariableObject.h: * runtime/Lookup.h: * runtime/MemoryStatistics.h: * runtime/ObjectPrototype.h: * runtime/Options.h: * runtime/PropertyDescriptor.h: * runtime/PropertyNameArray.h: * runtime/PropertySlot.h: * runtime/RegExp.h: * runtime/RegExpObject.h: * runtime/SamplingCounter.h: * runtime/SmallStrings.h: * runtime/StringObject.h: * runtime/Structure.h: * runtime/TimeoutChecker.h: * runtime/UString.h: * runtime/WriteBarrier.h: * wtf/ArrayBufferView.h: * wtf/ByteArray.h: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.h: * wtf/DateMath.h: * wtf/DecimalNumber.h: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/MD5.h: * wtf/MainThread.h: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/OSAllocator.h: * wtf/PageBlock.h: * wtf/RandomNumber.h: * wtf/RefCountedLeakCounter.h: * wtf/SHA1.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/WTFThreadData.h: * wtf/dtoa.h: * wtf/text/AtomicString.h: * wtf/text/CString.h: * wtf/text/StringBuilder.h: * wtf/text/StringImpl.h: * wtf/text/WTFString.h: * wtf/unicode/Collator.h: * wtf/unicode/UTF8.h: * yarr/Yarr.h: * yarr/YarrPattern.h: Canonical link: https://commits.webkit.org/93051@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-13 07:23:44 +00:00
WTF_EXPORT_PRIVATE static void releaseDecommitted(void*, size_t);
Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator https://bugs.webkit.org/show_bug.cgi?id=50653 Reviewed by Sam Weinig. * JavaScriptCore.exp: Updated for new function signature. * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): (JSC::RegisterFile::grow): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::reuse): (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay. OSAllocator is now the central location for verifying that allocation succeeds. This allowed me to remove some complicating cross-platform cruft. * runtime/AlignedMemoryAllocator.h: (JSC::::allocate): Updated for code motion. * wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to support VM features required by clients of PageAllocation and PageReservation. * wtf/OSAllocatorPosix.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Moved PageAllocation support for randomizing executable memory here. * wtf/OSAllocatorSymbian.cpp: (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): Updated for new function signatures. * wtf/OSAllocatorWin.cpp: (WTF::protection): (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::release): Updated for new function signatures. Moved some protection-related and WINCE-related code from PageAllocation here. * wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since it was only used by checkAllocatedOkay, which is now gone. * wtf/PageAllocation.h: (WTF::PageAllocation::allocate): (WTF::PageAllocation::allocateAligned): (WTF::PageAllocation::deallocate): (WTF::PageAllocation::isPowerOfTwo): (WTF::PageAllocation::systemAllocateAligned): Removed system* functions, and replaced calls to them with calls to OSAllocator. * wtf/PageReservation.h: (WTF::PageReservation::commit): (WTF::PageReservation::decommit): (WTF::PageReservation::reserve): (WTF::PageReservation::deallocate): (WTF::PageReservation::PageReservation): Ditto. Added m_writable and m_executable because these flags are now required when committing memory. Canonical link: https://commits.webkit.org/63979@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-09 01:30:18 +00:00
// These methods are symmetric; they commit or decommit a region of VM (uncommitted VM should
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
// never be accessed, since the OS may not have attached physical memory for these regions).
// Clients should only call commit on uncommitted regions and decommit on committed regions.
Get rid of JavaScript exports file on AppleWin port. https://bugs.webkit.org/show_bug.cgi?id=117050. Reviewed by Darin Adler. This requires turning WTF into a shared library and adding the WTF_EXPORT_PRIVATE to some methods where it was missed. Start linking in WTF.lib now that it's a shared library. Also, delete the JavaScriptCoreExportGenerator folder and remove dependencies. * JavaScriptCore.vcxproj/JavaScriptCore.submit.sln: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.vcxproj/JavaScriptCoreCommon.props: * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj.filters: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorBuildCmd.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorCommon.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorDebug.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorPostBuild.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorPreBuild.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorProduction.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorRelease.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/make-export-file-generator: Removed. * JavaScriptCore.vcxproj/jsc/jscCommon.props: * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj.filters: * JavaScriptCore.vcxproj/testRegExp/testRegExpCommon.props: * JavaScriptCore.vcxproj/testapi/testapiCommon.props: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTFCommon.props: * wtf/DateMath.h: * wtf/ExportMacros.h: * wtf/FilePrintStream.h: * wtf/OSAllocator.h: * wtf/PageAllocationAligned.h: * wtf/Platform.h: * wtf/PrintStream.h: * wtf/StackBounds.h: * wtf/StringPrintStream.h: * wtf/ThreadSpecific.h: * wtf/WTFThreadData.h: * wtf/dtoa/cached-powers.h: * wtf/dtoa/double-conversion.h: * wtf/text/WTFString.h: * wtf/unicode/Collator.h: * wtf/unicode/UTF8.h: * WebKit.vcxproj/WebKit.sln: * WebKit.vcxproj/WebKit/WebKitCommon.props: * DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeCommon.props: * DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiffCommon.props: * TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props: Canonical link: https://commits.webkit.org/135316@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-05-31 00:38:15 +00:00
WTF_EXPORT_PRIVATE static void commit(void*, size_t, bool writable, bool executable);
WTF_EXPORT_PRIVATE static void decommit(void*, size_t);
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
// These methods are symmetric; reserveAndCommit allocates VM in an committed state,
// decommitAndRelease should be called on a region of VM allocated by a single reservation,
// the memory must all currently be in a committed state.
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
WTF_EXPORT_PRIVATE static void* reserveAndCommit(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false, bool includesGuardPages = false);
static void decommitAndRelease(void* base, size_t size);
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
// These methods are akin to reserveAndCommit/decommitAndRelease, above - however rather than
// committing/decommitting the entire region additional parameters allow a subregion to be
// specified.
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
WTF_EXPORT_PRIVATE static void* reserveAndCommit(size_t reserveSize, size_t commitSize, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false);
Implement a JIT-code aware sampling profiler for JSC https://bugs.webkit.org/show_bug.cgi?id=76855 Reviewed by Oliver Hunt. To enable the profiler, set the JSC_CODE_PROFILING environment variable to 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively trace all samples). The profiler requires -fomit-frame-pointer to be removed from the build flags. * JavaScriptCore.exp: - Removed an export. * JavaScriptCore.xcodeproj/project.pbxproj: - Added new files * bytecode/CodeBlock.cpp: - For baseline codeblocks, cache the result of canCompileWithDFG. * bytecode/CodeBlock.h: - For baseline codeblocks, cache the result of canCompileWithDFG. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/JITStubs.cpp: - If profiling, don't mask the return address in JIT code. (We do so to provide nicer backtraces in debug builds). * runtime/Completion.cpp: (JSC::evaluate): - Notify the profiler of script evaluations. * tools: Added. * tools/CodeProfile.cpp: Added. (JSC::symbolName): - Helper function to get the name of a symbol in the framework. (JSC::truncateTrace): - Helper to truncate traces into methods know to have uninformatively deep stacks. (JSC::CodeProfile::sample): - Record a stack trace classifying samples. (JSC::CodeProfile::report): - {Print profiler output. * tools/CodeProfile.h: Added. - new class, captures a set of samples associated with an evaluated script, and nested to record samples from subscripts. * tools/CodeProfiling.cpp: Added. (JSC::CodeProfiling::profilingTimer): - callback fired then a timer event occurs. (JSC::CodeProfiling::notifyAllocator): - called when the executable allocator is constructed. (JSC::CodeProfiling::getOwnerUIDForPC): - helper to lookup the codeblock from an address in JIT code (JSC::CodeProfiling::begin): - enter a profiling scope. (JSC::CodeProfiling::end): - exit a profiling scope. * tools/CodeProfiling.h: Added. - new class, instantialed from Completion to define a profiling scope. * tools/ProfileTreeNode.h: Added. - new class, used to construct a tree of samples. * tools/TieredMMapArray.h: Added. - new class, a malloc-free vector (can be used while the main thread is suspended, possibly holding the malloc heap lock). * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocator::allocate): - Allow allocation handles to track information about their owner. * wtf/MetaAllocator.h: (MetaAllocator): - Allow allocation handles to track information about their owner. * wtf/MetaAllocatorHandle.h: (MetaAllocatorHandle): (WTF::MetaAllocatorHandle::ownerUID): - Allow allocation handles to track information about their owner. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): - reallocate an existing, committed memory allocation. Canonical link: https://commits.webkit.org/94168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
// Reallocate an existing, committed allocation.
// The prior allocation must be fully comitted, and the new size will also be fully committed.
// This interface is provided since it may be possible to optimize this operation on some platforms.
template<typename T>
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
static T* reallocateCommitted(T*, size_t oldSize, size_t newSize, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false);
// Hint to the OS that an address range is not expected to be accessed anytime soon.
WTF_EXPORT_PRIVATE static void hintMemoryNotNeededSoon(void*, size_t);
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
};
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
inline void* OSAllocator::reserveAndCommit(size_t reserveSize, size_t commitSize, Usage usage, bool writable, bool executable, bool jitCageEnabled)
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
{
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
void* base = reserveUncommitted(reserveSize, usage, writable, executable, jitCageEnabled);
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
commit(base, commitSize, writable, executable);
return base;
}
Remove WinCE port from trunk https://bugs.webkit.org/show_bug.cgi?id=136951 Reviewed by Alex Christensen. .: * Source/cmake/OptionsWinCE.cmake: Removed. * Source/cmake/WebKitPackaging.cmake: Source/JavaScriptCore: * assembler/ARMAssembler.h: (JSC::ARMAssembler::cacheFlush): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::cacheFlush): * config.h: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::gatherFromCurrentThread): (JSC::MachineThreads::gatherFromOtherThread): (JSC::swapIfBackwards): Deleted. * jit/ExecutableAllocator.h: * jsc.cpp: (main): * runtime/DateConstructor.cpp: * runtime/Options.cpp: (JSC::overrideOptionWithHeuristic): * runtime/VM.cpp: (JSC::VM::VM): * testRegExp.cpp: (main): * tools/CodeProfiling.cpp: (JSC::CodeProfiling::notifyAllocator): Source/WebCore: * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: * PlatformWinCE.cmake: Removed. * accessibility/AXObjectCache.cpp: * editing/FrameSelection.cpp: (WebCore::FrameSelection::modifyMovingRight): * loader/icon/wince/IconDatabaseWinCE.cpp: Removed. * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEventForKey): * page/Settings.cpp: * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::createDraggingDataTransfer): * platform/ContextMenu.h: * platform/DragImage.cpp: * platform/FileSystem.h: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::mayFillWithSolidColor): * platform/graphics/FontGlyphs.cpp: (WebCore::FontGlyphs::glyphDataAndPageForCharacter): * platform/graphics/FontPlatformData.h: * platform/graphics/ImageBufferData.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/SimpleFontData.h: * platform/graphics/opentype/OpenTypeUtilities.cpp: (WebCore::renameAndActivateFont): * platform/graphics/opentype/OpenTypeUtilities.h: * platform/graphics/win/DIBPixelData.cpp: (WebCore::DIBPixelData::setRGBABitmapAlpha): * platform/graphics/win/GDIExtras.cpp: Removed. * platform/graphics/win/GDIExtras.h: (WebCore::hasAlphaBlendSupport): (WebCore::alphaBlendIfSupported): * platform/graphics/win/IconWin.cpp: (WebCore::Icon::createIconForFiles): (WebCore::Icon::paint): * platform/graphics/win/SimpleFontDataWin.cpp: (WebCore::SimpleFontData::initGDIFont): (WebCore::SimpleFontData::platformDestroy): (WebCore::SimpleFontData::boundsForGDIGlyph): (WebCore::SimpleFontData::widthForGDIGlyph): (WebCore::SimpleFontData::scriptFontProperties): * platform/graphics/wince/FontCacheWinCE.cpp: Removed. * platform/graphics/wince/FontCustomPlatformData.cpp: Removed. * platform/graphics/wince/FontCustomPlatformData.h: Removed. * platform/graphics/wince/FontPlatformData.cpp: Removed. * platform/graphics/wince/FontPlatformData.h: Removed. * platform/graphics/wince/FontWinCE.cpp: Removed. * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp: Removed. * platform/graphics/wince/GradientWinCE.cpp: Removed. * platform/graphics/wince/GraphicsContextWinCE.cpp: Removed. * platform/graphics/wince/ImageBufferDataWince.h: Removed. * platform/graphics/wince/ImageBufferWinCE.cpp: Removed. * platform/graphics/wince/ImageWinCE.cpp: Removed. * platform/graphics/wince/MediaPlayerPrivateWinCE.h: Removed. * platform/graphics/wince/MediaPlayerProxy.cpp: Removed. * platform/graphics/wince/MediaPlayerProxy.h: Removed. * platform/graphics/wince/PathWinCE.cpp: Removed. * platform/graphics/wince/PlatformPathWinCE.cpp: Removed. * platform/graphics/wince/PlatformPathWinCE.h: Removed. * platform/graphics/wince/SharedBitmap.cpp: Removed. * platform/graphics/wince/SharedBitmap.h: Removed. * platform/graphics/wince/SimpleFontDataWinCE.cpp: Removed. * platform/graphics/wince/WinCEGraphicsExtras.h: Removed. * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/network/win/NetworkStateNotifierWin.cpp: (WebCore::NetworkStateNotifier::NetworkStateNotifier): * platform/win/COMPtr.h: * platform/win/ClipboardUtilitiesWin.cpp: * platform/win/ContextMenuItemWin.cpp: * platform/win/ContextMenuWin.cpp: (WebCore::ContextMenu::getContextMenuItems): (WebCore::ContextMenu::createPlatformContextMenuFromItems): * platform/win/DragImageWin.cpp: (WebCore::dragLabelFont): * platform/win/FileSystemWin.cpp: (WebCore::pathByAppendingComponent): (WebCore::pathGetFileName): (WebCore::storageDirectory): * platform/win/LoggingWin.cpp: (WebCore::logLevelString): * platform/win/PasteboardWin.cpp: (WebCore::PasteboardOwnerWndProc): (WebCore::Pasteboard::createForCopyAndPaste): (WebCore::pathRemoveBadFSCharacters): (WebCore::filesystemPathFromUrlOrTitle): (WebCore::createGlobalHDropContent): * platform/win/PlatformMouseEventWin.cpp: (WebCore::messageToEventType): (WebCore::PlatformMouseEvent::PlatformMouseEvent): * platform/win/PlatformScreenWin.cpp: (WebCore::deviceInfoForWidget): (WebCore::screenIsMonochrome): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::show): (WebCore::PopupMenuWin::paint): (WebCore::PopupMenuWin::registerClass): (WebCore::PopupMenuWin::wndProc): * platform/win/ScrollbarThemeWin.cpp: (WebCore::ScrollbarThemeWin::paintButton): * platform/win/SharedBufferWin.cpp: * platform/win/SharedTimerWin.cpp: (WebCore::TimerWindowWndProc): (WebCore::initializeOffScreenTimerWindow): (WebCore::queueTimerProc): (WebCore::setSharedTimerFireInterval): (WebCore::stopSharedTimer): * platform/win/SoftLinking.h: * platform/win/SystemInfo.cpp: (WebCore::windowsVersion): (WebCore::processorArchitecture): (WebCore::architectureTokenForUAString): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::CopyMedium): * plugins/PluginDatabase.cpp: * plugins/PluginView.cpp: (WebCore::PluginView::stop): * plugins/PluginViewNone.cpp: * plugins/win/PluginDatabaseWin.cpp: (WebCore::addWindowsMediaPlayerPluginDirectory): (WebCore::addMacromediaPluginDirectories): * plugins/win/PluginPackageWin.cpp: (WebCore::PluginPackage::load): * plugins/win/PluginViewWin.cpp: (WebCore::setUpOffscreenPaintingHooks): (WebCore::registerPluginView): (WebCore::PluginView::wndProc): (WebCore::PluginView::updatePluginWidget): (WebCore::PluginView::paintIntoTransformedContext): (WebCore::PluginView::paint): (WebCore::PluginView::handleMouseEvent): (WebCore::PluginView::setParent): (WebCore::PluginView::setNPWindowRect): (WebCore::PluginView::platformStart): * rendering/RenderThemeWinCE.cpp: Removed. * rendering/RenderThemeWinCE.h: Removed. * storage/wince/DatabaseThreadWinCE.cpp: Removed. * storage/wince/DatabaseThreadWinCE.h: Removed. * storage/wince/StorageThreadWinCE.cpp: Removed. * storage/wince/StorageThreadWinCE.h: Removed. Source/WebKit: * PlatformWinCE.cmake: Removed. * wince/WebCoreSupport/ChromeClientWinCE.cpp: Removed. * wince/WebCoreSupport/ChromeClientWinCE.h: Removed. * wince/WebCoreSupport/ContextMenuClientWinCE.cpp: Removed. * wince/WebCoreSupport/ContextMenuClientWinCE.h: Removed. * wince/WebCoreSupport/DragClientWinCE.cpp: Removed. * wince/WebCoreSupport/DragClientWinCE.h: Removed. * wince/WebCoreSupport/EditorClientWinCE.cpp: Removed. * wince/WebCoreSupport/EditorClientWinCE.h: Removed. * wince/WebCoreSupport/FrameLoaderClientWinCE.cpp: Removed. * wince/WebCoreSupport/FrameLoaderClientWinCE.h: Removed. * wince/WebCoreSupport/FrameNetworkingContextWinCE.cpp: Removed. * wince/WebCoreSupport/FrameNetworkingContextWinCE.h: Removed. * wince/WebCoreSupport/InspectorClientWinCE.cpp: Removed. * wince/WebCoreSupport/InspectorClientWinCE.h: Removed. * wince/WebCoreSupport/PlatformStrategiesWinCE.cpp: Removed. * wince/WebCoreSupport/PlatformStrategiesWinCE.h: Removed. * wince/WebView.cpp: Removed. * wince/WebView.h: Removed. Source/WebKit/cf: * WebCoreSupport/WebInspectorClientCF.cpp: Source/WTF: * config.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: (WTF::weakCompareAndSwap): * wtf/CurrentTime.cpp: (WTF::lowResUTCTime): * wtf/DataLog.cpp: * wtf/DateMath.cpp: (WTF::getLocalTime): (WTF::calculateDSTOffset): * wtf/FastMalloc.cpp: * wtf/FeatureDefines.h: * wtf/OSAllocator.h: (WTF::OSAllocator::decommitAndRelease): * wtf/Platform.h: * wtf/PlatformWin.cmake: * wtf/RAMSize.cpp: (WTF::computeRAMSize): * wtf/RandomNumberSeed.h: (WTF::initializeRandomNumberGenerator): * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): * wtf/StackBounds.h: (WTF::StackBounds::isGrowingDownward): * wtf/StdLibExtras.h: (wtf_bsearch): Deleted. * wtf/StringExtras.h: (strnicmp): Deleted. (stricmp): Deleted. (strdup): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingWin.cpp: (WTF::createThreadInternal): * wtf/WindowsExtras.h: (WTF::getRegistryValue): (WTF::getWindowPointer): (WTF::setWindowPointer): * wtf/dtoa/utils.h: * wtf/text/WTFString.cpp: (WTF::String::format): Tools: * BuildSlaveSupport/build.webkit.org-config/wkbuild.py: (_should_file_trigger_build): * BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py: (ShouldBuildTest): * CMakeLists.txt: * DumpRenderTree/win/DRTDataObject.cpp: (DRTDataObject::CopyMedium): * Scripts/build-webkit: * Scripts/webkit-build-directory: * Scripts/webkitdirs.pm: (argumentsForConfiguration): (builtDylibPathForName): (isAppleWinWebKit): (launcherPath): (launcherName): (shouldRemoveCMakeCache): (cmakeBasedPortArguments): (cmakeBasedPortName): (isCMakeBuild): (isWinCE): Deleted. (determineIsWinCE): Deleted. * Scripts/webkitperl/FeatureList.pm: * Scripts/webkitpy/port/port_testcase.py: (test_apache_config_file_name_for_platform): * TestWebKitAPI/config.h: * WinCELauncher/CMakeLists.txt: Removed. * WinCELauncher/main.cpp: Removed. * gtk/manifest.txt: Canonical link: https://commits.webkit.org/154914@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-25 10:14:57 +00:00
inline void OSAllocator::decommitAndRelease(void* releaseBase, size_t releaseSize)
JavaScriptCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. JavaScriptGlue: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. WebCore: Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 Patch by Geoffrey Garen <ggaren@apple.com> on 2010-12-21 Reviewed by Gavin Barraclough & Oliver Hunt. * ForwardingHeaders/wtf/PageAllocationAligned.h: Added. Canonical link: https://commits.webkit.org/64773@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-21 23:53:25 +00:00
{
releaseDecommitted(releaseBase, releaseSize);
}
Implement a JIT-code aware sampling profiler for JSC https://bugs.webkit.org/show_bug.cgi?id=76855 Reviewed by Oliver Hunt. To enable the profiler, set the JSC_CODE_PROFILING environment variable to 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively trace all samples). The profiler requires -fomit-frame-pointer to be removed from the build flags. * JavaScriptCore.exp: - Removed an export. * JavaScriptCore.xcodeproj/project.pbxproj: - Added new files * bytecode/CodeBlock.cpp: - For baseline codeblocks, cache the result of canCompileWithDFG. * bytecode/CodeBlock.h: - For baseline codeblocks, cache the result of canCompileWithDFG. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/JITStubs.cpp: - If profiling, don't mask the return address in JIT code. (We do so to provide nicer backtraces in debug builds). * runtime/Completion.cpp: (JSC::evaluate): - Notify the profiler of script evaluations. * tools: Added. * tools/CodeProfile.cpp: Added. (JSC::symbolName): - Helper function to get the name of a symbol in the framework. (JSC::truncateTrace): - Helper to truncate traces into methods know to have uninformatively deep stacks. (JSC::CodeProfile::sample): - Record a stack trace classifying samples. (JSC::CodeProfile::report): - {Print profiler output. * tools/CodeProfile.h: Added. - new class, captures a set of samples associated with an evaluated script, and nested to record samples from subscripts. * tools/CodeProfiling.cpp: Added. (JSC::CodeProfiling::profilingTimer): - callback fired then a timer event occurs. (JSC::CodeProfiling::notifyAllocator): - called when the executable allocator is constructed. (JSC::CodeProfiling::getOwnerUIDForPC): - helper to lookup the codeblock from an address in JIT code (JSC::CodeProfiling::begin): - enter a profiling scope. (JSC::CodeProfiling::end): - exit a profiling scope. * tools/CodeProfiling.h: Added. - new class, instantialed from Completion to define a profiling scope. * tools/ProfileTreeNode.h: Added. - new class, used to construct a tree of samples. * tools/TieredMMapArray.h: Added. - new class, a malloc-free vector (can be used while the main thread is suspended, possibly holding the malloc heap lock). * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocator::allocate): - Allow allocation handles to track information about their owner. * wtf/MetaAllocator.h: (MetaAllocator): - Allow allocation handles to track information about their owner. * wtf/MetaAllocatorHandle.h: (MetaAllocatorHandle): (WTF::MetaAllocatorHandle::ownerUID): - Allow allocation handles to track information about their owner. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): - reallocate an existing, committed memory allocation. Canonical link: https://commits.webkit.org/94168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
template<typename T>
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
inline T* OSAllocator::reallocateCommitted(T* oldBase, size_t oldSize, size_t newSize, Usage usage, bool writable, bool executable, bool jitCageEnabled)
Implement a JIT-code aware sampling profiler for JSC https://bugs.webkit.org/show_bug.cgi?id=76855 Reviewed by Oliver Hunt. To enable the profiler, set the JSC_CODE_PROFILING environment variable to 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively trace all samples). The profiler requires -fomit-frame-pointer to be removed from the build flags. * JavaScriptCore.exp: - Removed an export. * JavaScriptCore.xcodeproj/project.pbxproj: - Added new files * bytecode/CodeBlock.cpp: - For baseline codeblocks, cache the result of canCompileWithDFG. * bytecode/CodeBlock.h: - For baseline codeblocks, cache the result of canCompileWithDFG. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/JITStubs.cpp: - If profiling, don't mask the return address in JIT code. (We do so to provide nicer backtraces in debug builds). * runtime/Completion.cpp: (JSC::evaluate): - Notify the profiler of script evaluations. * tools: Added. * tools/CodeProfile.cpp: Added. (JSC::symbolName): - Helper function to get the name of a symbol in the framework. (JSC::truncateTrace): - Helper to truncate traces into methods know to have uninformatively deep stacks. (JSC::CodeProfile::sample): - Record a stack trace classifying samples. (JSC::CodeProfile::report): - {Print profiler output. * tools/CodeProfile.h: Added. - new class, captures a set of samples associated with an evaluated script, and nested to record samples from subscripts. * tools/CodeProfiling.cpp: Added. (JSC::CodeProfiling::profilingTimer): - callback fired then a timer event occurs. (JSC::CodeProfiling::notifyAllocator): - called when the executable allocator is constructed. (JSC::CodeProfiling::getOwnerUIDForPC): - helper to lookup the codeblock from an address in JIT code (JSC::CodeProfiling::begin): - enter a profiling scope. (JSC::CodeProfiling::end): - exit a profiling scope. * tools/CodeProfiling.h: Added. - new class, instantialed from Completion to define a profiling scope. * tools/ProfileTreeNode.h: Added. - new class, used to construct a tree of samples. * tools/TieredMMapArray.h: Added. - new class, a malloc-free vector (can be used while the main thread is suspended, possibly holding the malloc heap lock). * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocator::allocate): - Allow allocation handles to track information about their owner. * wtf/MetaAllocator.h: (MetaAllocator): - Allow allocation handles to track information about their owner. * wtf/MetaAllocatorHandle.h: (MetaAllocatorHandle): (WTF::MetaAllocatorHandle::ownerUID): - Allow allocation handles to track information about their owner. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): - reallocate an existing, committed memory allocation. Canonical link: https://commits.webkit.org/94168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
{
[JSC] Add JITCage support https://bugs.webkit.org/show_bug.cgi?id=218143 Reviewed by Saam Barati. Source/JavaScriptCore: Towards software verified JIT, this patch adds partial JIT-Caging support which cages JIT call / jumps in a certain format. This is currently only enabled when internal SDK is enabled. And it is only enabled in ARM64E for now. Currently, this patch does not have CSS JIT support. Subsequent patch will add it. We ensured that JS2 and RAMification are neutral. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/JITOperationList.cpp: (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): * assembler/JITOperationList.h: (JSC::JITOperationList::map const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::contains const): Deleted. * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::farJump): * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::callTrustedPtr): (JSC::MacroAssemblerARM64E::call): (JSC::MacroAssemblerARM64E::callRegister): (JSC::MacroAssemblerARM64E::farJumpRegister): (JSC::MacroAssemblerARM64E::farJump): (JSC::MacroAssemblerARM64E::ret): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::farJump): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::farJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::farJump): * bytecode/BytecodeList.rb: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::callerReturnPC): (JSC::DFG::adjustAndJumpToTarget): * dfg/DFGOSRExitCompilerCommon.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled): (JSC::initializeJITPageReservation): * jit/GPRInfo.h: * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::getOpcode): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getCodePtr): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::getCodeFunctionPtr): (JSC::LLInt::getWide16CodeFunctionPtr): (JSC::LLInt::getWide32CodeFunctionPtr): * llint/LLIntEntrypoint.cpp: (JSC::LLInt::entrypointTrampoline): (JSC::LLInt::setFunctionEntrypoint): (JSC::LLInt::setEvalEntrypoint): (JSC::LLInt::setProgramEntrypoint): (JSC::LLInt::setModuleProgramEntrypoint): (JSC::LLInt::getHostCallReturnValueEntrypoint): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintEntrypoint): (JSC::LLInt::genericReturnPointEntrypoint): * llint/LLIntEntrypoint.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::commonCallEval): (JSC::LLInt::dispatchToNextInstruction): * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::generateThunkWithJumpToPrologue): (JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint): (JSC::LLInt::functionForCallEntryThunk): (JSC::LLInt::functionForConstructEntryThunk): (JSC::LLInt::functionForCallArityCheckThunk): (JSC::LLInt::functionForConstructArityCheckThunk): (JSC::LLInt::evalEntryThunk): (JSC::LLInt::programEntryThunk): (JSC::LLInt::moduleProgramEntryThunk): (JSC::LLInt::wasmFunctionEntryThunk): (JSC::LLInt::handleCatchThunk): (JSC::LLInt::genericReturnPointThunk): (JSC::LLInt::fuzzerReturnEarlyFromLoopHintThunk): (JSC::LLInt::createJSGateThunk): (JSC::LLInt::createWasmGateThunk): (JSC::LLInt::createTailCallGate): (JSC::LLInt::loopOSREntryGateThunk): (JSC::LLInt::entryOSREntryGateThunk): (JSC::LLInt::wasmOSREntryGateThunk): (JSC::LLInt::exceptionHandlerGateThunk): (JSC::LLInt::returnFromLLIntGateThunk): (JSC::LLInt::tagGateThunk): (JSC::LLInt::untagGateThunk): (JSC::LLInt::jitCagePtrThunk): (JSC::LLInt::normalOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitTrampolineThunk): (JSC::LLInt::checkpointOSRExitFromInlinedCallTrampolineThunk): (JSC::LLInt::returnLocationThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64.rb: * offlineasm/mips.rb: * runtime/Gate.h: Added. * runtime/JSCConfig.h: * runtime/JSCPtrTag.cpp: (JSC::tagForPtr): (JSC::callerType): (JSC::calleeType): * runtime/JSCPtrTag.h: (JSC::tagJSCCodePtrImpl): (JSC::untagJSCCodePtrImpl): (JSC::tagCodePtrWithStackPointerForJITCall): (JSC::untagCodePtrWithStackPointerForJITCall): * runtime/MatchResult.h: (JSC::MatchResult::MatchResult): * runtime/Options.cpp: (JSC::disableAllJITOptions): (JSC::canUseJITCage): * runtime/OptionsList.h: * wasm/WasmSlowPaths.cpp: * yarr/YarrJIT.cpp: * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): Source/WTF: * wtf/OSAllocator.h: (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::reallocateCommitted): * wtf/PageReservation.h: (WTF::PageReservation::reserve): (WTF::PageReservation::reserveWithGuardPages): (WTF::PageReservation::reserveAndCommitWithGuardPages): (WTF::PageReservation::PageReservation): * wtf/PlatformEnable.h: * wtf/PlatformUse.h: * wtf/PtrTag.h: (WTF::assertIsTaggedWith): (WTF::tagCodePtrWithStackPointerForJITCall): Deleted. (WTF::untagCodePtrWithStackPointerForJITCall): Deleted. * wtf/posix/OSAllocatorPOSIX.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): Canonical link: https://commits.webkit.org/231193@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-04 02:31:56 +00:00
void* newBase = reserveAndCommit(newSize, usage, writable, executable, jitCageEnabled);
Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a progression. Source/bmalloc: * 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): Source/JavaScriptCore: * 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): Source/WTF: * 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: Canonical link: https://commits.webkit.org/198639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 21:38:53 +00:00
memcpy(newBase, oldBase, std::min(oldSize, newSize));
Implement a JIT-code aware sampling profiler for JSC https://bugs.webkit.org/show_bug.cgi?id=76855 Reviewed by Oliver Hunt. To enable the profiler, set the JSC_CODE_PROFILING environment variable to 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively trace all samples). The profiler requires -fomit-frame-pointer to be removed from the build flags. * JavaScriptCore.exp: - Removed an export. * JavaScriptCore.xcodeproj/project.pbxproj: - Added new files * bytecode/CodeBlock.cpp: - For baseline codeblocks, cache the result of canCompileWithDFG. * bytecode/CodeBlock.h: - For baseline codeblocks, cache the result of canCompileWithDFG. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): - Notify the profiler when the allocator is created. (JSC::ExecutableAllocator::allocate): - Inform the allocated of the ownerUID. * jit/JITStubs.cpp: - If profiling, don't mask the return address in JIT code. (We do so to provide nicer backtraces in debug builds). * runtime/Completion.cpp: (JSC::evaluate): - Notify the profiler of script evaluations. * tools: Added. * tools/CodeProfile.cpp: Added. (JSC::symbolName): - Helper function to get the name of a symbol in the framework. (JSC::truncateTrace): - Helper to truncate traces into methods know to have uninformatively deep stacks. (JSC::CodeProfile::sample): - Record a stack trace classifying samples. (JSC::CodeProfile::report): - {Print profiler output. * tools/CodeProfile.h: Added. - new class, captures a set of samples associated with an evaluated script, and nested to record samples from subscripts. * tools/CodeProfiling.cpp: Added. (JSC::CodeProfiling::profilingTimer): - callback fired then a timer event occurs. (JSC::CodeProfiling::notifyAllocator): - called when the executable allocator is constructed. (JSC::CodeProfiling::getOwnerUIDForPC): - helper to lookup the codeblock from an address in JIT code (JSC::CodeProfiling::begin): - enter a profiling scope. (JSC::CodeProfiling::end): - exit a profiling scope. * tools/CodeProfiling.h: Added. - new class, instantialed from Completion to define a profiling scope. * tools/ProfileTreeNode.h: Added. - new class, used to construct a tree of samples. * tools/TieredMMapArray.h: Added. - new class, a malloc-free vector (can be used while the main thread is suspended, possibly holding the malloc heap lock). * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocator::allocate): - Allow allocation handles to track information about their owner. * wtf/MetaAllocator.h: (MetaAllocator): - Allow allocation handles to track information about their owner. * wtf/MetaAllocatorHandle.h: (MetaAllocatorHandle): (WTF::MetaAllocatorHandle::ownerUID): - Allow allocation handles to track information about their owner. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): - reallocate an existing, committed memory allocation. Canonical link: https://commits.webkit.org/94168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
decommitAndRelease(oldBase, oldSize);
return static_cast<T*>(newBase);
}
Baby step toward a cross-platform virtual memory abstraction: created an all-static OSAllocator class and changed MarkStack to use it. Reviewed by Sam Weinig. * JavaScriptCore.exp: These functions are inlined now. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp. * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp. * runtime/MarkStack.h: (JSC::MarkStack::allocateStack): (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our own platform-specific code. * runtime/MarkStackNone.cpp: Removed. Nothing used this. * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since we use the OSAllocator abstraction now. * wtf/OSAllocator.h: Added. * wtf/OSAllocatorPosix.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorSymbian.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): * wtf/OSAllocatorWin.cpp: Added. (WTF::OSAllocator::reserve): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): (WTF::OSAllocator::decommit): (WTF::OSAllocator::release): The new OSAllocator abstraction. * wtf/wtf.pri: Added OSAllocatorSymbian.cpp. Canonical link: https://commits.webkit.org/63537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-12-02 02:13:59 +00:00
} // namespace WTF
using WTF::OSAllocator;