haikuwebkit/Source/WTF/wtf/MetaAllocator.cpp

500 lines
17 KiB
C++
Raw Permalink Normal View History

The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
/*
* Copyright (C) 2011-2021 Apple Inc. All rights reserved.
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +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.
.: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * ManualTests/NPN_Invoke/Info.plist: * ManualTests/NPN_Invoke/main.c: * ManualTests/accessibility/resources/AppletTest.java: Examples: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * NetscapeCocoaPlugin/MenuHandler.h: * NetscapeCocoaPlugin/MenuHandler.m: * NetscapeCocoaPlugin/main.m: * NetscapeCoreAnimationPlugin/main.m: * NetscapeInputMethodPlugin/main.m: PerformanceTests: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Dromaeo/resources/dromaeo/web/tests/sunspider-3d-raytrace.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-bitops-bitwise-and.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-math-cordic.html: * Dromaeo/resources/dromaeo/web/tests/sunspider-string-tagcloud.html: * LongSpider/3d-morph.js: * LongSpider/3d-raytrace.js: * LongSpider/math-cordic.js: * LongSpider/string-tagcloud.js: * Parser/resources/html5-8266.html: * Parser/resources/html5.html: PerformanceTests/SunSpider: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * hosted/sunspider.html: * hosted/versions.html: * make-hosted: * resources/TEMPLATE.html: * resources/driver-TEMPLATE.html: * resources/results-TEMPLATE.html: * resources/sunspider-analyze-results.js: * resources/sunspider-compare-results.js: * resources/sunspider-standalone-compare.js: * resources/sunspider-standalone-driver.js: * sunspider: * sunspider-compare-results: * tests/sunspider-0.9.1/3d-morph.js: * tests/sunspider-0.9.1/3d-raytrace.js: * tests/sunspider-0.9.1/bitops-bitwise-and.js: * tests/sunspider-0.9.1/math-cordic.js: * tests/sunspider-0.9.1/string-tagcloud.js: * tests/sunspider-0.9/3d-morph.js: * tests/sunspider-0.9/3d-raytrace.js: * tests/sunspider-0.9/bitops-bitwise-and.js: * tests/sunspider-0.9/math-cordic.js: * tests/sunspider-0.9/string-tagcloud.js: * tests/sunspider-1.0.1/3d-morph.js: * tests/sunspider-1.0.1/3d-raytrace.js: * tests/sunspider-1.0.1/bitops-bitwise-and.js: * tests/sunspider-1.0.1/math-cordic.js: * tests/sunspider-1.0.1/string-tagcloud.js: * tests/sunspider-1.0.2/3d-morph.js: * tests/sunspider-1.0.2/3d-raytrace.js: * tests/sunspider-1.0.2/bitops-bitwise-and.js: * tests/sunspider-1.0.2/math-cordic.js: * tests/sunspider-1.0.2/string-tagcloud.js: * tests/sunspider-1.0/3d-morph.js: * tests/sunspider-1.0/3d-raytrace.js: * tests/sunspider-1.0/bitops-bitwise-and.js: * tests/sunspider-1.0/math-cordic.js: * tests/sunspider-1.0/string-tagcloud.js: Source/JavaScriptCore: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * API/APICast.h: * API/JSBase.cpp: * API/JSBase.h: * API/JSBasePrivate.h: * API/JSCallbackConstructor.cpp: * API/JSCallbackConstructor.h: * API/JSCallbackFunction.cpp: * API/JSCallbackFunction.h: * API/JSCallbackObject.cpp: * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: * API/JSClassRef.cpp: * API/JSClassRef.h: * API/JSContextRef.cpp: * API/JSContextRef.h: * API/JSContextRefPrivate.h: * API/JSObjectRef.cpp: * API/JSObjectRef.h: * API/JSProfilerPrivate.cpp: * API/JSProfilerPrivate.h: * API/JSRetainPtr.h: * API/JSStringRef.cpp: * API/JSStringRef.h: * API/JSStringRefBSTR.cpp: * API/JSStringRefBSTR.h: * API/JSStringRefCF.cpp: * API/JSStringRefCF.h: * API/JSValueRef.cpp: * API/JSValueRef.h: * API/JavaScript.h: * API/JavaScriptCore.h: * API/OpaqueJSString.cpp: * API/OpaqueJSString.h: * API/tests/JSNode.c: * API/tests/JSNode.h: * API/tests/JSNodeList.c: * API/tests/JSNodeList.h: * API/tests/Node.c: * API/tests/Node.h: * API/tests/NodeList.c: * API/tests/NodeList.h: * API/tests/minidom.c: * API/tests/minidom.js: * API/tests/testapi.c: * API/tests/testapi.js: * DerivedSources.make: * bindings/ScriptValue.cpp: * bytecode/CodeBlock.cpp: * bytecode/CodeBlock.h: * bytecode/EvalCodeCache.h: * bytecode/Instruction.h: * bytecode/JumpTable.cpp: * bytecode/JumpTable.h: * bytecode/Opcode.cpp: * bytecode/Opcode.h: * bytecode/SamplingTool.cpp: * bytecode/SamplingTool.h: * bytecode/SpeculatedType.cpp: * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: * bytecompiler/BytecodeGenerator.cpp: * bytecompiler/BytecodeGenerator.h: * bytecompiler/Label.h: * bytecompiler/LabelScope.h: * bytecompiler/RegisterID.h: * debugger/DebuggerCallFrame.cpp: * debugger/DebuggerCallFrame.h: * dfg/DFGDesiredStructureChains.cpp: * dfg/DFGDesiredStructureChains.h: * heap/GCActivityCallback.cpp: * heap/GCActivityCallback.h: * inspector/ConsoleMessage.cpp: * inspector/ConsoleMessage.h: * inspector/IdentifiersFactory.cpp: * inspector/IdentifiersFactory.h: * inspector/InjectedScriptManager.cpp: * inspector/InjectedScriptManager.h: * inspector/InjectedScriptSource.js: * inspector/ScriptBreakpoint.h: * inspector/ScriptDebugListener.h: * inspector/ScriptDebugServer.cpp: * inspector/ScriptDebugServer.h: * inspector/agents/InspectorAgent.cpp: * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: * inspector/agents/InspectorDebuggerAgent.h: * interpreter/Interpreter.cpp: * interpreter/Interpreter.h: * interpreter/JSStack.cpp: * interpreter/JSStack.h: * interpreter/Register.h: * jit/CompactJITCodeMap.h: * jit/JITStubs.cpp: * jit/JITStubs.h: * jit/JITStubsARM.h: * jit/JITStubsARMv7.h: * jit/JITStubsX86.h: * jit/JITStubsX86_64.h: * os-win32/stdbool.h: * parser/SourceCode.h: * parser/SourceProvider.h: * profiler/LegacyProfiler.cpp: * profiler/LegacyProfiler.h: * profiler/ProfileNode.cpp: * profiler/ProfileNode.h: * runtime/ArrayBufferView.cpp: * runtime/ArrayBufferView.h: * runtime/BatchedTransitionOptimizer.h: * runtime/CallData.h: * runtime/ConstructData.h: * runtime/DumpContext.cpp: * runtime/DumpContext.h: * runtime/ExceptionHelpers.cpp: * runtime/ExceptionHelpers.h: * runtime/InitializeThreading.cpp: * runtime/InitializeThreading.h: * runtime/IntegralTypedArrayBase.h: * runtime/IntendedStructureChain.cpp: * runtime/IntendedStructureChain.h: * runtime/JSActivation.cpp: * runtime/JSActivation.h: * runtime/JSExportMacros.h: * runtime/JSGlobalObject.cpp: * runtime/JSNotAnObject.cpp: * runtime/JSNotAnObject.h: * runtime/JSPropertyNameIterator.cpp: * runtime/JSPropertyNameIterator.h: * runtime/JSSegmentedVariableObject.cpp: * runtime/JSSegmentedVariableObject.h: * runtime/JSSymbolTableObject.cpp: * runtime/JSSymbolTableObject.h: * runtime/JSTypeInfo.h: * runtime/JSVariableObject.cpp: * runtime/JSVariableObject.h: * runtime/PropertyTable.cpp: * runtime/PutPropertySlot.h: * runtime/SamplingCounter.cpp: * runtime/SamplingCounter.h: * runtime/Structure.cpp: * runtime/Structure.h: * runtime/StructureChain.cpp: * runtime/StructureChain.h: * runtime/StructureInlines.h: * runtime/StructureTransitionTable.h: * runtime/SymbolTable.cpp: * runtime/SymbolTable.h: * runtime/TypedArrayBase.h: * runtime/TypedArrayType.cpp: * runtime/TypedArrayType.h: * runtime/VM.cpp: * runtime/VM.h: * yarr/RegularExpression.cpp: * yarr/RegularExpression.h: Source/WebCore: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. No new tests because no behavior changes. * DerivedSources.make: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.cpp: * Modules/encryptedmedia/MediaKeyMessageEvent.h: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeyNeededEvent.cpp: * Modules/encryptedmedia/MediaKeyNeededEvent.h: * Modules/encryptedmedia/MediaKeyNeededEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/geolocation/NavigatorGeolocation.cpp: * Modules/indexeddb/DOMWindowIndexedDatabase.idl: * Modules/indexeddb/IDBCallbacks.h: * Modules/indexeddb/IDBDatabaseException.cpp: * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBEventDispatcher.cpp: * Modules/indexeddb/IDBEventDispatcher.h: * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/IDBFactory.h: * Modules/indexeddb/IDBFactoryBackendInterface.cpp: * Modules/indexeddb/IDBFactoryBackendInterface.h: * Modules/indexeddb/IDBHistograms.h: * Modules/indexeddb/IDBIndexMetadata.h: * Modules/indexeddb/IDBObjectStoreMetadata.h: * Modules/indexeddb/IDBRecordIdentifier.h: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBRequest.idl: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp: * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h: * Modules/mediacontrols/MediaControlsHost.cpp: * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediacontrols/mediaControlsApple.css: * Modules/mediacontrols/mediaControlsiOS.css: * Modules/mediasource/AudioTrackMediaSource.h: * Modules/mediasource/AudioTrackMediaSource.idl: * Modules/mediasource/TextTrackMediaSource.h: * Modules/mediasource/TextTrackMediaSource.idl: * Modules/mediasource/VideoTrackMediaSource.h: * Modules/mediasource/VideoTrackMediaSource.idl: * Modules/mediastream/AllAudioCapabilities.h: * Modules/mediastream/AllAudioCapabilities.idl: * Modules/mediastream/AllVideoCapabilities.h: * Modules/mediastream/AllVideoCapabilities.idl: * Modules/mediastream/AudioStreamTrack.cpp: * Modules/mediastream/AudioStreamTrack.h: * Modules/mediastream/AudioStreamTrack.idl: * Modules/mediastream/CapabilityRange.cpp: * Modules/mediastream/CapabilityRange.h: * Modules/mediastream/CapabilityRange.idl: * Modules/mediastream/MediaSourceStates.cpp: * Modules/mediastream/MediaSourceStates.h: * Modules/mediastream/MediaSourceStates.idl: * Modules/mediastream/MediaStreamCapabilities.cpp: * Modules/mediastream/MediaStreamCapabilities.h: * Modules/mediastream/MediaStreamCapabilities.idl: * Modules/mediastream/MediaTrackConstraint.cpp: * Modules/mediastream/MediaTrackConstraint.h: * Modules/mediastream/MediaTrackConstraint.idl: * Modules/mediastream/MediaTrackConstraintSet.cpp: * Modules/mediastream/MediaTrackConstraintSet.h: * Modules/mediastream/MediaTrackConstraints.cpp: * Modules/mediastream/MediaTrackConstraints.h: * Modules/mediastream/MediaTrackConstraints.idl: * Modules/mediastream/NavigatorMediaStream.cpp: * Modules/mediastream/NavigatorUserMediaError.cpp: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCIceServer.idl: * Modules/mediastream/RTCOfferAnswerOptions.cpp: * Modules/mediastream/RTCOfferAnswerOptions.h: * Modules/mediastream/VideoStreamTrack.cpp: * Modules/mediastream/VideoStreamTrack.h: * Modules/mediastream/VideoStreamTrack.idl: * Modules/networkinfo/NetworkInfo.cpp: * Modules/networkinfo/NetworkInfo.h: * Modules/networkinfo/NetworkInfoConnection.cpp: * Modules/networkinfo/NetworkInfoConnection.h: * Modules/networkinfo/NetworkInfoController.cpp: * Modules/notifications/DOMWindowNotifications.cpp: * Modules/notifications/DOMWindowNotifications.h: * Modules/notifications/DOMWindowNotifications.idl: * Modules/notifications/NotificationController.cpp: * Modules/notifications/NotificationController.h: * Modules/notifications/NotificationPermissionCallback.h: * Modules/notifications/NotificationPermissionCallback.idl: * Modules/notifications/WorkerGlobalScopeNotifications.cpp: * Modules/notifications/WorkerGlobalScopeNotifications.h: * Modules/notifications/WorkerGlobalScopeNotifications.idl: * Modules/plugins/PluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.cpp: * Modules/plugins/QuickTimePluginReplacement.css: * Modules/plugins/QuickTimePluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/DOMWindowQuota.idl: * Modules/speech/DOMWindowSpeechSynthesis.h: * Modules/speech/DOMWindowSpeechSynthesis.idl: * Modules/speech/SpeechSynthesis.cpp: * Modules/speech/SpeechSynthesis.h: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisEvent.cpp: * Modules/speech/SpeechSynthesisEvent.h: * Modules/speech/SpeechSynthesisEvent.idl: * Modules/speech/SpeechSynthesisUtterance.cpp: * Modules/speech/SpeechSynthesisUtterance.h: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/speech/SpeechSynthesisVoice.cpp: * Modules/speech/SpeechSynthesisVoice.h: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/webaudio/AudioBuffer.cpp: * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioListener.cpp: * Modules/webaudio/AudioListener.h: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/ChannelMergerNode.cpp: * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/MediaStreamAudioSource.cpp: * Modules/webaudio/MediaStreamAudioSource.h: * Modules/webaudio/PeriodicWave.cpp: * Modules/webaudio/PeriodicWave.h: * Modules/webdatabase/ChangeVersionWrapper.cpp: * Modules/webdatabase/ChangeVersionWrapper.h: * Modules/webdatabase/DOMWindowWebDatabase.cpp: * Modules/webdatabase/DOMWindowWebDatabase.h: * Modules/webdatabase/DOMWindowWebDatabase.idl: * Modules/webdatabase/Database.cpp: * Modules/webdatabase/Database.h: * Modules/webdatabase/Database.idl: * Modules/webdatabase/DatabaseAuthorizer.cpp: * Modules/webdatabase/DatabaseAuthorizer.h: * Modules/webdatabase/DatabaseBackendBase.cpp: * Modules/webdatabase/DatabaseBackendBase.h: * Modules/webdatabase/DatabaseCallback.idl: * Modules/webdatabase/DatabaseContext.cpp: * Modules/webdatabase/DatabaseContext.h: * Modules/webdatabase/DatabaseDetails.h: * Modules/webdatabase/DatabaseTask.cpp: * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/DatabaseTracker.cpp: * Modules/webdatabase/DatabaseTracker.h: * Modules/webdatabase/SQLCallbackWrapper.h: * Modules/webdatabase/SQLError.h: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLException.cpp: * Modules/webdatabase/SQLResultSet.cpp: * Modules/webdatabase/SQLResultSet.h: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.cpp: * Modules/webdatabase/SQLResultSetRowList.h: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLStatement.cpp: * Modules/webdatabase/SQLStatement.h: * Modules/webdatabase/SQLStatementBackend.cpp: * Modules/webdatabase/SQLStatementBackend.h: * Modules/webdatabase/SQLStatementCallback.h: * Modules/webdatabase/SQLStatementCallback.idl: * Modules/webdatabase/SQLStatementErrorCallback.h: * Modules/webdatabase/SQLStatementErrorCallback.idl: * Modules/webdatabase/SQLStatementSync.cpp: * Modules/webdatabase/SQLTransaction.cpp: * Modules/webdatabase/SQLTransaction.h: * Modules/webdatabase/SQLTransaction.idl: * Modules/webdatabase/SQLTransactionBackend.cpp: * Modules/webdatabase/SQLTransactionBackend.h: * Modules/webdatabase/SQLTransactionCallback.h: * Modules/webdatabase/SQLTransactionCallback.idl: * Modules/webdatabase/SQLTransactionErrorCallback.h: * Modules/webdatabase/SQLTransactionErrorCallback.idl: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.h: * Modules/webdatabase/WorkerGlobalScopeWebDatabase.idl: * Resources/deleteButton.tiff: * Resources/deleteButtonPressed.tiff: * WebCore.vcxproj/MigrateScripts: * WebCorePrefix.cpp: * accessibility/AXObjectCache.cpp: * accessibility/AXObjectCache.h: * accessibility/AccessibilityARIAGrid.cpp: * accessibility/AccessibilityARIAGrid.h: * accessibility/AccessibilityARIAGridCell.cpp: * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibilityARIAGridRow.cpp: * accessibility/AccessibilityARIAGridRow.h: * accessibility/AccessibilityImageMapLink.cpp: * accessibility/AccessibilityImageMapLink.h: * accessibility/AccessibilityList.cpp: * accessibility/AccessibilityList.h: * accessibility/AccessibilityListBox.cpp: * accessibility/AccessibilityListBox.h: * accessibility/AccessibilityListBoxOption.cpp: * accessibility/AccessibilityListBoxOption.h: * accessibility/AccessibilityMediaControls.cpp: * accessibility/AccessibilityMediaControls.h: * accessibility/AccessibilityNodeObject.cpp: * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilitySVGRoot.cpp: * accessibility/AccessibilitySVGRoot.h: * accessibility/AccessibilityScrollbar.cpp: * accessibility/AccessibilityScrollbar.h: * accessibility/AccessibilitySlider.cpp: * accessibility/AccessibilitySlider.h: * accessibility/AccessibilityTable.cpp: * accessibility/AccessibilityTable.h: * accessibility/AccessibilityTableCell.cpp: * accessibility/AccessibilityTableCell.h: * accessibility/AccessibilityTableColumn.cpp: * accessibility/AccessibilityTableColumn.h: * accessibility/AccessibilityTableHeaderContainer.cpp: * accessibility/AccessibilityTableHeaderContainer.h: * accessibility/AccessibilityTableRow.cpp: * accessibility/AccessibilityTableRow.h: * accessibility/ios/AXObjectCacheIOS.mm: * accessibility/ios/AccessibilityObjectIOS.mm: * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: * accessibility/mac/AXObjectCacheMac.mm: * accessibility/mac/AccessibilityObjectMac.mm: * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/gobject/WebKitDOMEventTarget.cpp: * bindings/gobject/WebKitDOMHTMLPrivate.cpp: * bindings/gobject/WebKitDOMHTMLPrivate.h: * bindings/js/Dictionary.cpp: * bindings/js/GCController.cpp: * bindings/js/GCController.h: * bindings/js/JSAttrCustom.cpp: * bindings/js/JSAudioTrackCustom.cpp: * bindings/js/JSAudioTrackListCustom.cpp: * bindings/js/JSCSSRuleCustom.cpp: * bindings/js/JSCSSRuleCustom.h: * bindings/js/JSCSSRuleListCustom.cpp: * bindings/js/JSCSSStyleDeclarationCustom.cpp: * bindings/js/JSCSSValueCustom.cpp: * bindings/js/JSCallbackData.cpp: * bindings/js/JSCallbackData.h: * bindings/js/JSCanvasRenderingContextCustom.cpp: * bindings/js/JSClipboardCustom.cpp: * bindings/js/JSCustomSQLStatementErrorCallback.cpp: * bindings/js/JSCustomXPathNSResolver.cpp: * bindings/js/JSCustomXPathNSResolver.h: * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowShell.cpp: * bindings/js/JSDOMWindowShell.h: * bindings/js/JSElementCustom.cpp: * bindings/js/JSEventCustom.cpp: * bindings/js/JSHTMLAppletElementCustom.cpp: * bindings/js/JSHTMLCanvasElementCustom.cpp: * bindings/js/JSHTMLDocumentCustom.cpp: * bindings/js/JSHTMLElementCustom.cpp: * bindings/js/JSHTMLEmbedElementCustom.cpp: * bindings/js/JSHTMLFormElementCustom.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: * bindings/js/JSHTMLFrameSetElementCustom.cpp: * bindings/js/JSHTMLObjectElementCustom.cpp: * bindings/js/JSHTMLSelectElementCustom.h: * bindings/js/JSHistoryCustom.cpp: * bindings/js/JSMediaListCustom.h: * bindings/js/JSMediaSourceStatesCustom.cpp: * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: * bindings/js/JSNamedNodeMapCustom.cpp: * bindings/js/JSNodeCustom.cpp: * bindings/js/JSNodeCustom.h: * bindings/js/JSNodeFilterCustom.cpp: * bindings/js/JSNodeListCustom.cpp: * bindings/js/JSSQLResultSetRowListCustom.cpp: * bindings/js/JSSQLTransactionCustom.cpp: * bindings/js/JSSQLTransactionSyncCustom.cpp: * bindings/js/JSSVGElementInstanceCustom.cpp: * bindings/js/JSStyleSheetCustom.cpp: * bindings/js/JSStyleSheetCustom.h: * bindings/js/JSStyleSheetListCustom.cpp: * bindings/js/JSTextTrackCueCustom.cpp: * bindings/js/JSTextTrackCustom.cpp: * bindings/js/JSTextTrackListCustom.cpp: * bindings/js/JSTouchCustom.cpp: * bindings/js/JSTouchListCustom.cpp: * bindings/js/JSTrackCustom.cpp: * bindings/js/JSTrackCustom.h: * bindings/js/JSTrackEventCustom.cpp: * bindings/js/JSVideoTrackCustom.cpp: * bindings/js/JSVideoTrackListCustom.cpp: * bindings/js/JSWebGLRenderingContextCustom.cpp: * bindings/js/JSWebKitPointCustom.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.h: * bindings/js/JSXMLHttpRequestCustom.cpp: * bindings/js/JSXSLTProcessorCustom.cpp: * bindings/js/ScriptControllerMac.mm: * bindings/js/ScriptProfile.cpp: * bindings/js/ScriptProfile.h: * bindings/js/ScriptProfileNode.h: * bindings/js/ScriptProfiler.cpp: * bindings/js/ScriptProfiler.h: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * bindings/js/WorkerScriptController.cpp: * bindings/js/WorkerScriptController.h: * bindings/objc/DOM.h: * bindings/objc/DOM.mm: * bindings/objc/DOMAbstractView.mm: * bindings/objc/DOMAbstractViewFrame.h: * bindings/objc/DOMCSS.h: * bindings/objc/DOMCSS.mm: * bindings/objc/DOMCore.h: * bindings/objc/DOMCustomXPathNSResolver.h: * bindings/objc/DOMCustomXPathNSResolver.mm: * bindings/objc/DOMEventException.h: * bindings/objc/DOMEvents.h: * bindings/objc/DOMEvents.mm: * bindings/objc/DOMException.h: * bindings/objc/DOMExtensions.h: * bindings/objc/DOMHTML.h: * bindings/objc/DOMHTML.mm: * bindings/objc/DOMInternal.h: * bindings/objc/DOMInternal.mm: * bindings/objc/DOMObject.h: * bindings/objc/DOMObject.mm: * bindings/objc/DOMPrivate.h: * bindings/objc/DOMRangeException.h: * bindings/objc/DOMRanges.h: * bindings/objc/DOMStylesheets.h: * bindings/objc/DOMTraversal.h: * bindings/objc/DOMUIKitExtensions.h: * bindings/objc/DOMUIKitExtensions.mm: * bindings/objc/DOMUtility.mm: * bindings/objc/DOMViews.h: * bindings/objc/DOMXPath.h: * bindings/objc/DOMXPath.mm: * bindings/objc/DOMXPathException.h: * bindings/objc/ExceptionHandlers.h: * bindings/objc/ExceptionHandlers.mm: * bindings/objc/ObjCEventListener.h: * bindings/objc/ObjCEventListener.mm: * bindings/objc/ObjCNodeFilterCondition.h: * bindings/objc/ObjCNodeFilterCondition.mm: * bindings/objc/PublicDOMInterfaces.h: * bindings/objc/WebScriptObject.mm: * bindings/scripts/CodeGeneratorObjC.pm: * bindings/scripts/InFilesCompiler.pm: (license): * bindings/scripts/InFilesParser.pm: * bindings/scripts/generate-bindings.pl: * bindings/scripts/test/ObjC/DOMFloat64Array.h: * bindings/scripts/test/ObjC/DOMFloat64Array.mm: * bindings/scripts/test/ObjC/DOMFloat64ArrayInternal.h: * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h: * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: * bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h: * bindings/scripts/test/ObjC/DOMTestCallback.h: * bindings/scripts/test/ObjC/DOMTestCallback.mm: * bindings/scripts/test/ObjC/DOMTestCallbackInternal.h: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: * bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: * bindings/scripts/test/ObjC/DOMTestEventConstructor.h: * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm: * bindings/scripts/test/ObjC/DOMTestEventConstructorInternal.h: * bindings/scripts/test/ObjC/DOMTestEventTarget.h: * bindings/scripts/test/ObjC/DOMTestEventTarget.mm: * bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h: * bindings/scripts/test/ObjC/DOMTestException.h: * bindings/scripts/test/ObjC/DOMTestException.mm: * bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm: * bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h: * bindings/scripts/test/ObjC/DOMTestInterface.h: * bindings/scripts/test/ObjC/DOMTestInterface.mm: * bindings/scripts/test/ObjC/DOMTestInterfaceInternal.h: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h: * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm: * bindings/scripts/test/ObjC/DOMTestNamedConstructorInternal.h: * bindings/scripts/test/ObjC/DOMTestNode.h: * bindings/scripts/test/ObjC/DOMTestNode.mm: * bindings/scripts/test/ObjC/DOMTestNodeInternal.h: * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: * bindings/scripts/test/ObjC/DOMTestObjInternal.h: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm: * bindings/scripts/test/ObjC/DOMTestOverloadedConstructorsInternal.h: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: * bindings/scripts/test/ObjC/DOMTestTypedefs.h: * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: * bindings/scripts/test/ObjC/DOMattribute.h: * bindings/scripts/test/ObjC/DOMattribute.mm: * bindings/scripts/test/ObjC/DOMattributeInternal.h: * bindings/scripts/test/ObjC/DOMreadonly.h: * bindings/scripts/test/ObjC/DOMreadonly.mm: * bindings/scripts/test/ObjC/DOMreadonlyInternal.h: * bindings/scripts/test/TestCallback.idl: * bindings/scripts/test/TestCustomNamedGetter.idl: * bindings/scripts/test/TestDomainSecurity.idl: * bindings/scripts/test/TestEventConstructor.idl: * bindings/scripts/test/TestEventTarget.idl: * bindings/scripts/test/TestException.idl: * bindings/scripts/test/TestImplements.idl: * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestMediaQueryListListener.idl: * bindings/scripts/test/TestNamedConstructor.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOverloadedConstructors.idl: * bindings/scripts/test/TestSupplemental.idl: * bridge/Bridge.h: * bridge/IdentifierRep.cpp: * bridge/IdentifierRep.h: * bridge/NP_jsobject.cpp: * bridge/NP_jsobject.h: * bridge/c/CRuntimeObject.cpp: * bridge/c/CRuntimeObject.h: * bridge/c/c_class.cpp: * bridge/c/c_class.h: * bridge/c/c_instance.cpp: * bridge/c/c_instance.h: * bridge/c/c_runtime.cpp: * bridge/c/c_runtime.h: * bridge/c/c_utility.cpp: * bridge/c/c_utility.h: * bridge/jsc/BridgeJSC.cpp: * bridge/jsc/BridgeJSC.h: * bridge/npruntime.cpp: * bridge/npruntime_impl.h: * bridge/npruntime_priv.h: * bridge/objc/ObjCRuntimeObject.h: * bridge/objc/ObjCRuntimeObject.mm: * bridge/objc/WebScriptObject.h: * bridge/objc/objc_class.h: * bridge/objc/objc_class.mm: * bridge/objc/objc_header.h: * bridge/objc/objc_instance.h: * bridge/objc/objc_instance.mm: * bridge/objc/objc_runtime.h: * bridge/objc/objc_runtime.mm: * bridge/objc/objc_utility.h: * bridge/objc/objc_utility.mm: * bridge/runtime_array.cpp: * bridge/runtime_array.h: * bridge/runtime_method.cpp: * bridge/runtime_method.h: * bridge/runtime_object.cpp: * bridge/runtime_object.h: * bridge/runtime_root.cpp: * bridge/runtime_root.h: * bridge/testbindings.mm: * css/CSSAllInOne.cpp: * css/CSSAspectRatioValue.cpp: * css/CSSAspectRatioValue.h: * css/CSSBorderImageSliceValue.cpp: * css/CSSBorderImageSliceValue.h: * css/CSSCanvasValue.cpp: * css/CSSCanvasValue.h: * css/CSSCrossfadeValue.cpp: * css/CSSCrossfadeValue.h: * css/CSSFontFace.cpp: * css/CSSFontFace.h: * css/CSSFontFaceSource.cpp: * css/CSSFontFaceSource.h: * css/CSSFontFaceSrcValue.cpp: * css/CSSFontFaceSrcValue.h: * css/CSSFontFeatureValue.cpp: * css/CSSFontFeatureValue.h: * css/CSSFontSelector.cpp: * css/CSSFontSelector.h: * css/CSSFontValue.cpp: * css/CSSGradientValue.cpp: * css/CSSGradientValue.h: * css/CSSImageGeneratorValue.cpp: * css/CSSImageGeneratorValue.h: * css/CSSMediaRule.cpp: * css/CSSProperty.cpp: * css/CSSProperty.h: * css/CSSReflectValue.cpp: * css/CSSReflectValue.h: * css/CSSReflectionDirection.h: * css/CSSRuleList.cpp: * css/CSSRuleList.h: * css/CSSRuleList.idl: * css/CSSSegmentedFontFace.cpp: * css/CSSSegmentedFontFace.h: * css/CSSShadowValue.cpp: * css/CSSTimingFunctionValue.cpp: * css/CSSTimingFunctionValue.h: * css/CSSUnicodeRangeValue.cpp: * css/CSSUnicodeRangeValue.h: * css/CSSUnknownRule.idl: * css/CSSValue.cpp: * css/CSSValueList.idl: * css/MediaAllInOne.cpp: * css/MediaFeatureNames.cpp: * css/MediaList.idl: * css/MediaQuery.cpp: * css/MediaQuery.h: * css/MediaQueryEvaluator.cpp: * css/MediaQueryEvaluator.h: * css/MediaQueryExp.cpp: * css/MediaQueryExp.h: * css/Pair.h: * css/PropertySetCSSStyleDeclaration.h: * css/RGBColor.cpp: * css/RGBColor.h: * css/SVGCSSParser.cpp: * css/SVGCSSStyleSelector.cpp: * css/StyleInvalidationAnalysis.cpp: * css/StyleInvalidationAnalysis.h: * css/StyleMedia.cpp: * css/StyleMedia.h: * css/StyleMedia.idl: * css/StyleSheet.cpp: * css/WebKitCSSFilterValue.cpp: * css/WebKitCSSFilterValue.h: * css/WebKitCSSFilterValue.idl: * css/WebKitCSSKeyframeRule.cpp: * css/WebKitCSSKeyframeRule.h: * css/WebKitCSSKeyframeRule.idl: * css/WebKitCSSKeyframesRule.cpp: * css/WebKitCSSKeyframesRule.h: * css/WebKitCSSKeyframesRule.idl: * css/WebKitCSSTransformValue.cpp: * css/WebKitCSSTransformValue.h: * css/WebKitCSSTransformValue.idl: * css/make-css-file-arrays.pl: * css/mediaControls.css: * css/mediaControlsEfl.css: * css/mediaControlsEflFullscreen.css: * css/mediaControlsGtk.css: * css/mediaControlsiOS.css: * css/svg.css: * dom/ActiveDOMObject.cpp: * dom/ActiveDOMObject.h: * dom/BeforeLoadEvent.h: * dom/BeforeLoadEvent.idl: * dom/BeforeTextInsertedEvent.cpp: * dom/BeforeTextInsertedEvent.h: * dom/BeforeUnloadEvent.cpp: * dom/BeforeUnloadEvent.h: * dom/BeforeUnloadEvent.idl: * dom/ClassNodeList.cpp: * dom/ClassNodeList.h: * dom/ClientRect.cpp: * dom/ClientRect.h: * dom/ClientRect.idl: * dom/ClientRectList.cpp: * dom/ClientRectList.h: * dom/ClientRectList.idl: * dom/Clipboard.cpp: * dom/Clipboard.idl: * dom/ClipboardAccessPolicy.h: * dom/ClipboardMac.mm: * dom/CompositionEvent.cpp: * dom/CompositionEvent.h: * dom/CompositionEvent.idl: * dom/ContextDestructionObserver.cpp: * dom/ContextDestructionObserver.h: * dom/CurrentScriptIncrementer.h: * dom/CustomEvent.cpp: * dom/CustomEvent.h: * dom/CustomEvent.idl: * dom/DOMCoreException.cpp: * dom/DOMCoreException.h: * dom/DOMCoreException.idl: * dom/DOMError.idl: * dom/DeviceMotionEvent.cpp: * dom/DeviceMotionEvent.h: * dom/DeviceMotionEvent.idl: * dom/DocumentEventQueue.cpp: * dom/DocumentEventQueue.h: * dom/DocumentMarker.h: * dom/DocumentParser.h: * dom/DocumentSharedObjectPool.cpp: * dom/DocumentSharedObjectPool.h: * dom/Entity.idl: * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventException.cpp: * dom/EventException.h: * dom/EventException.idl: * dom/EventListener.idl: * dom/EventListenerMap.cpp: * dom/EventListenerMap.h: * dom/EventNames.cpp: * dom/EventQueue.h: * dom/EventTarget.cpp: * dom/EventTarget.h: * dom/ExceptionBase.cpp: * dom/ExceptionBase.h: * dom/GenericEventQueue.cpp: * dom/GenericEventQueue.h: * dom/KeyboardEvent.idl: * dom/MessageChannel.cpp: * dom/MessageChannel.h: * dom/MessageChannel.idl: * dom/MessageEvent.cpp: * dom/MessageEvent.h: * dom/MessageEvent.idl: * dom/MessagePort.cpp: * dom/MessagePort.h: * dom/MessagePort.idl: * dom/MouseRelatedEvent.h: * dom/MutationEvent.idl: * dom/Notation.idl: * dom/OverflowEvent.cpp: * dom/OverflowEvent.h: * dom/OverflowEvent.idl: * dom/PopStateEvent.cpp: * dom/PopStateEvent.h: * dom/PopStateEvent.idl: * dom/Position.cpp: * dom/Position.h: * dom/ProcessingInstruction.idl: * dom/ProgressEvent.cpp: * dom/ProgressEvent.h: * dom/ProgressEvent.idl: * dom/Range.idl: * dom/RangeException.cpp: * dom/RangeException.h: * dom/ScriptExecutionContext.cpp: * dom/ScriptExecutionContext.h: * dom/SecurityContext.cpp: * dom/SecurityContext.h: * dom/StaticNodeList.cpp: * dom/StaticNodeList.h: * dom/Text.idl: * dom/TextEvent.cpp: * dom/TextEvent.h: * dom/TextEvent.idl: * dom/Touch.cpp: * dom/Touch.h: * dom/Touch.idl: * dom/TouchEvent.cpp: * dom/TouchEvent.h: * dom/TouchEvent.idl: * dom/TouchList.cpp: * dom/TouchList.h: * dom/TouchList.idl: * dom/TransitionEvent.cpp: * dom/TransitionEvent.h: * dom/TransitionEvent.idl: * dom/TreeWalker.idl: * dom/UIEvent.idl: * dom/UIEventWithKeyState.cpp: * dom/WebKitAnimationEvent.cpp: * dom/WebKitAnimationEvent.h: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.cpp: * dom/WebKitTransitionEvent.h: * dom/WebKitTransitionEvent.idl: * dom/make_dom_exceptions.pl: * dom/make_event_factory.pl: * dom/make_names.pl: (printLicenseHeader): * editing/AlternativeTextController.cpp: * editing/AlternativeTextController.h: * editing/AppendNodeCommand.cpp: * editing/AppendNodeCommand.h: * editing/ApplyStyleCommand.cpp: * editing/ApplyStyleCommand.h: * editing/BreakBlockquoteCommand.cpp: * editing/BreakBlockquoteCommand.h: * editing/CompositeEditCommand.cpp: * editing/CompositeEditCommand.h: * editing/CreateLinkCommand.cpp: * editing/CreateLinkCommand.h: * editing/DeleteButton.cpp: * editing/DeleteButton.h: * editing/DeleteButtonController.cpp: * editing/DeleteButtonController.h: * editing/DeleteFromTextNodeCommand.cpp: * editing/DeleteFromTextNodeCommand.h: * editing/DeleteSelectionCommand.cpp: * editing/DeleteSelectionCommand.h: * editing/EditAction.h: * editing/EditCommand.cpp: * editing/EditCommand.h: * editing/EditingBoundary.h: * editing/EditingStyle.cpp: * editing/Editor.cpp: * editing/Editor.h: * editing/EditorCommand.cpp: * editing/EditorDeleteAction.h: * editing/EditorInsertAction.h: * editing/FormatBlockCommand.cpp: * editing/FormatBlockCommand.h: * editing/FrameSelection.cpp: * editing/FrameSelection.h: * editing/HTMLInterchange.cpp: * editing/HTMLInterchange.h: * editing/IndentOutdentCommand.cpp: * editing/IndentOutdentCommand.h: * editing/InsertIntoTextNodeCommand.cpp: * editing/InsertIntoTextNodeCommand.h: * editing/InsertLineBreakCommand.cpp: * editing/InsertLineBreakCommand.h: * editing/InsertListCommand.cpp: * editing/InsertListCommand.h: * editing/InsertNodeBeforeCommand.cpp: * editing/InsertNodeBeforeCommand.h: * editing/InsertParagraphSeparatorCommand.cpp: * editing/InsertParagraphSeparatorCommand.h: * editing/InsertTextCommand.cpp: * editing/InsertTextCommand.h: * editing/MarkupAccumulator.h: * editing/MergeIdenticalElementsCommand.cpp: * editing/MergeIdenticalElementsCommand.h: * editing/ModifySelectionListLevel.cpp: * editing/ModifySelectionListLevel.h: * editing/MoveSelectionCommand.cpp: * editing/MoveSelectionCommand.h: * editing/RemoveCSSPropertyCommand.cpp: * editing/RemoveCSSPropertyCommand.h: * editing/RemoveFormatCommand.cpp: * editing/RemoveFormatCommand.h: * editing/RemoveNodeCommand.cpp: * editing/RemoveNodeCommand.h: * editing/RemoveNodePreservingChildrenCommand.cpp: * editing/RemoveNodePreservingChildrenCommand.h: * editing/ReplaceSelectionCommand.cpp: * editing/ReplaceSelectionCommand.h: * editing/SetNodeAttributeCommand.cpp: * editing/SetNodeAttributeCommand.h: * editing/SetSelectionCommand.cpp: * editing/SetSelectionCommand.h: * editing/SimplifyMarkupCommand.cpp: * editing/SimplifyMarkupCommand.h: * editing/SmartReplace.cpp: * editing/SmartReplace.h: * editing/SmartReplaceCF.cpp: * editing/SpellChecker.cpp: * editing/SpellChecker.h: * editing/SpellingCorrectionCommand.cpp: * editing/SpellingCorrectionCommand.h: * editing/SplitElementCommand.cpp: * editing/SplitElementCommand.h: * editing/SplitTextNodeCommand.cpp: * editing/SplitTextNodeCommand.h: * editing/SplitTextNodeContainingElementCommand.cpp: * editing/SplitTextNodeContainingElementCommand.h: * editing/TextAffinity.h: * editing/TextCheckingHelper.cpp: * editing/TextGranularity.h: * editing/TextIterator.cpp: * editing/TextIterator.h: * editing/TextIteratorBehavior.h: * editing/TypingCommand.cpp: * editing/TypingCommand.h: * editing/UnlinkCommand.cpp: * editing/UnlinkCommand.h: * editing/VisiblePosition.cpp: * editing/VisiblePosition.h: * editing/VisibleSelection.cpp: * editing/VisibleSelection.h: * editing/VisibleUnits.cpp: * editing/VisibleUnits.h: * editing/WrapContentsInDummySpanCommand.cpp: * editing/WrapContentsInDummySpanCommand.h: * editing/WritingDirection.h: * editing/efl/EditorEfl.cpp: * editing/htmlediting.cpp: * editing/htmlediting.h: * editing/mac/EditorMac.mm: * editing/mac/FrameSelectionMac.mm: * editing/markup.cpp: * editing/markup.h: * extract-localizable-strings.pl: * fileapi/FileException.cpp: * history/BackForwardClient.h: * history/BackForwardList.cpp: * history/BackForwardList.h: * history/CachedFrame.cpp: * history/CachedFrame.h: * history/CachedFramePlatformData.h: * history/CachedPage.cpp: * history/CachedPage.h: * history/HistoryItem.cpp: * history/HistoryItem.h: * history/PageCache.cpp: * history/PageCache.h: * history/mac/HistoryItemMac.mm: * html/FTPDirectoryDocument.cpp: * html/FTPDirectoryDocument.h: * html/HTMLAudioElement.cpp: * html/HTMLAudioElement.h: * html/HTMLAudioElement.idl: * html/HTMLCanvasElement.cpp: * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLImageLoader.h: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * html/HTMLMediaElement.idl: * html/HTMLOptionsCollection.cpp: * html/HTMLPlugInElement.cpp: * html/HTMLSourceElement.cpp: * html/HTMLSourceElement.h: * html/HTMLSourceElement.idl: * html/HTMLTablePartElement.cpp: * html/HTMLTableRowsCollection.cpp: * html/HTMLTableRowsCollection.h: * html/HTMLTitleElement.idl: * html/HTMLTrackElement.cpp: * html/HTMLTrackElement.h: * html/HTMLTrackElement.idl: * html/HTMLVideoElement.cpp: * html/HTMLVideoElement.h: * html/HTMLVideoElement.idl: * html/ImageData.cpp: * html/ImageData.h: * html/ImageData.idl: * html/ImageDocument.cpp: * html/ImageDocument.h: * html/MediaController.cpp: * html/MediaController.h: * html/MediaController.idl: * html/MediaControllerInterface.h: * html/MediaError.h: * html/MediaError.idl: * html/MediaFragmentURIParser.cpp: * html/MediaFragmentURIParser.h: * html/MediaKeyError.h: * html/MediaKeyError.idl: * html/MediaKeyEvent.cpp: * html/MediaKeyEvent.h: * html/MediaKeyEvent.idl: * html/PluginDocument.cpp: * html/PluginDocument.h: * html/TextDocument.cpp: * html/TextDocument.h: * html/TimeRanges.cpp: * html/TimeRanges.h: * html/TimeRanges.idl: * html/VoidCallback.h: * html/VoidCallback.idl: * html/canvas/CanvasGradient.cpp: * html/canvas/CanvasGradient.h: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasPattern.cpp: * html/canvas/CanvasPattern.h: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasRenderingContext.cpp: * html/canvas/CanvasRenderingContext.h: * html/canvas/CanvasRenderingContext.idl: * html/canvas/CanvasRenderingContext2D.cpp: * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasStyle.cpp: * html/canvas/CanvasStyle.h: * html/canvas/DOMPath.idl: * html/canvas/OESVertexArrayObject.cpp: * html/canvas/OESVertexArrayObject.h: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLBuffer.cpp: * html/canvas/WebGLBuffer.h: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextGroup.cpp: * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: * html/canvas/WebGLContextObject.h: * html/canvas/WebGLFramebuffer.cpp: * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLObject.cpp: * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: * html/canvas/WebGLProgram.h: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLRenderbuffer.cpp: * html/canvas/WebGLRenderbuffer.h: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLRenderingContext.cpp: * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContext.idl: * html/canvas/WebGLShader.cpp: * html/canvas/WebGLShader.h: * html/canvas/WebGLShader.idl: * html/canvas/WebGLSharedObject.cpp: * html/canvas/WebGLSharedObject.h: * html/canvas/WebGLTexture.cpp: * html/canvas/WebGLTexture.h: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLUniformLocation.cpp: * html/canvas/WebGLUniformLocation.h: * html/canvas/WebGLUniformLocation.idl: * html/canvas/WebGLVertexArrayObjectOES.cpp: * html/canvas/WebGLVertexArrayObjectOES.h: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/forms/FileIconLoader.cpp: * html/forms/FileIconLoader.h: * html/parser/TextDocumentParser.cpp: * html/parser/TextDocumentParser.h: * html/shadow/MediaControlElementTypes.cpp: * html/shadow/MediaControlElementTypes.h: * html/shadow/MediaControlElements.cpp: * html/shadow/MediaControlElements.h: * html/shadow/MediaControls.cpp: * html/shadow/MediaControls.h: * html/shadow/MediaControlsApple.cpp: * html/shadow/MediaControlsApple.h: * html/shadow/MediaControlsGtk.cpp: * html/shadow/MediaControlsGtk.h: * html/shadow/SpinButtonElement.cpp: * html/shadow/SpinButtonElement.h: * html/shadow/TextControlInnerElements.cpp: * html/shadow/TextControlInnerElements.h: * html/track/AudioTrack.h: * html/track/AudioTrack.idl: * html/track/AudioTrackList.cpp: * html/track/AudioTrackList.h: * html/track/AudioTrackList.idl: * html/track/DataCue.cpp: * html/track/DataCue.h: * html/track/DataCue.idl: * html/track/InbandGenericTextTrack.cpp: * html/track/InbandGenericTextTrack.h: * html/track/InbandTextTrack.cpp: * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: * html/track/InbandWebVTTTextTrack.h: * html/track/LoadableTextTrack.cpp: * html/track/LoadableTextTrack.h: * html/track/TextTrack.h: * html/track/TextTrack.idl: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.cpp: * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueList.cpp: * html/track/TextTrackCueList.h: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.cpp: * html/track/TextTrackList.h: * html/track/TextTrackList.idl: * html/track/TextTrackRegion.idl: * html/track/TextTrackRegionList.cpp: * html/track/TextTrackRegionList.h: * html/track/TextTrackRegionList.idl: * html/track/TrackBase.cpp: * html/track/TrackBase.h: * html/track/TrackEvent.cpp: * html/track/TrackEvent.h: * html/track/TrackEvent.idl: * html/track/TrackListBase.cpp: * html/track/TrackListBase.h: * html/track/VTTCue.idl: * html/track/VideoTrack.h: * html/track/VideoTrack.idl: * html/track/VideoTrackList.cpp: * html/track/VideoTrackList.h: * html/track/VideoTrackList.idl: * html/track/WebVTTElement.cpp: * html/track/WebVTTElement.h: * inspector/CommandLineAPIHost.cpp: * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIModuleSource.js: * inspector/InspectorAllInOne.cpp: * inspector/InspectorClient.h: * inspector/InspectorDOMAgent.cpp: * inspector/InspectorDOMAgent.h: * inspector/InspectorDOMStorageAgent.cpp: * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: * inspector/InspectorDatabaseAgent.h: * inspector/InspectorDatabaseResource.cpp: * inspector/InspectorDatabaseResource.h: * inspector/InspectorForwarding.h: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorFrontendHost.h: * inspector/InspectorLayerTreeAgent.h: * inspector/InspectorNodeFinder.cpp: * inspector/InspectorNodeFinder.h: * inspector/InspectorOverlay.cpp: * inspector/InspectorOverlay.h: * inspector/InspectorOverlayPage.html: * inspector/InspectorProfilerAgent.cpp: * inspector/InspectorProfilerAgent.h: * inspector/ScriptProfile.idl: * inspector/ScriptProfileNode.idl: * loader/CookieJar.h: * loader/CrossOriginAccessControl.cpp: * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightResultCache.cpp: * loader/CrossOriginPreflightResultCache.h: * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/DocumentWriter.cpp: * loader/EmptyClients.h: * loader/FormState.cpp: * loader/FormState.h: * loader/FrameLoadRequest.h: * loader/FrameLoader.cpp: * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/FrameLoaderTypes.h: * loader/HistoryController.cpp: * loader/HistoryController.h: * loader/MixedContentChecker.cpp: * loader/NavigationAction.cpp: * loader/NavigationAction.h: * loader/NavigationScheduler.cpp: * loader/NavigationScheduler.h: * loader/NetscapePlugInStreamLoader.cpp: * loader/NetscapePlugInStreamLoader.h: * loader/PolicyCallback.cpp: * loader/PolicyCallback.h: * loader/PolicyChecker.cpp: * loader/PolicyChecker.h: * loader/ProgressTracker.cpp: * loader/ProgressTracker.h: * loader/ResourceBuffer.cpp: * loader/ResourceBuffer.h: * loader/ResourceLoadNotifier.cpp: * loader/ResourceLoadNotifier.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/SinkDocument.cpp: * loader/SinkDocument.h: * loader/SubframeLoader.cpp: * loader/SubframeLoader.h: * loader/SubresourceLoader.cpp: * loader/SubresourceLoader.h: * loader/SubstituteData.h: * loader/TextTrackLoader.cpp: * loader/appcache/ApplicationCacheAllInOne.cpp: * loader/archive/Archive.cpp: * loader/archive/Archive.h: * loader/archive/ArchiveFactory.cpp: * loader/archive/ArchiveFactory.h: * loader/archive/ArchiveResource.cpp: * loader/archive/ArchiveResource.h: * loader/archive/ArchiveResourceCollection.cpp: * loader/archive/ArchiveResourceCollection.h: * loader/archive/cf/LegacyWebArchive.cpp: * loader/archive/cf/LegacyWebArchive.h: * loader/archive/cf/LegacyWebArchiveMac.mm: * loader/cache/CachePolicy.h: * loader/cache/CachedCSSStyleSheet.cpp: * loader/cache/CachedFont.cpp: * loader/cache/CachedFont.h: * loader/cache/CachedResourceRequest.cpp: * loader/cache/CachedResourceRequest.h: * loader/cache/CachedResourceRequestInitiators.cpp: * loader/cache/CachedResourceRequestInitiators.h: * loader/cf/ResourceLoaderCFNet.cpp: * loader/icon/IconController.cpp: * loader/icon/IconController.h: * loader/icon/IconDatabase.cpp: * loader/icon/IconDatabase.h: * loader/icon/IconDatabaseBase.cpp: * loader/icon/IconDatabaseBase.h: * loader/icon/IconDatabaseClient.h: * loader/icon/IconLoader.cpp: * loader/icon/IconLoader.h: * loader/icon/IconRecord.cpp: * loader/icon/IconRecord.h: * loader/icon/PageURLRecord.cpp: * loader/icon/PageURLRecord.h: * loader/mac/DocumentLoaderMac.cpp: * loader/mac/LoaderNSURLExtras.h: * loader/mac/LoaderNSURLExtras.mm: * loader/mac/ResourceBuffer.mm: * loader/mac/ResourceLoaderMac.mm: * loader/win/DocumentLoaderWin.cpp: * loader/win/FrameLoaderWin.cpp: * mathml/MathMLAllInOne.cpp: * page/AbstractView.idl: * page/AlternativeTextClient.h: * page/AutoscrollController.cpp: * page/AutoscrollController.h: * page/BarProp.cpp: * page/BarProp.h: * page/BarProp.idl: * page/ContentSecurityPolicy.cpp: * page/ContentSecurityPolicy.h: * page/ContextMenuClient.h: * page/ContextMenuContext.cpp: * page/ContextMenuContext.h: * page/ContextMenuController.cpp: * page/ContextMenuController.h: * page/DOMSecurityPolicy.cpp: * page/DOMSecurityPolicy.h: * page/DOMSelection.cpp: * page/DOMSelection.h: * page/DOMSelection.idl: * page/DOMTimer.cpp: * page/DOMTimer.h: * page/DOMWindow.cpp: * page/DOMWindow.h: * page/DOMWindow.idl: * page/DragActions.h: * page/DragClient.h: * page/DragController.cpp: * page/DragController.h: * page/DragSession.h: * page/DragState.h: * page/EditorClient.h: * page/EventHandler.cpp: * page/EventHandler.h: * page/FocusController.cpp: * page/FocusController.h: * page/FocusDirection.h: * page/FrameTree.h: * page/GestureTapHighlighter.cpp: * page/GestureTapHighlighter.h: * page/History.cpp: * page/History.h: * page/History.idl: * page/Location.cpp: * page/Location.h: * page/Location.idl: * page/MouseEventWithHitTestResults.cpp: * page/MouseEventWithHitTestResults.h: * page/Navigator.cpp: * page/NavigatorBase.cpp: * page/NavigatorBase.h: * page/PageConsole.cpp: * page/PageConsole.h: * page/Screen.cpp: * page/Screen.h: * page/Screen.idl: * page/SecurityOrigin.cpp: * page/SecurityOrigin.h: * page/SecurityOriginHash.h: * page/Settings.cpp: * page/Settings.h: * page/SpatialNavigation.cpp: * page/SuspendableTimer.cpp: * page/SuspendableTimer.h: * page/UserContentTypes.h: * page/UserContentURLPattern.cpp: * page/UserContentURLPattern.h: * page/UserScript.h: * page/UserScriptTypes.h: * page/UserStyleSheet.h: * page/UserStyleSheetTypes.h: * page/WebCoreKeyboardUIMode.h: * page/WebKitPoint.h: * page/WebKitPoint.idl: * page/WindowBase64.idl: * page/WindowFeatures.h: * page/WindowFocusAllowedIndicator.cpp: * page/WindowFocusAllowedIndicator.h: * page/WindowTimers.idl: * page/WorkerNavigator.cpp: * page/WorkerNavigator.h: * page/WorkerNavigator.idl: * page/animation/AnimationBase.cpp: * page/animation/AnimationBase.h: * page/animation/AnimationController.cpp: * page/animation/AnimationController.h: * page/animation/AnimationControllerPrivate.h: * page/animation/CSSPropertyAnimation.cpp: * page/animation/CSSPropertyAnimation.h: * page/animation/CompositeAnimation.cpp: * page/animation/CompositeAnimation.h: * page/animation/ImplicitAnimation.cpp: * page/animation/ImplicitAnimation.h: * page/animation/KeyframeAnimation.cpp: * page/animation/KeyframeAnimation.h: * page/efl/DragControllerEfl.cpp: * page/efl/EventHandlerEfl.cpp: * page/gtk/DragControllerGtk.cpp: * page/gtk/EventHandlerGtk.cpp: * page/ios/EventHandlerIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: * page/mac/PageMac.cpp: * page/mac/WebCoreFrameView.h: * page/make_settings.pl: * page/win/DragControllerWin.cpp: * page/win/EventHandlerWin.cpp: * page/win/FrameCGWin.cpp: * page/win/FrameCairoWin.cpp: * page/win/FrameGdiWin.cpp: * page/win/FrameWin.cpp: * page/win/FrameWin.h: * pdf/ios/PDFDocument.h: * platform/Clock.cpp: * platform/Clock.h: * platform/ClockGeneric.cpp: * platform/ClockGeneric.h: * platform/ColorChooser.h: * platform/ColorChooserClient.h: * platform/ContentType.cpp: * platform/ContentType.h: * platform/ContextMenu.h: * platform/ContextMenuItem.h: * platform/Cookie.h: * platform/Cursor.h: * platform/DragData.cpp: * platform/DragData.h: * platform/DragImage.cpp: * platform/DragImage.h: * platform/FileChooser.cpp: * platform/FileChooser.h: * platform/FileSystem.h: * platform/FloatConversion.h: * platform/KillRing.h: * platform/LinkHash.h: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * platform/Logging.cpp: * platform/Logging.h: * platform/MIMETypeRegistry.cpp: * platform/MIMETypeRegistry.h: * platform/MediaDescription.h: * platform/MediaSample.h: * platform/NotImplemented.h: * platform/PODFreeListArena.h: * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformExportMacros.h: * platform/PlatformKeyboardEvent.h: * platform/PlatformMenuDescription.h: * platform/PlatformMouseEvent.h: * platform/PlatformPasteboard.h: * platform/PlatformScreen.h: * platform/PlatformSpeechSynthesis.h: * platform/PlatformSpeechSynthesisUtterance.cpp: * platform/PlatformSpeechSynthesisUtterance.h: * platform/PlatformSpeechSynthesisVoice.cpp: * platform/PlatformSpeechSynthesisVoice.h: * platform/PlatformSpeechSynthesizer.cpp: * platform/PlatformSpeechSynthesizer.h: * platform/PlatformWheelEvent.h: * platform/PopupMenuClient.h: * platform/RemoteCommandListener.cpp: * platform/RemoteCommandListener.h: * platform/SSLKeyGenerator.h: * platform/SchemeRegistry.cpp: * platform/SchemeRegistry.h: * platform/ScrollTypes.h: * platform/ScrollView.cpp: * platform/ScrollView.h: * platform/Scrollbar.cpp: * platform/Scrollbar.h: * platform/SharedBuffer.cpp: * platform/SharedBuffer.h: * platform/SharedTimer.h: * platform/Sound.h: * platform/ThreadCheck.h: * platform/ThreadGlobalData.cpp: * platform/ThreadGlobalData.h: * platform/ThreadTimers.cpp: * platform/ThreadTimers.h: * platform/Timer.cpp: * platform/Timer.h: * platform/URL.cpp: * platform/URL.h: * platform/Widget.cpp: * platform/Widget.h: * platform/animation/AnimationUtilities.h: * platform/audio/AudioArray.h: * platform/audio/AudioBus.cpp: * platform/audio/AudioBus.h: * platform/audio/AudioChannel.cpp: * platform/audio/AudioChannel.h: * platform/audio/AudioDestination.h: * platform/audio/AudioFIFO.cpp: * platform/audio/AudioFIFO.h: * platform/audio/AudioFileReader.h: * platform/audio/AudioIOCallback.h: * platform/audio/AudioPullFIFO.cpp: * platform/audio/AudioPullFIFO.h: * platform/audio/AudioSourceProvider.h: * platform/audio/Biquad.cpp: * platform/audio/Biquad.h: * platform/audio/Cone.cpp: * platform/audio/Cone.h: * platform/audio/DirectConvolver.cpp: * platform/audio/DirectConvolver.h: * platform/audio/Distance.cpp: * platform/audio/Distance.h: * platform/audio/DownSampler.cpp: * platform/audio/DownSampler.h: * platform/audio/DynamicsCompressor.cpp: * platform/audio/DynamicsCompressor.h: * platform/audio/DynamicsCompressorKernel.cpp: * platform/audio/DynamicsCompressorKernel.h: * platform/audio/FFTConvolver.cpp: * platform/audio/FFTConvolver.h: * platform/audio/FFTFrame.cpp: * platform/audio/FFTFrame.h: * platform/audio/HRTFDatabase.cpp: * platform/audio/HRTFDatabase.h: * platform/audio/HRTFDatabaseLoader.cpp: * platform/audio/HRTFDatabaseLoader.h: * platform/audio/HRTFElevation.cpp: * platform/audio/HRTFElevation.h: * platform/audio/HRTFKernel.cpp: * platform/audio/HRTFKernel.h: * platform/audio/MultiChannelResampler.cpp: * platform/audio/MultiChannelResampler.h: * platform/audio/Panner.cpp: * platform/audio/Panner.h: * platform/audio/Reverb.cpp: * platform/audio/Reverb.h: * platform/audio/ReverbAccumulationBuffer.cpp: * platform/audio/ReverbAccumulationBuffer.h: * platform/audio/ReverbConvolver.cpp: * platform/audio/ReverbConvolver.h: * platform/audio/ReverbConvolverStage.cpp: * platform/audio/ReverbConvolverStage.h: * platform/audio/ReverbInputBuffer.cpp: * platform/audio/ReverbInputBuffer.h: * platform/audio/SincResampler.cpp: * platform/audio/SincResampler.h: * platform/audio/UpSampler.cpp: * platform/audio/UpSampler.h: * platform/audio/ZeroPole.cpp: * platform/audio/ZeroPole.h: * platform/audio/ios/AudioDestinationIOS.cpp: * platform/audio/ios/AudioDestinationIOS.h: * platform/audio/ios/AudioFileReaderIOS.cpp: * platform/audio/ios/AudioFileReaderIOS.h: * platform/audio/mac/AudioDestinationMac.cpp: * platform/audio/mac/AudioDestinationMac.h: * platform/audio/mac/AudioFileReaderMac.cpp: * platform/audio/mac/AudioFileReaderMac.h: * platform/audio/mac/FFTFrameMac.cpp: * platform/cf/FileSystemCF.cpp: * platform/cf/SharedBufferCF.cpp: * platform/cf/URLCF.cpp: * platform/cocoa/KeyEventCocoa.h: * platform/cocoa/KeyEventCocoa.mm: * platform/efl/CursorEfl.cpp: * platform/efl/EflKeyboardUtilities.cpp: * platform/efl/EflKeyboardUtilities.h: * platform/efl/FileSystemEfl.cpp: * platform/efl/LanguageEfl.cpp: * platform/efl/LocalizedStringsEfl.cpp: * platform/efl/MIMETypeRegistryEfl.cpp: * platform/efl/PlatformKeyboardEventEfl.cpp: * platform/efl/PlatformMouseEventEfl.cpp: * platform/efl/PlatformScreenEfl.cpp: * platform/efl/PlatformWheelEventEfl.cpp: * platform/efl/RenderThemeEfl.h: * platform/efl/ScrollbarEfl.h: * platform/efl/SharedTimerEfl.cpp: * platform/efl/SoundEfl.cpp: * platform/efl/TemporaryLinkStubs.cpp: * platform/efl/WidgetEfl.cpp: * platform/graphics/ANGLEWebKitBridge.cpp: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/AudioTrackPrivate.h: * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Color.cpp: * platform/graphics/Color.h: * platform/graphics/CrossfadeGeneratedImage.cpp: * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/DashArray.h: * platform/graphics/DisplayRefreshMonitor.cpp: * platform/graphics/DisplayRefreshMonitor.h: * platform/graphics/FloatPoint.cpp: * platform/graphics/FloatPoint.h: * platform/graphics/FloatQuad.cpp: * platform/graphics/FloatQuad.h: * platform/graphics/FloatRect.cpp: * platform/graphics/FloatRect.h: * platform/graphics/FloatSize.cpp: * platform/graphics/FloatSize.h: * platform/graphics/FontBaseline.h: * platform/graphics/FontCache.cpp: * platform/graphics/FontCache.h: * platform/graphics/FontData.cpp: * platform/graphics/FontData.h: * platform/graphics/FontDescription.cpp: * platform/graphics/FontFeatureSettings.cpp: * platform/graphics/FontFeatureSettings.h: * platform/graphics/FontGlyphs.cpp: * platform/graphics/FontOrientation.h: * platform/graphics/FontRenderingMode.h: * platform/graphics/FontSelector.h: * platform/graphics/FontWidthVariant.h: * platform/graphics/FormatConverter.cpp: * platform/graphics/FormatConverter.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Glyph.h: * platform/graphics/GlyphBuffer.h: * platform/graphics/GlyphMetricsMap.h: * platform/graphics/GlyphPage.h: * platform/graphics/GlyphPageTreeNode.cpp: * platform/graphics/GlyphPageTreeNode.h: * platform/graphics/Gradient.cpp: * platform/graphics/Gradient.h: * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContext3D.cpp: * platform/graphics/GraphicsContext3D.h: * platform/graphics/GraphicsLayer.cpp: * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsLayerClient.h: * platform/graphics/GraphicsTypes.cpp: * platform/graphics/GraphicsTypes.h: * platform/graphics/GraphicsTypes3D.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageBuffer.cpp: * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferData.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.cpp: * platform/graphics/ImageSource.h: * platform/graphics/InbandTextTrackPrivate.h: * platform/graphics/InbandTextTrackPrivateClient.h: * platform/graphics/IntPoint.cpp: * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: * platform/graphics/IntSize.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/NativeImagePtr.h: * platform/graphics/OpenGLESShims.h: * platform/graphics/Path.cpp: * platform/graphics/Path.h: * platform/graphics/PathTraversalState.h: * platform/graphics/Pattern.cpp: * platform/graphics/Pattern.h: * platform/graphics/PlatformLayer.h: * platform/graphics/PlatformTimeRanges.cpp: * platform/graphics/PlatformTimeRanges.h: * platform/graphics/SegmentedFontData.cpp: * platform/graphics/SegmentedFontData.h: * platform/graphics/ShadowBlur.cpp: * platform/graphics/ShadowBlur.h: * platform/graphics/SimpleFontData.cpp: * platform/graphics/SourceBufferPrivateClient.h: * platform/graphics/StringTruncator.cpp: * platform/graphics/StringTruncator.h: * platform/graphics/TrackPrivateBase.h: * platform/graphics/VideoTrackPrivate.h: * platform/graphics/WindRule.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: * platform/graphics/ca/GraphicsLayerCA.cpp: * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/LayerFlushScheduler.cpp: * platform/graphics/ca/LayerFlushScheduler.h: * platform/graphics/ca/LayerFlushSchedulerClient.h: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCAFilters.h: * platform/graphics/ca/PlatformCALayer.cpp: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/PlatformCALayerClient.h: * platform/graphics/ca/TransformationMatrixCA.cpp: * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp: * platform/graphics/ca/mac/LayerPool.mm: * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: * platform/graphics/ca/mac/PlatformCAFiltersMac.h: * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: * platform/graphics/ca/mac/PlatformCALayerMac.h: * platform/graphics/ca/mac/PlatformCALayerMac.mm: * platform/graphics/ca/mac/WebTiledBackingLayer.h: * platform/graphics/ca/mac/WebTiledBackingLayer.mm: * platform/graphics/ca/win/AbstractCACFLayerTreeHost.h: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/ca/win/CACFLayerTreeHostClient.h: * platform/graphics/ca/win/LayerChangesFlusher.cpp: * platform/graphics/ca/win/LayerChangesFlusher.h: * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: * platform/graphics/ca/win/PlatformCAFiltersWin.cpp: * platform/graphics/ca/win/PlatformCALayerWin.cpp: * platform/graphics/ca/win/PlatformCALayerWin.h: * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: * platform/graphics/ca/win/PlatformCALayerWinInternal.h: * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h: * platform/graphics/cairo/BitmapImageCairo.cpp: * platform/graphics/cairo/CairoUtilities.cpp: * platform/graphics/cairo/CairoUtilities.h: * platform/graphics/cairo/DrawingBufferCairo.cpp: * platform/graphics/cairo/FloatRectCairo.cpp: * platform/graphics/cairo/FontCairo.cpp: * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: * platform/graphics/cairo/GradientCairo.cpp: * platform/graphics/cairo/GraphicsContext3DCairo.cpp: * platform/graphics/cairo/GraphicsContextCairo.cpp: * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/cairo/ImageCairo.cpp: * platform/graphics/cairo/PatternCairo.cpp: * platform/graphics/cairo/PlatformContextCairo.cpp: * platform/graphics/cairo/PlatformContextCairo.h: * platform/graphics/cairo/TransformationMatrixCairo.cpp: * platform/graphics/cg/BitmapImageCG.cpp: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/FloatPointCG.cpp: * platform/graphics/cg/FloatRectCG.cpp: * platform/graphics/cg/FloatSizeCG.cpp: * platform/graphics/cg/GradientCG.cpp: * platform/graphics/cg/GraphicsContext3DCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/GraphicsContextCG.h: * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h: * platform/graphics/cg/ImageBufferCG.cpp: * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/ImageBufferDataCG.h: * platform/graphics/cg/ImageCG.cpp: * platform/graphics/cg/ImageSourceCG.cpp: * platform/graphics/cg/IntPointCG.cpp: * platform/graphics/cg/IntRectCG.cpp: * platform/graphics/cg/IntSizeCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PathCG.cpp: * platform/graphics/cg/PatternCG.cpp: * platform/graphics/cg/TransformationMatrixCG.cpp: * platform/graphics/efl/IconEfl.cpp: * platform/graphics/efl/ImageEfl.cpp: * platform/graphics/filters/FilterOperation.cpp: * platform/graphics/filters/FilterOperation.h: * platform/graphics/filters/FilterOperations.cpp: * platform/graphics/filters/FilterOperations.h: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp: * platform/graphics/freetype/SimpleFontDataFreeType.cpp: * platform/graphics/gpu/mac/DrawingBufferMac.mm: * platform/graphics/gtk/GdkCairoUtilities.cpp: * platform/graphics/gtk/GdkCairoUtilities.h: * platform/graphics/gtk/IconGtk.cpp: * platform/graphics/gtk/ImageGtk.cpp: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/GraphicsContext3DIOS.h: * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h: * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm: * platform/graphics/ios/MediaPlayerPrivateIOS.h: * platform/graphics/ios/MediaPlayerPrivateIOS.mm: * platform/graphics/mac/ColorMac.h: * platform/graphics/mac/ColorMac.mm: * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: * platform/graphics/mac/FloatPointMac.mm: * platform/graphics/mac/FloatRectMac.mm: * platform/graphics/mac/FloatSizeMac.mm: * platform/graphics/mac/FontCacheMac.mm: * platform/graphics/mac/FontCustomPlatformData.h: * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: * platform/graphics/mac/GraphicsContext3DMac.mm: * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/ImageMac.mm: * platform/graphics/mac/IntPointMac.mm: * platform/graphics/mac/IntRectMac.mm: * platform/graphics/mac/IntSizeMac.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.h: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/MediaPlayerProxy.h: * platform/graphics/mac/WebCoreCALayerExtras.h: * platform/graphics/mac/WebCoreCALayerExtras.mm: * platform/graphics/mac/WebGLLayer.h: * platform/graphics/mac/WebGLLayer.mm: * platform/graphics/mac/WebLayer.h: * platform/graphics/mac/WebLayer.mm: * platform/graphics/mac/WebTiledLayer.h: * platform/graphics/mac/WebTiledLayer.mm: * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: * platform/graphics/opentype/OpenTypeUtilities.cpp: * platform/graphics/opentype/OpenTypeUtilities.h: * platform/graphics/transforms/AffineTransform.cpp: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/Matrix3DTransformOperation.cpp: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.cpp: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/TransformState.cpp: * platform/graphics/transforms/TransformState.h: * platform/graphics/transforms/TransformationMatrix.cpp: * platform/graphics/transforms/TransformationMatrix.h: * platform/graphics/win/FontCGWin.cpp: * platform/graphics/win/FontCacheWin.cpp: * platform/graphics/win/FontCustomPlatformDataCairo.cpp: * platform/graphics/win/FontWin.cpp: * platform/graphics/win/FullScreenController.cpp: * platform/graphics/win/FullScreenController.h: * platform/graphics/win/FullScreenControllerClient.h: * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp: * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp: * platform/graphics/win/GraphicsContextCGWin.cpp: * platform/graphics/win/GraphicsContextCairoWin.cpp: * platform/graphics/win/GraphicsContextWin.cpp: * platform/graphics/win/ImageCGWin.cpp: * platform/graphics/win/ImageCairoWin.cpp: * platform/graphics/win/ImageWin.cpp: * platform/graphics/win/IntPointWin.cpp: * platform/graphics/win/IntRectWin.cpp: * platform/graphics/win/IntSizeWin.cpp: * platform/graphics/win/LocalWindowsContext.h: * platform/graphics/win/MediaPlayerPrivateTaskTimer.cpp: * platform/graphics/win/MediaPlayerPrivateTaskTimer.h: * platform/graphics/win/SimpleFontDataCGWin.cpp: * platform/graphics/win/SimpleFontDataCairoWin.cpp: * platform/graphics/win/SimpleFontDataWin.cpp: * platform/graphics/win/TransformationMatrixWin.cpp: * platform/graphics/wince/FontCacheWinCE.cpp: * platform/graphics/wince/FontWinCE.cpp: * platform/graphics/wince/MediaPlayerPrivateWinCE.h: * platform/graphics/wince/SimpleFontDataWinCE.cpp: * platform/gtk/CompositionResults.h: * platform/gtk/CursorGtk.cpp: * platform/gtk/GtkPluginWidget.cpp: * platform/gtk/GtkPluginWidget.h: * platform/gtk/LocalizedStringsGtk.cpp: * platform/gtk/MIMETypeRegistryGtk.cpp: * platform/gtk/PlatformKeyboardEventGtk.cpp: * platform/gtk/PlatformMouseEventGtk.cpp: * platform/gtk/PlatformScreenGtk.cpp: * platform/gtk/PlatformWheelEventGtk.cpp: * platform/gtk/RedirectedXCompositeWindow.cpp: * platform/gtk/RedirectedXCompositeWindow.h: * platform/gtk/RenderThemeGtk.h: * platform/gtk/ScrollViewGtk.cpp: * platform/gtk/SharedTimerGtk.cpp: * platform/gtk/TemporaryLinkStubs.cpp: * platform/gtk/UserAgentGtk.cpp: * platform/gtk/UserAgentGtk.h: * platform/gtk/WidgetGtk.cpp: * platform/gtk/WidgetRenderingContext.cpp: * platform/image-decoders/ImageDecoder.h: * platform/image-decoders/cairo/ImageDecoderCairo.cpp: * platform/image-decoders/gif/GIFImageDecoder.cpp: * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/gif/GIFImageReader.cpp: * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/image-decoders/png/PNGImageDecoder.cpp: * platform/image-decoders/png/PNGImageDecoder.h: * platform/image-decoders/webp/WEBPImageDecoder.cpp: * platform/image-decoders/webp/WEBPImageDecoder.h: * platform/ios/CursorIOS.cpp: * platform/ios/DragImageIOS.mm: * platform/ios/KeyEventCodesIOS.h: * platform/ios/KeyEventIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/PlatformSpeechSynthesizerIOS.mm: * platform/ios/RemoteCommandListenerIOS.h: * platform/ios/RemoteCommandListenerIOS.mm: * platform/ios/ScrollViewIOS.mm: * platform/ios/SoundIOS.mm: * platform/ios/SystemMemory.h: * platform/ios/SystemMemoryIOS.cpp: * platform/ios/WebCoreSystemInterfaceIOS.h: * platform/ios/WebCoreSystemInterfaceIOS.mm: * platform/ios/WidgetIOS.mm: * platform/mac/BlockExceptions.h: * platform/mac/BlockExceptions.mm: * platform/mac/ContextMenuItemMac.mm: * platform/mac/ContextMenuMac.mm: * platform/mac/CursorMac.mm: * platform/mac/DragDataMac.mm: * platform/mac/DragImageMac.mm: * platform/mac/FileSystemMac.mm: * platform/mac/KeyEventMac.mm: * platform/mac/LocalCurrentGraphicsContext.h: * platform/mac/LocalCurrentGraphicsContext.mm: * platform/mac/LoggingMac.mm: * platform/mac/MIMETypeRegistryMac.mm: * platform/mac/MediaTimeMac.cpp: * platform/mac/MediaTimeMac.h: * platform/mac/PasteboardMac.mm: * platform/mac/PlatformClockCA.cpp: * platform/mac/PlatformClockCA.h: * platform/mac/PlatformClockCM.h: * platform/mac/PlatformClockCM.mm: * platform/mac/PlatformPasteboardMac.mm: * platform/mac/PlatformScreenMac.mm: * platform/mac/PlatformSpeechSynthesisMac.mm: * platform/mac/PlatformSpeechSynthesizerMac.mm: * platform/mac/ScrollViewMac.mm: * platform/mac/SharedBufferMac.mm: * platform/mac/SharedTimerMac.mm: * platform/mac/SoftLinking.h: * platform/mac/SoundMac.mm: * platform/mac/ThreadCheck.mm: * platform/mac/URLMac.mm: * platform/mac/WebCoreNSStringExtras.h: * platform/mac/WebCoreNSStringExtras.mm: * platform/mac/WebCoreNSURLExtras.h: * platform/mac/WebCoreNSURLExtras.mm: * platform/mac/WebCoreObjCExtras.h: * platform/mac/WebCoreObjCExtras.mm: * platform/mac/WebCoreSystemInterface.h: * platform/mac/WebCoreSystemInterface.mm: * platform/mac/WebCoreView.h: * platform/mac/WebCoreView.m: * platform/mac/WebFontCache.h: * platform/mac/WebFontCache.mm: * platform/mac/WebWindowAnimation.h: * platform/mac/WebWindowAnimation.mm: * platform/mac/WidgetMac.mm: * platform/mediastream/MediaStreamConstraintsValidationClient.h: * platform/mediastream/MediaStreamCreationClient.h: * platform/mediastream/MediaStreamSourceCapabilities.h: * platform/mediastream/MediaStreamSourceStates.h: * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: * platform/mediastream/RTCIceServer.h: * platform/mediastream/mac/AVAudioCaptureSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: * platform/mock/MockMediaStreamCenter.cpp: * platform/mock/MockMediaStreamCenter.h: * platform/mock/PlatformSpeechSynthesizerMock.cpp: * platform/mock/PlatformSpeechSynthesizerMock.h: * platform/mock/mediasource/MockBox.cpp: * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/mock/mediasource/MockSourceBufferPrivate.h: * platform/mock/mediasource/MockTracks.cpp: * platform/mock/mediasource/MockTracks.h: * platform/network/AuthenticationChallengeBase.cpp: * platform/network/AuthenticationChallengeBase.h: * platform/network/Credential.cpp: * platform/network/Credential.h: * platform/network/DNS.h: * platform/network/DNSResolveQueue.cpp: * platform/network/DNSResolveQueue.h: * platform/network/DataURL.cpp: * platform/network/DataURL.h: * platform/network/HTTPHeaderMap.h: * platform/network/HTTPParsers.cpp: * platform/network/HTTPParsers.h: * platform/network/PlatformCookieJar.h: * platform/network/ProtectionSpace.cpp: * platform/network/ProtectionSpace.h: * platform/network/ResourceErrorBase.cpp: * platform/network/ResourceErrorBase.h: * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceHandleInternal.h: * platform/network/ResourceRequestBase.cpp: * platform/network/ResourceRequestBase.h: * platform/network/ResourceResponseBase.cpp: * platform/network/ResourceResponseBase.h: * platform/network/cf/AuthenticationCF.cpp: * platform/network/cf/AuthenticationCF.h: * platform/network/cf/AuthenticationChallenge.h: * platform/network/cf/CookieJarCFNet.cpp: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/DNSCFNet.cpp: * platform/network/cf/DownloadBundle.h: * platform/network/cf/FormDataStreamCFNet.cpp: * platform/network/cf/FormDataStreamCFNet.h: * platform/network/cf/ResourceError.h: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h: * platform/network/cf/ResourceRequest.h: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: * platform/network/curl/AuthenticationChallenge.h: * platform/network/curl/CurlDownload.cpp: * platform/network/curl/CurlDownload.h: * platform/network/curl/DNSCurl.cpp: * platform/network/curl/DownloadBundle.h: * platform/network/curl/FormDataStreamCurl.cpp: * platform/network/curl/FormDataStreamCurl.h: * platform/network/curl/ResourceError.h: * platform/network/curl/ResourceHandleCurl.cpp: * platform/network/curl/ResourceHandleManager.cpp: * platform/network/curl/ResourceHandleManager.h: * platform/network/curl/ResourceRequest.h: * platform/network/curl/ResourceResponse.h: * platform/network/curl/SSLHandle.cpp: * platform/network/curl/SSLHandle.h: * platform/network/gtk/CredentialBackingStore.cpp: * platform/network/gtk/CredentialBackingStore.h: * platform/network/ios/WebCoreURLResponseIOS.h: * platform/network/ios/WebCoreURLResponseIOS.mm: * platform/network/mac/AuthenticationMac.h: * platform/network/mac/AuthenticationMac.mm: * platform/network/mac/CookieJarMac.mm: * platform/network/mac/CookieStorageMac.mm: * platform/network/mac/FormDataStreamMac.h: * platform/network/mac/FormDataStreamMac.mm: * platform/network/mac/ResourceErrorMac.mm: * platform/network/mac/ResourceHandleMac.mm: * platform/network/mac/ResourceRequestMac.mm: * platform/network/mac/ResourceResponseMac.mm: * platform/network/mac/WebCoreURLResponse.h: * platform/network/mac/WebCoreURLResponse.mm: * platform/network/soup/AuthenticationChallenge.h: * platform/network/soup/AuthenticationChallengeSoup.cpp: * platform/network/soup/CookieJarSoup.h: * platform/network/soup/DNSSoup.cpp: * platform/network/soup/ResourceError.h: * platform/network/soup/ResourceErrorSoup.cpp: * platform/network/soup/ResourceRequest.h: * platform/network/soup/ResourceResponse.h: * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/SoupNetworkSession.h: * platform/network/win/CookieJarWin.cpp: * platform/network/win/DownloadBundleWin.cpp: * platform/network/win/ResourceError.h: * platform/network/win/ResourceHandleWin.cpp: * platform/network/win/ResourceRequest.h: * platform/network/win/ResourceResponse.h: * platform/posix/FileSystemPOSIX.cpp: * platform/posix/SharedBufferPOSIX.cpp: * platform/soup/URLSoup.cpp: * platform/sql/SQLValue.cpp: * platform/sql/SQLValue.h: * platform/sql/SQLiteAuthorizer.cpp: * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: * platform/sql/SQLiteStatement.h: * platform/sql/SQLiteTransaction.cpp: * platform/sql/SQLiteTransaction.h: * platform/text/SuffixTree.h: * platform/text/TextAllInOne.cpp: * platform/text/TextBoundaries.cpp: * platform/text/TextBoundaries.h: * platform/text/TextCodec.cpp: * platform/text/TextCodec.h: * platform/text/TextCodecASCIIFastPath.h: * platform/text/TextCodecICU.cpp: * platform/text/TextCodecICU.h: * platform/text/TextCodecLatin1.cpp: * platform/text/TextCodecLatin1.h: * platform/text/TextCodecUTF16.cpp: * platform/text/TextCodecUTF16.h: * platform/text/TextCodecUTF8.cpp: * platform/text/TextCodecUTF8.h: * platform/text/TextCodecUserDefined.cpp: * platform/text/TextCodecUserDefined.h: * platform/text/TextDirection.h: * platform/text/TextEncoding.cpp: * platform/text/TextEncoding.h: * platform/text/TextEncodingRegistry.cpp: * platform/text/TextEncodingRegistry.h: * platform/text/TextStream.cpp: * platform/text/TextStream.h: * platform/text/UnicodeBidi.h: * platform/text/mac/CharsetData.h: * platform/text/mac/TextBoundaries.mm: * platform/text/mac/TextCodecMac.cpp: * platform/text/mac/TextCodecMac.h: * platform/text/mac/character-sets.txt: * platform/text/mac/make-charset-table.pl: * platform/text/win/TextCodecWin.h: * platform/win/BString.cpp: * platform/win/BString.h: * platform/win/COMPtr.h: * platform/win/ClipboardUtilitiesWin.cpp: * platform/win/ClipboardUtilitiesWin.h: * platform/win/ContextMenuItemWin.cpp: * platform/win/ContextMenuWin.cpp: * platform/win/CursorWin.cpp: * platform/win/DragDataWin.cpp: * platform/win/DragImageCGWin.cpp: * platform/win/DragImageCairoWin.cpp: * platform/win/DragImageWin.cpp: * platform/win/FileSystemWin.cpp: * platform/win/GDIObjectCounter.cpp: * platform/win/GDIObjectCounter.h: * platform/win/HWndDC.h: * platform/win/KeyEventWin.cpp: * platform/win/LanguageWin.cpp: * platform/win/MIMETypeRegistryWin.cpp: * platform/win/PasteboardWin.cpp: * platform/win/PlatformMouseEventWin.cpp: * platform/win/PlatformScreenWin.cpp: * platform/win/SharedBufferWin.cpp: * platform/win/SharedTimerWin.cpp: * platform/win/SoftLinking.h: * platform/win/SoundWin.cpp: * platform/win/StructuredExceptionHandlerSuppressor.cpp: * platform/win/TemporaryLinkStubs.cpp: * platform/win/WCDataObject.cpp: * platform/win/WCDataObject.h: * platform/win/WebCoreTextRenderer.cpp: * platform/win/WebCoreTextRenderer.h: * platform/win/WheelEventWin.cpp: * platform/win/WidgetWin.cpp: * platform/win/WindowMessageBroadcaster.cpp: * platform/win/WindowMessageBroadcaster.h: * platform/win/WindowMessageListener.h: * platform/win/WindowsTouch.h: * platform/win/makesafeseh.asm: * plugins/PluginDatabase.cpp: * plugins/PluginDatabase.h: * plugins/PluginDebug.cpp: * plugins/PluginDebug.h: * plugins/PluginPackage.cpp: * plugins/PluginPackage.h: * plugins/PluginQuirkSet.h: * plugins/PluginStream.cpp: * plugins/PluginStream.h: * plugins/PluginView.cpp: * plugins/PluginView.h: * plugins/efl/PluginPackageEfl.cpp: * plugins/efl/PluginViewEfl.cpp: * plugins/gtk/PluginPackageGtk.cpp: * plugins/gtk/PluginViewGtk.cpp: * plugins/mac/PluginPackageMac.cpp: * plugins/mac/PluginViewMac.mm: * plugins/npapi.cpp: * plugins/npfunctions.h: * plugins/npruntime.h: * plugins/win/PluginDatabaseWin.cpp: * plugins/win/PluginPackageWin.cpp: * plugins/win/PluginViewWin.cpp: * plugins/x11/PluginViewX11.cpp: * rendering/EllipsisBox.cpp: * rendering/EllipsisBox.h: * rendering/FilterEffectRenderer.cpp: * rendering/FilterEffectRenderer.h: * rendering/HitTestLocation.h: * rendering/HitTestRequest.h: * rendering/HitTestResult.h: * rendering/HitTestingTransformState.cpp: * rendering/HitTestingTransformState.h: * rendering/RenderBoxRegionInfo.h: * rendering/RenderButton.cpp: * rendering/RenderButton.h: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderFieldset.cpp: * rendering/RenderFrameBase.cpp: * rendering/RenderFrameBase.h: * rendering/RenderFrameSet.cpp: * rendering/RenderGeometryMap.cpp: * rendering/RenderGeometryMap.h: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderHTMLCanvas.cpp: * rendering/RenderHTMLCanvas.h: * rendering/RenderIFrame.cpp: * rendering/RenderIFrame.h: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: * rendering/RenderLayerCompositor.h: * rendering/RenderLineBoxList.cpp: * rendering/RenderLineBoxList.h: * rendering/RenderListBox.cpp: * rendering/RenderListBox.h: * rendering/RenderMarquee.h: * rendering/RenderMedia.cpp: * rendering/RenderMedia.h: * rendering/RenderMultiColumnFlowThread.cpp: * rendering/RenderMultiColumnFlowThread.h: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderMultiColumnSet.h: * rendering/RenderNamedFlowThread.cpp: * rendering/RenderNamedFlowThread.h: * rendering/RenderRegionSet.cpp: * rendering/RenderRegionSet.h: * rendering/RenderReplica.cpp: * rendering/RenderReplica.h: * rendering/RenderTheme.cpp: * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeWin.h: * rendering/RenderThemeWinCE.cpp: * rendering/RenderThemeWinCE.h: * rendering/RenderTreeAsText.cpp: * rendering/RenderTreeAsText.h: * rendering/RenderVTTCue.cpp: * rendering/RenderVTTCue.h: * rendering/RenderVideo.cpp: * rendering/RenderVideo.h: * rendering/RenderView.h: * rendering/style/SVGRenderStyle.cpp: * rendering/style/SVGRenderStyle.h: * rendering/style/SVGRenderStyleDefs.cpp: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleFilterData.cpp: * rendering/style/StyleFilterData.h: * rendering/style/StylePendingImage.h: * rendering/svg/RenderSVGBlock.cpp: * rendering/svg/RenderSVGBlock.h: * rendering/svg/RenderSVGForeignObject.cpp: * rendering/svg/RenderSVGForeignObject.h: * rendering/svg/RenderSVGImage.cpp: * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGInlineText.cpp: * rendering/svg/RenderSVGPath.h: * rendering/svg/RenderSVGShape.h: * rendering/svg/RenderSVGTSpan.h: * rendering/svg/RenderSVGText.cpp: * rendering/svg/RenderSVGText.h: * rendering/svg/SVGInlineFlowBox.cpp: * rendering/svg/SVGInlineFlowBox.h: * rendering/svg/SVGRenderTreeAsText.cpp: * rendering/svg/SVGRenderTreeAsText.h: * rendering/svg/SVGRootInlineBox.cpp: * rendering/svg/SVGRootInlineBox.h: * storage/StorageEventDispatcher.h: * svg/SVGException.cpp: * svg/graphics/SVGImageChromeClient.h: * workers/Worker.cpp: * workers/Worker.h: * workers/Worker.idl: * workers/WorkerEventQueue.cpp: * workers/WorkerEventQueue.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScope.idl: * workers/WorkerLocation.cpp: * workers/WorkerLocation.h: * workers/WorkerLocation.idl: * workers/WorkerMessagingProxy.cpp: * workers/WorkerMessagingProxy.h: * workers/WorkerScriptLoader.cpp: * workers/WorkerScriptLoader.h: * workers/WorkerScriptLoaderClient.h: * workers/WorkerThread.cpp: * workers/WorkerThread.h: * xml/DOMParser.h: * xml/DOMParser.idl: * xml/NativeXPathNSResolver.cpp: * xml/NativeXPathNSResolver.h: * xml/XMLHttpRequest.idl: * xml/XMLHttpRequestException.cpp: * xml/XMLHttpRequestException.h: * xml/XMLHttpRequestException.idl: * xml/XMLHttpRequestProgressEvent.h: * xml/XMLHttpRequestProgressEvent.idl: * xml/XMLHttpRequestUpload.idl: * xml/XMLSerializer.h: * xml/XMLSerializer.idl: * xml/XPathEvaluator.cpp: * xml/XPathEvaluator.h: * xml/XPathEvaluator.idl: * xml/XPathException.cpp: * xml/XPathException.h: * xml/XPathException.idl: * xml/XPathExpression.idl: * xml/XPathExpressionNode.cpp: * xml/XPathNSResolver.cpp: * xml/XPathNSResolver.h: * xml/XPathNSResolver.idl: * xml/XPathNodeSet.h: * xml/XPathResult.idl: * xml/XPathUtil.h: * xml/XPathVariableReference.cpp: * xml/XSLTProcessor.idl: * xml/XSLTUnicodeSort.cpp: * xml/XSLTUnicodeSort.h: Source/WebInspectorUI: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * APPLE_IMAGES_LICENSE.rtf: * UserInterface/Base/DOMUtilities.js: * UserInterface/Models/Color.js: * UserInterface/Views/ConsoleCommand.js: * UserInterface/Views/ConsoleCommandResult.js: * UserInterface/Views/ConsoleGroup.js: * UserInterface/Views/ConsoleMessage.js: * UserInterface/Views/ConsoleMessageImpl.js: * UserInterface/Views/DOMTreeElement.js: * UserInterface/Views/DOMTreeOutline.js: * UserInterface/Views/DOMTreeUpdater.js: * UserInterface/Views/GradientSlider.css: * UserInterface/Views/GradientSlider.js: * UserInterface/Views/TreeOutline.js: Source/WebKit: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * scripts/generate-webkitversion.pl: (printLicenseHeader): Source/WebKit/efl: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/ChromeClientEfl.cpp: * WebCoreSupport/ContextMenuClientEfl.cpp: * WebCoreSupport/ContextMenuClientEfl.h: * WebCoreSupport/DeviceMotionClientEfl.cpp: * WebCoreSupport/DeviceOrientationClientEfl.cpp: * WebCoreSupport/DragClientEfl.cpp: * WebCoreSupport/EditorClientEfl.h: * WebCoreSupport/FrameLoaderClientEfl.cpp: * WebCoreSupport/FrameLoaderClientEfl.h: * WebCoreSupport/FrameNetworkingContextEfl.cpp: * WebCoreSupport/FrameNetworkingContextEfl.h: * WebCoreSupport/InspectorClientEfl.h: * WebCoreSupport/NavigatorContentUtilsClientEfl.cpp: * WebCoreSupport/NavigatorContentUtilsClientEfl.h: * WebCoreSupport/NetworkInfoClientEfl.cpp: Source/WebKit/gtk: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/ContextMenuClientGtk.h: * WebCoreSupport/DocumentLoaderGtk.cpp: * WebCoreSupport/DocumentLoaderGtk.h: * WebCoreSupport/EditorClientGtk.h: * WebCoreSupport/FrameLoaderClientGtk.h: * WebCoreSupport/InspectorClientGtk.h: * WebCoreSupport/TextCheckerClientGtk.h: Source/WebKit/ios: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * WebCoreSupport/WebCaretChangeListener.h: * WebCoreSupport/WebInspectorClientIOS.mm: * WebView/WebPlainWhiteView.h: * WebView/WebPlainWhiteView.mm: Source/WebKit/mac: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Carbon/CarbonUtils.h: * Carbon/CarbonUtils.m: * Carbon/CarbonWindowAdapter.h: * Carbon/CarbonWindowAdapter.mm: * Carbon/CarbonWindowContentView.h: * Carbon/CarbonWindowContentView.m: * Carbon/CarbonWindowFrame.h: * Carbon/CarbonWindowFrame.m: * Carbon/HIViewAdapter.h: * Carbon/HIViewAdapter.m: * Carbon/HIWebView.h: * Carbon/HIWebView.mm: * DOM/WebDOMOperations.h: * DOM/WebDOMOperations.mm: * DOM/WebDOMOperationsInternal.h: * DOM/WebDOMOperationsPrivate.h: * DefaultDelegates/WebDefaultContextMenuDelegate.h: * DefaultDelegates/WebDefaultContextMenuDelegate.mm: * DefaultDelegates/WebDefaultEditingDelegate.h: * DefaultDelegates/WebDefaultEditingDelegate.m: * DefaultDelegates/WebDefaultPolicyDelegate.h: * DefaultDelegates/WebDefaultPolicyDelegate.m: * DefaultDelegates/WebDefaultUIDelegate.h: * DefaultDelegates/WebDefaultUIDelegate.m: * History/WebBackForwardList.h: * History/WebBackForwardList.mm: * History/WebBackForwardListInternal.h: * History/WebBackForwardListPrivate.h: * History/WebHistory.h: * History/WebHistory.mm: * History/WebHistoryInternal.h: * History/WebHistoryItem.h: * History/WebHistoryItem.mm: * History/WebHistoryItemInternal.h: * History/WebHistoryItemPrivate.h: * History/WebHistoryPrivate.h: * History/WebURLsWithTitles.h: * History/WebURLsWithTitles.m: * MigrateHeaders.make: * Misc/OldWebAssertions.c: * Misc/WebCache.h: * Misc/WebCache.mm: * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: * Misc/WebDownload.h: * Misc/WebDownload.mm: * Misc/WebDownloadInternal.h: * Misc/WebElementDictionary.h: * Misc/WebElementDictionary.mm: * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.mm: * Misc/WebIconDatabaseDelegate.h: * Misc/WebIconDatabaseInternal.h: * Misc/WebIconDatabasePrivate.h: * Misc/WebKit.h: * Misc/WebKitErrors.h: * Misc/WebKitErrors.m: * Misc/WebKitErrorsPrivate.h: * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.mm: * Misc/WebKitStatistics.h: * Misc/WebKitStatistics.m: * Misc/WebKitStatisticsPrivate.h: * Misc/WebKitSystemBits.h: * Misc/WebKitSystemBits.m: * Misc/WebKitVersionChecks.h: * Misc/WebKitVersionChecks.m: * Misc/WebLocalizableStrings.h: * Misc/WebLocalizableStrings.mm: * Misc/WebNSArrayExtras.h: * Misc/WebNSArrayExtras.m: * Misc/WebNSControlExtras.h: * Misc/WebNSControlExtras.m: * Misc/WebNSDataExtras.h: * Misc/WebNSDataExtras.m: * Misc/WebNSDataExtrasPrivate.h: * Misc/WebNSDictionaryExtras.h: * Misc/WebNSDictionaryExtras.m: * Misc/WebNSEventExtras.h: * Misc/WebNSEventExtras.m: * Misc/WebNSFileManagerExtras.h: * Misc/WebNSFileManagerExtras.mm: * Misc/WebNSImageExtras.h: * Misc/WebNSImageExtras.m: * Misc/WebNSObjectExtras.h: * Misc/WebNSObjectExtras.mm: * Misc/WebNSPasteboardExtras.h: * Misc/WebNSPasteboardExtras.mm: * Misc/WebNSPrintOperationExtras.h: * Misc/WebNSPrintOperationExtras.m: * Misc/WebNSURLExtras.h: * Misc/WebNSURLExtras.mm: * Misc/WebNSURLRequestExtras.h: * Misc/WebNSURLRequestExtras.m: * Misc/WebNSUserDefaultsExtras.h: * Misc/WebNSUserDefaultsExtras.mm: * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: * Misc/WebNSWindowExtras.h: * Misc/WebNSWindowExtras.m: * Misc/WebStringTruncator.h: * Misc/WebStringTruncator.mm: * Misc/WebTypesInternal.h: * Panels/WebAuthenticationPanel.h: * Panels/WebAuthenticationPanel.m: * Panels/WebPanelAuthenticationHandler.h: * Panels/WebPanelAuthenticationHandler.m: * Plugins/Hosted/ProxyRuntimeObject.h: * Plugins/Hosted/ProxyRuntimeObject.mm: * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.h: * Plugins/WebBasePluginPackage.mm: * Plugins/WebJavaPlugIn.h: * Plugins/WebNetscapeContainerCheckContextInfo.h: * Plugins/WebNetscapeContainerCheckPrivate.h: * Plugins/WebNetscapeContainerCheckPrivate.mm: * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.mm: * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: * Plugins/WebPlugin.h: * Plugins/WebPluginContainer.h: * Plugins/WebPluginContainerCheck.h: * Plugins/WebPluginContainerCheck.mm: * Plugins/WebPluginContainerPrivate.h: * Plugins/WebPluginController.h: * Plugins/WebPluginController.mm: * Plugins/WebPluginDatabase.h: * Plugins/WebPluginDatabase.mm: * Plugins/WebPluginPackage.h: * Plugins/WebPluginPackage.mm: * Plugins/WebPluginRequest.h: * Plugins/WebPluginRequest.m: * Plugins/WebPluginViewFactory.h: * Plugins/WebPluginViewFactoryPrivate.h: * Plugins/WebPluginsPrivate.h: * Plugins/WebPluginsPrivate.m: * Plugins/npapi.mm: * Storage/WebDatabaseManager.mm: * Storage/WebDatabaseManagerInternal.h: * Storage/WebDatabaseManagerPrivate.h: * WebCoreSupport/SearchPopupMenuMac.mm: * WebCoreSupport/WebAlternativeTextClient.h: * WebCoreSupport/WebAlternativeTextClient.mm: * WebCoreSupport/WebCachedFramePlatformData.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebIconDatabaseClient.h: * WebCoreSupport/WebIconDatabaseClient.mm: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebJavaScriptTextInputPanel.h: * WebCoreSupport/WebJavaScriptTextInputPanel.m: * WebCoreSupport/WebSecurityOrigin.mm: * WebCoreSupport/WebSecurityOriginInternal.h: * WebCoreSupport/WebSecurityOriginPrivate.h: * WebCoreSupport/WebSystemInterface.h: * WebCoreSupport/WebSystemInterface.mm: * WebInspector/WebInspector.h: * WebInspector/WebInspector.mm: * WebInspector/WebInspectorPrivate.h: * WebInspector/WebNodeHighlight.h: * WebInspector/WebNodeHighlight.mm: * WebInspector/WebNodeHighlightView.h: * WebInspector/WebNodeHighlightView.mm: * WebInspector/WebNodeHighlighter.h: * WebInspector/WebNodeHighlighter.mm: * WebKitLegacy/MigrateHeadersToLegacy.make: * WebKitPrefix.h: * WebView/WebArchive.h: * WebView/WebArchive.mm: * WebView/WebArchiveInternal.h: * WebView/WebClipView.h: * WebView/WebClipView.mm: * WebView/WebDashboardRegion.h: * WebView/WebDashboardRegion.mm: * WebView/WebDataSource.h: * WebView/WebDataSource.mm: * WebView/WebDataSourceInternal.h: * WebView/WebDataSourcePrivate.h: * WebView/WebDelegateImplementationCaching.h: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebDocument.h: * WebView/WebDocumentInternal.h: * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: * WebView/WebDocumentPrivate.h: * WebView/WebDynamicScrollBarsViewInternal.h: * WebView/WebEditingDelegate.h: * WebView/WebEditingDelegatePrivate.h: * WebView/WebFormDelegate.h: * WebView/WebFormDelegate.m: * WebView/WebFormDelegatePrivate.h: * WebView/WebFrame.h: * WebView/WebFrame.mm: * WebView/WebFrameInternal.h: * WebView/WebFrameLoadDelegate.h: * WebView/WebFrameLoadDelegatePrivate.h: * WebView/WebFramePrivate.h: * WebView/WebFrameView.h: * WebView/WebFrameView.mm: * WebView/WebFrameViewInternal.h: * WebView/WebFrameViewPrivate.h: * WebView/WebHTMLRepresentation.h: * WebView/WebHTMLRepresentation.mm: * WebView/WebHTMLRepresentationPrivate.h: * WebView/WebHTMLView.h: * WebView/WebHTMLView.mm: * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: * WebView/WebNotification.h: * WebView/WebNotification.mm: * WebView/WebNotificationInternal.h: * WebView/WebPDFRepresentation.h: * WebView/WebPDFRepresentation.mm: * WebView/WebPDFView.h: * WebView/WebPDFView.mm: * WebView/WebPolicyDelegate.h: * WebView/WebPolicyDelegate.mm: * WebView/WebPolicyDelegatePrivate.h: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.h: * WebView/WebPreferences.mm: * WebView/WebPreferencesPrivate.h: * WebView/WebRenderLayer.h: * WebView/WebRenderLayer.mm: * WebView/WebRenderNode.h: * WebView/WebRenderNode.mm: * WebView/WebResource.h: * WebView/WebResource.mm: * WebView/WebResourceInternal.h: * WebView/WebResourceLoadDelegate.h: * WebView/WebResourceLoadDelegatePrivate.h: * WebView/WebResourcePrivate.h: * WebView/WebScriptDebugDelegate.h: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: * WebView/WebTextCompletionController.mm: * WebView/WebUIDelegate.h: * WebView/WebUIDelegatePrivate.h: * WebView/WebView.h: * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewData.mm: * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: Source/WebKit/win: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * CFDictionaryPropertyBag.cpp: * CFDictionaryPropertyBag.h: * CodeAnalysisConfig.h: * DOMCSSClasses.cpp: * DOMCSSClasses.h: * DOMCoreClasses.cpp: * DOMCoreClasses.h: * DOMEventsClasses.cpp: * DOMEventsClasses.h: * DOMHTMLClasses.cpp: * DOMHTMLClasses.h: * DefaultDownloadDelegate.cpp: * DefaultDownloadDelegate.h: * DefaultPolicyDelegate.cpp: * DefaultPolicyDelegate.h: * ForEachCoClass.cpp: * ForEachCoClass.h: * FullscreenVideoController.cpp: * FullscreenVideoController.h: * Interfaces/AccessibilityDelegate.idl: * Interfaces/DOMCSS.idl: * Interfaces/DOMCore.idl: * Interfaces/DOMEvents.idl: * Interfaces/DOMExtensions.idl: * Interfaces/DOMHTML.idl: * Interfaces/DOMPrivate.idl: * Interfaces/DOMRange.idl: * Interfaces/DOMWindow.idl: * Interfaces/IGEN_DOMObject.idl: * Interfaces/IWebArchive.idl: * Interfaces/IWebBackForwardList.idl: * Interfaces/IWebBackForwardListPrivate.idl: * Interfaces/IWebCache.idl: * Interfaces/IWebDataSource.idl: * Interfaces/IWebDatabaseManager.idl: * Interfaces/IWebDocument.idl: * Interfaces/IWebDownload.idl: * Interfaces/IWebEditingDelegate.idl: * Interfaces/IWebError.idl: * Interfaces/IWebErrorPrivate.idl: * Interfaces/IWebFormDelegate.idl: * Interfaces/IWebFrame.idl: * Interfaces/IWebFrameLoadDelegate.idl: * Interfaces/IWebFrameLoadDelegatePrivate.idl: * Interfaces/IWebFrameLoadDelegatePrivate2.idl: * Interfaces/IWebFramePrivate.idl: * Interfaces/IWebFrameView.idl: * Interfaces/IWebHTMLRepresentation.idl: * Interfaces/IWebHTTPURLResponse.idl: * Interfaces/IWebHistory.idl: * Interfaces/IWebHistoryDelegate.idl: * Interfaces/IWebHistoryItem.idl: * Interfaces/IWebHistoryItemPrivate.idl: * Interfaces/IWebHistoryPrivate.idl: * Interfaces/IWebIconDatabase.idl: * Interfaces/IWebInspector.idl: * Interfaces/IWebInspectorPrivate.idl: * Interfaces/IWebJavaScriptCollector.idl: * Interfaces/IWebKitStatistics.idl: * Interfaces/IWebMutableURLRequest.idl: * Interfaces/IWebMutableURLRequestPrivate.idl: * Interfaces/IWebNavigationData.idl: * Interfaces/IWebNotification.idl: * Interfaces/IWebNotificationCenter.idl: * Interfaces/IWebNotificationObserver.idl: * Interfaces/IWebPolicyDelegate.idl: * Interfaces/IWebPolicyDelegatePrivate.idl: * Interfaces/IWebPreferences.idl: * Interfaces/IWebPreferencesPrivate.idl: * Interfaces/IWebResource.idl: * Interfaces/IWebResourceLoadDelegate.idl: * Interfaces/IWebResourceLoadDelegatePrivate.idl: * Interfaces/IWebResourceLoadDelegatePrivate2.idl: * Interfaces/IWebScriptObject.idl: * Interfaces/IWebSecurityOrigin.idl: * Interfaces/IWebSerializedJSValuePrivate.idl: * Interfaces/IWebTextRenderer.idl: * Interfaces/IWebUIDelegate.idl: * Interfaces/IWebUIDelegatePrivate.idl: * Interfaces/IWebURLAuthenticationChallenge.idl: * Interfaces/IWebURLRequest.idl: * Interfaces/IWebURLResponse.idl: * Interfaces/IWebURLResponsePrivate.idl: * Interfaces/IWebUndoManager.idl: * Interfaces/IWebUndoTarget.idl: * Interfaces/IWebView.idl: * Interfaces/IWebViewPrivate.idl: * Interfaces/WebKit.idl: * Interfaces/WebScrollbarTypes.idl: * MarshallingHelpers.cpp: * MarshallingHelpers.h: * MemoryStream.cpp: * MemoryStream.h: * ProgIDMacros.h: * WebActionPropertyBag.cpp: * WebActionPropertyBag.h: * WebBackForwardList.cpp: * WebBackForwardList.h: * WebCache.cpp: * WebCache.h: * WebCachedFramePlatformData.h: * WebCoreSupport/WebChromeClient.cpp: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebDragClient.cpp: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebEditorClient.cpp: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebFrameLoaderClient.cpp: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebInspectorClient.cpp: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorDelegate.cpp: * WebCoreSupport/WebInspectorDelegate.h: * WebDataSource.cpp: * WebDataSource.h: * WebDatabaseManager.cpp: * WebDatabaseManager.h: * WebDocumentLoader.cpp: * WebDocumentLoader.h: * WebDownload.cpp: * WebDownload.h: * WebDownloadCFNet.cpp: * WebDownloadCurl.cpp: * WebDropSource.cpp: * WebDropSource.h: * WebElementPropertyBag.cpp: * WebElementPropertyBag.h: * WebError.cpp: * WebError.h: * WebFrame.cpp: * WebFrame.h: * WebFramePolicyListener.cpp: * WebFramePolicyListener.h: * WebHTMLRepresentation.cpp: * WebHTMLRepresentation.h: * WebHistory.cpp: * WebHistory.h: * WebHistoryItem.cpp: * WebHistoryItem.h: * WebIconDatabase.cpp: * WebIconDatabase.h: * WebInspector.cpp: * WebInspector.h: * WebJavaScriptCollector.cpp: * WebJavaScriptCollector.h: * WebKitCOMAPI.cpp: * WebKitCOMAPI.h: * WebKitClassFactory.cpp: * WebKitClassFactory.h: * WebKitDLL.cpp: * WebKitDLL.h: * WebKitGraphics.cpp: * WebKitGraphics.h: * WebKitLogging.cpp: * WebKitLogging.h: * WebKitPrefix.cpp: * WebKitPrefix.h: * WebKitStatistics.cpp: * WebKitStatistics.h: * WebKitStatisticsPrivate.h: * WebKitSystemBits.cpp: * WebKitSystemBits.h: * WebLocalizableStrings.cpp: * WebLocalizableStrings.h: * WebMutableURLRequest.cpp: * WebMutableURLRequest.h: * WebNavigationData.cpp: * WebNavigationData.h: * WebNodeHighlight.cpp: * WebNodeHighlight.h: * WebNotification.cpp: * WebNotification.h: * WebNotificationCenter.cpp: * WebNotificationCenter.h: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: * WebPreferences.h: * WebResource.cpp: * WebResource.h: * WebScriptObject.cpp: * WebScriptObject.h: * WebSecurityOrigin.cpp: * WebSecurityOrigin.h: * WebTextRenderer.cpp: * WebTextRenderer.h: * WebURLAuthenticationChallenge.cpp: * WebURLAuthenticationChallenge.h: * WebURLAuthenticationChallengeSender.cpp: * WebURLAuthenticationChallengeSender.h: * WebURLAuthenticationChallengeSenderCFNet.cpp: * WebURLAuthenticationChallengeSenderCurl.cpp: * WebURLCredential.cpp: * WebURLCredential.h: * WebURLProtectionSpace.cpp: * WebURLProtectionSpace.h: * WebURLResponse.cpp: * WebURLResponse.h: * WebView.cpp: * WebView.h: Source/WebKit2: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * Shared/AsyncRequest.cpp: * Shared/AsyncRequest.h: * Shared/ContextMenuContextData.cpp: * Shared/ContextMenuContextData.h: * Shared/Databases/DatabaseProcessCreationParameters.h: * Shared/Databases/IndexedDB/IDBUtilities.cpp: * Shared/Databases/IndexedDB/IDBUtilities.h: * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: Removed. * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: Removed. * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKNavigationResponse.h: Removed. * UIProcess/API/Cocoa/WKNavigationTrigger.h: Added. (NS_ENUM): * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: * WebProcess/Databases/WebToDatabaseProcessConnection.h: * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp: * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: Source/WTF: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * wtf/ASCIICType.h: * wtf/AVLTree.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/AutodrainedPoolMac.mm: * wtf/BoundsCheckedPointer.h: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/ExportMacros.h: * wtf/FeatureDefines.h: * wtf/GetPtr.h: * wtf/HashIterators.h: * wtf/Locker.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/Platform.h: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RedBlackTree.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/SegmentedVector.h: * wtf/StackBounds.h: * wtf/StaticConstructors.h: * wtf/StringExtras.h: * wtf/ThreadFunctionInvocation.h: * wtf/ThreadSafeRefCounted.h: * wtf/ThreadSpecific.h: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WTFThreadData.cpp: * wtf/WTFThreadData.h: * wtf/efl/OwnPtrEfl.cpp: * wtf/mac/MainThreadMac.mm: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.h: * wtf/text/Base64.h: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/LChar.h: * wtf/text/cf/StringCF.cpp: * wtf/text/mac/StringMac.mm: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: * wtf/unicode/icu/CollatorICU.cpp: * wtf/win/MainThreadWin.cpp: Tools: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * BuildSlaveSupport/build-launcher-app: * BuildSlaveSupport/build-launcher-dmg: * DumpRenderTree/DumpRenderTree.h: * DumpRenderTree/DumpRenderTreePrefix.h: * DumpRenderTree/GCController.cpp: * DumpRenderTree/GCController.h: * DumpRenderTree/JavaScriptThreading.cpp: * DumpRenderTree/JavaScriptThreading.h: * DumpRenderTree/PixelDumpSupport.cpp: * DumpRenderTree/PixelDumpSupport.h: * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: * DumpRenderTree/TestRunner.cpp: * DumpRenderTree/TestRunner.h: * DumpRenderTree/WorkQueue.cpp: * DumpRenderTree/WorkQueue.h: * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/atk/AccessibilityCallbacks.h: * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp: * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp: * DumpRenderTree/cairo/PixelDumpSupportCairo.h: * DumpRenderTree/cg/PixelDumpSupportCG.cpp: * DumpRenderTree/cg/PixelDumpSupportCG.h: * DumpRenderTree/efl/EditingCallbacks.cpp: * DumpRenderTree/efl/EditingCallbacks.h: * DumpRenderTree/efl/EventSender.cpp: * DumpRenderTree/efl/EventSender.h: * DumpRenderTree/efl/GCControllerEfl.cpp: * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: * DumpRenderTree/efl/TestRunnerEfl.cpp: * DumpRenderTree/gtk/DumpRenderTree.cpp: * DumpRenderTree/gtk/DumpRenderTreeGtk.h: * DumpRenderTree/gtk/EditingCallbacks.cpp: * DumpRenderTree/gtk/EditingCallbacks.h: * DumpRenderTree/gtk/EventSender.cpp: * DumpRenderTree/gtk/EventSender.h: * DumpRenderTree/gtk/GCControllerGtk.cpp: * DumpRenderTree/gtk/PixelDumpSupportGtk.cpp: * DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp: * DumpRenderTree/gtk/SelfScrollingWebKitWebView.h: * DumpRenderTree/gtk/TestRunnerGtk.cpp: * DumpRenderTree/gtk/TextInputController.cpp: * DumpRenderTree/gtk/TextInputController.h: * DumpRenderTree/ios/PerlSupport/IPhoneSimulatorNotification/Makefile.PL: * DumpRenderTree/ios/PerlSupport/IPhoneSimulatorNotification/lib/IPhoneSimulatorNotification.pm: * DumpRenderTree/ios/PixelDumpSupportIOS.mm: * DumpRenderTree/mac/AppleScriptController.h: * DumpRenderTree/mac/AppleScriptController.m: * DumpRenderTree/mac/CheckedMalloc.cpp: * DumpRenderTree/mac/CheckedMalloc.h: * DumpRenderTree/mac/DumpRenderTree.mm: * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.h: * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm: * DumpRenderTree/mac/DumpRenderTreeMac.h: * DumpRenderTree/mac/DumpRenderTreePasteboard.h: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: * DumpRenderTree/mac/DumpRenderTreeWindow.h: * DumpRenderTree/mac/DumpRenderTreeWindow.mm: * DumpRenderTree/mac/EditingDelegate.h: * DumpRenderTree/mac/EditingDelegate.mm: * DumpRenderTree/mac/EventSendingController.h: * DumpRenderTree/mac/EventSendingController.mm: * DumpRenderTree/mac/FrameLoadDelegate.h: * DumpRenderTree/mac/FrameLoadDelegate.mm: * DumpRenderTree/mac/GCControllerMac.mm: * DumpRenderTree/mac/MockWebNotificationProvider.h: * DumpRenderTree/mac/MockWebNotificationProvider.mm: * DumpRenderTree/mac/NavigationController.h: * DumpRenderTree/mac/NavigationController.m: * DumpRenderTree/mac/ObjCController.h: * DumpRenderTree/mac/ObjCController.m: * DumpRenderTree/mac/ObjCPlugin.h: * DumpRenderTree/mac/ObjCPlugin.m: * DumpRenderTree/mac/ObjCPluginFunction.h: * DumpRenderTree/mac/ObjCPluginFunction.m: * DumpRenderTree/mac/PixelDumpSupportMac.mm: * DumpRenderTree/mac/PolicyDelegate.h: * DumpRenderTree/mac/PolicyDelegate.mm: * DumpRenderTree/mac/ResourceLoadDelegate.h: * DumpRenderTree/mac/ResourceLoadDelegate.mm: * DumpRenderTree/mac/TestRunnerMac.mm: * DumpRenderTree/mac/TextInputController.h: * DumpRenderTree/mac/TextInputController.m: * DumpRenderTree/mac/UIDelegate.h: * DumpRenderTree/mac/UIDelegate.mm: * DumpRenderTree/mac/WorkQueueItemMac.mm: * DumpRenderTree/win/DRTDataObject.cpp: * DumpRenderTree/win/DRTDataObject.h: * DumpRenderTree/win/DRTDesktopNotificationPresenter.h: * DumpRenderTree/win/DRTDropSource.cpp: * DumpRenderTree/win/DRTDropSource.h: * DumpRenderTree/win/DraggingInfo.h: * DumpRenderTree/win/DumpRenderTree.cpp: * DumpRenderTree/win/DumpRenderTreeWin.h: * DumpRenderTree/win/EditingDelegate.cpp: * DumpRenderTree/win/EditingDelegate.h: * DumpRenderTree/win/EventSender.cpp: * DumpRenderTree/win/EventSender.h: * DumpRenderTree/win/FrameLoadDelegate.cpp: * DumpRenderTree/win/FrameLoadDelegate.h: * DumpRenderTree/win/GCControllerWin.cpp: * DumpRenderTree/win/HistoryDelegate.cpp: * DumpRenderTree/win/HistoryDelegate.h: * DumpRenderTree/win/MD5.cpp: * DumpRenderTree/win/MD5.h: * DumpRenderTree/win/PixelDumpSupportWin.cpp: * DumpRenderTree/win/PolicyDelegate.cpp: * DumpRenderTree/win/PolicyDelegate.h: * DumpRenderTree/win/ResourceLoadDelegate.cpp: * DumpRenderTree/win/ResourceLoadDelegate.h: * DumpRenderTree/win/TestRunnerWin.cpp: * DumpRenderTree/win/TextInputController.cpp: * DumpRenderTree/win/TextInputController.h: * DumpRenderTree/win/TextInputControllerWin.cpp: * DumpRenderTree/win/UIDelegate.cpp: * DumpRenderTree/win/UIDelegate.h: * DumpRenderTree/win/WorkQueueItemWin.cpp: * EWebLauncher/main.c: * GtkLauncher/main.c: * ImageDiff/efl/ImageDiff.cpp: * ImageDiff/gtk/ImageDiff.cpp: * MiniBrowser/gtk/main.c: * Scripts/SpacingHeuristics.pm: * Scripts/VCSUtils.pm: * Scripts/bisect-builds: * Scripts/build-dumprendertree: * Scripts/build-jsc: * Scripts/build-webkit: * Scripts/check-dom-results: * Scripts/check-for-exit-time-destructors: * Scripts/check-for-global-initializers: * Scripts/commit-log-editor: * Scripts/compare-timing-files: * Scripts/debug-minibrowser: * Scripts/debug-safari: * Scripts/do-file-rename: * Scripts/find-extra-includes: * Scripts/generate-coverage-data: * Scripts/make-script-test-wrappers: * Scripts/malloc-tree: * Scripts/old-run-webkit-tests: * Scripts/parse-malloc-history: * Scripts/report-include-statistics: * Scripts/resolve-ChangeLogs: * Scripts/run-bindings-tests: * Scripts/run-iexploder-tests: * Scripts/run-javascriptcore-tests: * Scripts/run-jsc: * Scripts/run-launcher: * Scripts/run-leaks: * Scripts/run-mangleme-tests: * Scripts/run-minibrowser: * Scripts/run-pageloadtest: * Scripts/run-regexp-tests: * Scripts/run-safari: * Scripts/run-sunspider: * Scripts/run-webkit-app: * Scripts/sampstat: * Scripts/set-webkit-configuration: * Scripts/sort-Xcode-project-file: * Scripts/sort-export-file: * Scripts/split-file-by-class: * Scripts/sunspider-compare-results: * Scripts/svn-apply: * Scripts/svn-create-patch: * Scripts/svn-unapply: * Scripts/test-webkit-scripts: * Scripts/update-javascriptcore-test-results: * Scripts/update-webkit: * Scripts/update-webkit-auxiliary-libs: * Scripts/update-webkit-dependency: * Scripts/update-webkit-localizable-strings: * Scripts/update-webkit-support-libs: * Scripts/update-webkit-wincairo-libs: * Scripts/webkit-build-directory: * Scripts/webkitdirs.pm: (installedSafariPath): * Scripts/webkitperl/VCSUtils_unittest/parseChunkRange.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl: * Scripts/webkitperl/features.pm: * Scripts/webkitperl/httpd.pm: * Scripts/webkitpy/bindings/main.py: * Scripts/webkitpy/to_be_moved/update_webgl_conformance_tests.py: * TestWebKitAPI/Tests/WTF/MediaTime.cpp: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: * TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp: * TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp: * TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm: * WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp: * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp: * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.h: * WebKitTestRunner/PixelDumpSupport.cpp: * WebKitTestRunner/PixelDumpSupport.h: * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: * WinLauncher/WinLauncher.cpp: * WinLauncher/WinLauncher.h: * WinLauncher/stdafx.cpp: * WinLauncher/stdafx.h: WebKitLibraries: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * win/include/WebKitSystemInterface/WebKitSystemInterface.h: * win/tools/scripts/auto-version.sh: Websites/webkit.org: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * blog/wp-content/textfield_screenshot.jpg: * misc/WebKitDetect.html: * misc/WebKitDetect.js: * perf/sunspider-0.9.1/sunspider-0.9.1/driver.html: * perf/sunspider-0.9.1/sunspider-0.9.1/results.html: * perf/sunspider-0.9.1/sunspider-0.9.1/sunspider-test-contents.js: * perf/sunspider-0.9.1/sunspider-0.9/driver.html: * perf/sunspider-0.9.1/sunspider-0.9/results.html: * perf/sunspider-0.9.1/sunspider-0.9/sunspider-test-contents.js: * perf/sunspider-0.9.1/sunspider-analyze-results.js: * perf/sunspider-0.9.1/sunspider-compare-results.js: * perf/sunspider-0.9/3d-cube.html: * perf/sunspider-0.9/3d-morph.html: * perf/sunspider-0.9/3d-raytrace.html: * perf/sunspider-0.9/access-binary-trees.html: * perf/sunspider-0.9/access-fannkuch.html: * perf/sunspider-0.9/access-nbody.html: * perf/sunspider-0.9/access-nsieve.html: * perf/sunspider-0.9/bitops-3bit-bits-in-byte.html: * perf/sunspider-0.9/bitops-bits-in-byte.html: * perf/sunspider-0.9/bitops-bitwise-and.html: * perf/sunspider-0.9/bitops-nsieve-bits.html: * perf/sunspider-0.9/controlflow-recursive.html: * perf/sunspider-0.9/crypto-aes.html: * perf/sunspider-0.9/crypto-md5.html: * perf/sunspider-0.9/crypto-sha1.html: * perf/sunspider-0.9/date-format-tofte.html: * perf/sunspider-0.9/date-format-xparb.html: * perf/sunspider-0.9/math-cordic.html: * perf/sunspider-0.9/math-partial-sums.html: * perf/sunspider-0.9/math-spectral-norm.html: * perf/sunspider-0.9/regexp-dna.html: * perf/sunspider-0.9/string-base64.html: * perf/sunspider-0.9/string-fasta.html: * perf/sunspider-0.9/string-tagcloud.html: * perf/sunspider-0.9/string-unpack-code.html: * perf/sunspider-0.9/string-validate-input.html: * perf/sunspider-0.9/sunspider-analyze-results.js: * perf/sunspider-0.9/sunspider-compare-results.js: * perf/sunspider-0.9/sunspider-driver.html: * perf/sunspider-0.9/sunspider-record-result.js: * perf/sunspider-0.9/sunspider-results.html: * perf/sunspider-1.0.1/sunspider-1.0.1/driver.html: * perf/sunspider-1.0.1/sunspider-1.0.1/results.html: * perf/sunspider-1.0.1/sunspider-1.0.1/sunspider-test-contents.js: * perf/sunspider-1.0.1/sunspider-analyze-results.js: * perf/sunspider-1.0.1/sunspider-compare-results.js: * perf/sunspider-1.0.1/sunspider.html: * perf/sunspider-1.0.2/sunspider-1.0.2/driver.html: * perf/sunspider-1.0.2/sunspider-1.0.2/results.html: * perf/sunspider-1.0.2/sunspider-1.0.2/sunspider-test-contents.js: * perf/sunspider-1.0.2/sunspider-analyze-results.js: * perf/sunspider-1.0.2/sunspider-compare-results.js: * perf/sunspider-1.0.2/sunspider.html: * perf/sunspider-1.0/sunspider-1.0/driver.html: * perf/sunspider-1.0/sunspider-1.0/results.html: * perf/sunspider-1.0/sunspider-1.0/sunspider-test-contents.js: * perf/sunspider-1.0/sunspider-analyze-results.js: * perf/sunspider-1.0/sunspider-compare-results.js: * perf/sunspider-1.0/sunspider.html: * perf/sunspider/sunspider.html: * perf/sunspider/versions.html: * quality/reporting.html: LayoutTests: Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers https://bugs.webkit.org/show_bug.cgi?id=130276 <rdar://problem/16266927> Reviewed by Simon Fraser. * editing/resources/TIFF-pasteboard-data.dat: * fast/backgrounds/repeat/resources/gradient.gif: * fast/forms/resources/apple.gif: * http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: * webgl/1.0.1/resources/webgl_test_files/conformance/attribs/gl-vertexattribpointer-offsets.html: * webgl/1.0.1/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html: * webgl/1.0.1/resources/webgl_test_files/conformance/context/incorrect-context-object-behaviour.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/bad-arguments-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/invalid-passed-params.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/null-object-behaviour.html: * webgl/1.0.1/resources/webgl_test_files/conformance/misc/type-conversion-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/programs/get-active-test.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/draw-arrays-out-of-bounds.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/draw-elements-out-of-bounds.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/line-loop-tri-fan.html: * webgl/1.0.1/resources/webgl_test_files/conformance/rendering/triangle.html: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/vertexShader.vert: * webgl/1.0.1/resources/webgl_test_files/conformance/resources/webgl-test.js: * webgl/1.0.1/resources/webgl_test_files/conformance/state/gl-get-calls.html: * webgl/1.0.1/resources/webgl_test_files/conformance/state/gl-object-get-calls.html: * webgl/1.0.1/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html: * webgl/1.0.1/resources/webgl_test_files/extra/canvas-compositing-test.html: * webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert: * webgl/resources/webgl_test_files/conformance/resources/fragmentShader.frag: * webgl/resources/webgl_test_files/conformance/resources/vertexShader.vert: Canonical link: https://commits.webkit.org/148261@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-03-15 04:08:27 +00:00
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
*/
#include "config.h"
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
#include <wtf/MetaAllocator.h>
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
#include <wtf/NeverDestroyed.h>
#include <wtf/WTFConfig.h>
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
namespace WTF {
Experiment: create lots of different malloc zones for easier accounting of memory use https://bugs.webkit.org/show_bug.cgi?id=186422 Patch by Yusuke Suzuki <ysuzuki@apple.com> and Simon Fraser <simon.fraser@apple.com> on 2020-01-02 Reviewed by Saam Barati. Source/bmalloc: * bmalloc/BPlatform.h: * bmalloc/Environment.cpp: (bmalloc::Environment::computeIsDebugHeapEnabled): * bmalloc/IsoHeap.h: (bmalloc::api::IsoHeap::IsoHeap): * bmalloc/IsoHeapInlines.h: (bmalloc::api::IsoHeap<Type>::IsoHeap): * bmalloc/IsoTLSInlines.h: (bmalloc::IsoTLS::allocateSlow): (bmalloc::IsoTLS::deallocateSlow): Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/AssemblerBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * assembler/AssemblerBuffer.h: (JSC::AssemblerData::AssemblerData): (JSC::AssemblerData::operator=): (JSC::AssemblerData::~AssemblerData): (JSC::AssemblerData::grow): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/BytecodeBasicBlock.cpp: * bytecode/BytecodeBasicBlock.h: * bytecode/CodeBlock.cpp: * bytecode/CodeBlock.h: * bytecode/InstructionStream.cpp: * bytecode/InstructionStream.h: * bytecode/PolymorphicAccess.cpp: * bytecode/PolymorphicAccess.h: * bytecode/UnlinkedMetadataTable.cpp: (JSC::UnlinkedMetadataTable::finalize): * bytecode/UnlinkedMetadataTable.h: * bytecode/UnlinkedMetadataTableInlines.h: (JSC::UnlinkedMetadataTable::UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::~UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::link): (JSC::UnlinkedMetadataTable::unlink): * bytecode/ValueProfile.h: (JSC::ValueProfileAndVirtualRegisterBuffer::ValueProfileAndVirtualRegisterBuffer): * bytecode/Watchpoint.cpp: * bytecode/Watchpoint.h: * dfg/DFGBasicBlock.cpp: * dfg/DFGBasicBlock.h: * dfg/DFGNode.cpp: * dfg/DFGNode.h: * dfg/DFGSpeculativeJIT.cpp: * dfg/DFGSpeculativeJIT.h: * heap/BlockDirectory.cpp: * heap/BlockDirectory.h: * heap/FastMallocAlignedMemoryAllocator.cpp: (JSC::FastMallocAlignedMemoryAllocator::FastMallocAlignedMemoryAllocator): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::freeAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateMemory): (JSC::FastMallocAlignedMemoryAllocator::freeMemory): (JSC::FastMallocAlignedMemoryAllocator::tryReallocateMemory): * heap/FastMallocAlignedMemoryAllocator.h: * heap/GCSegmentedArray.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * heap/GCSegmentedArray.h: * heap/GCSegmentedArrayInlines.h: (JSC::GCArraySegment<T>::create): (JSC::GCArraySegment<T>::destroy): * heap/GigacageAlignedMemoryAllocator.cpp: (JSC::GigacageAlignedMemoryAllocator::GigacageAlignedMemoryAllocator): (JSC::GigacageAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::freeAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::tryAllocateMemory): (JSC::GigacageAlignedMemoryAllocator::freeMemory): (JSC::GigacageAlignedMemoryAllocator::tryReallocateMemory): * heap/GigacageAlignedMemoryAllocator.h: * heap/IsoAlignedMemoryAllocator.cpp: (JSC::IsoAlignedMemoryAllocator::IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::~IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::IsoAlignedMemoryAllocator::freeAlignedMemory): (JSC::IsoAlignedMemoryAllocator::tryAllocateMemory): (JSC::IsoAlignedMemoryAllocator::freeMemory): * heap/IsoAlignedMemoryAllocator.h: * heap/IsoSubspace.cpp: (JSC::IsoSubspace::IsoSubspace): * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: * heap/WeakBlock.cpp: (JSC::WeakBlock::create): (JSC::WeakBlock::destroy): * heap/WeakBlock.h: * jit/JITCode.cpp: * jit/JITCode.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * parser/Nodes.cpp: * parser/Nodes.h: * parser/ParserArena.cpp: (JSC::ParserArena::deallocateObjects): (JSC::ParserArena::allocateFreeablePool): * parser/ParserArena.h: * parser/SourceProvider.cpp: * parser/SourceProvider.h: * parser/SourceProviderCache.cpp: * parser/SourceProviderCache.h: * parser/SourceProviderCacheItem.h: (JSC::SourceProviderCacheItem::create): * runtime/CachePayload.cpp: (JSC::CachePayload::makeMallocPayload): * runtime/CachePayload.h: * runtime/CachedBytecode.h: (JSC::CachedBytecode::create): * runtime/CachedTypes.cpp: (JSC::Encoder::release): (JSC::Encoder::Page::Page): (JSC::CachedVector::encode): (JSC::CachedVector::decode const): (JSC::CachedInstructionStream::decode const): * runtime/PropertyMapHashTable.h: (JSC::PropertyTable::rehash): * runtime/PropertyTable.cpp: (JSC::PropertyTable::PropertyTable): (JSC::PropertyTable::~PropertyTable): * runtime/SymbolTable.cpp: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::~VM): * runtime/VM.h: (JSC::ScratchBuffer::create): (JSC::VM::exceptionFuzzingBuffer): * wasm/WasmInstance.cpp: (JSC::Wasm::Instance::Instance): * wasm/WasmInstance.h: * wasm/WasmTable.cpp: (JSC::Wasm::Table::Table): (JSC::Wasm::FuncRefTable::FuncRefTable): * wasm/WasmTable.h: Source/WebCore: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * css/CSSFontFace.cpp: * css/CSSFontFace.h: * css/CSSSelector.cpp: * css/CSSSelector.h: * css/CSSValue.cpp: * css/CSSValue.h: * css/StyleProperties.cpp: (WebCore::ImmutableStyleProperties::create): * css/StyleProperties.h: * css/StyleRule.cpp: * css/StyleRule.h: * dom/ElementData.cpp: (WebCore::ShareableElementData::createWithAttributes): (WebCore::UniqueElementData::makeShareableCopy const): * dom/ElementData.h: * dom/NodeRareData.cpp: * dom/NodeRareData.h: * dom/QualifiedName.cpp: * dom/QualifiedName.h: * html/parser/HTMLDocumentParser.cpp: * html/parser/HTMLDocumentParser.h: * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/cache/CachedResource.cpp: * loader/cache/CachedResource.h: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontCascadeFonts.cpp: * platform/graphics/FontCascadeFonts.h: * platform/graphics/Region.cpp: * platform/graphics/Region.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::releaseUint8Vector): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::Buffer): * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandleInternal.h: * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::closeCurrentStream): (WebCore::advanceCurrentStream): * rendering/RenderLayer.cpp: * rendering/RenderLayer.h: * rendering/TableLayout.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * rendering/TableLayout.h: * rendering/style/RenderStyle.cpp: * rendering/style/RenderStyle.h: * rendering/style/SVGRenderStyle.cpp: * rendering/style/SVGRenderStyle.h: * rendering/style/SVGRenderStyleDefs.cpp: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleBoxData.cpp: * rendering/style/StyleBoxData.h: * rendering/style/StyleInheritedData.cpp: * rendering/style/StyleInheritedData.h: * rendering/style/StyleRareInheritedData.cpp: * rendering/style/StyleRareInheritedData.h: * rendering/style/StyleRareNonInheritedData.cpp: * rendering/style/StyleRareNonInheritedData.h: * rendering/style/StyleSurroundData.cpp: * rendering/style/StyleSurroundData.h: * rendering/style/StyleTransformData.cpp: * rendering/style/StyleTransformData.h: * style/StyleTreeResolver.cpp: * style/StyleTreeResolver.h: * svg/animation/SMILTimeContainer.cpp: * svg/animation/SMILTimeContainer.h: Source/WebKit: * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::~ShareableBitmap): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionState): Source/WTF: This patch introduces ENABLE(MALLOC_HEAP_BREAKDOWN). If this is enabled, we allocate malloc_zone per malloc kind. This offers the way to investigate the usage of memory per kind by using vmmap, like the following. VIRTUAL RESIDENT DIRTY SWAPPED ALLOCATION BYTES DIRTY+SWAP REGION MALLOC ZONE SIZE SIZE SIZE SIZE COUNT ALLOCATED FRAG SIZE % FRAG COUNT =========== ======= ========= ========= ========= ========= ========= ========= ====== ====== StringImpl_0x116efd000 188.0M 69.3M 30.9M 0K 139456 18.0M 12.9M 42% 34 DefaultMallocZone_0x10f487000 176.0M 53.9M 14.1M 0K 115956 9955K 4497K 32% 22 Vector_0x116eff000 162.0M 56.3M 55.3M 0K 140715 17.3M 37.9M 69% 36 MetadataTable_0x11843b000 152.0M 17.5M 17.5M 0K 14200 2353K 15.2M 87% 26 WebKit Using System Malloc_0x114cbe000 150.0M 31.6M 21.8M 0K 87422 16.7M 5278K 24% 23 InstructionStream_0x118469000 150.0M 5764K 5764K 0K 14470 4688K 1076K 19% 24 AssemblerData_0x117ee6000 150.0M 1928K 1928K 0K 1 16 1928K 100% 24 To achieve this goal without making very large change, we put a template type in various containers. For example, Vector will take Malloc parameter (the default one is FastMalloc allocator). If ENABLE(MALLOC_HEAP_BREAKDOWN) is enabled, we change this to specific VectorMalloc allocator, and vmmap can show memory usage of this allocator. This patch also supports malloc_zone per IsoHeap. So we can see memory allocation per IsoHeap in vmmap. To use this feature, we need to flip two compile time flags, ENABLE(MALLOC_HEAP_BREAKDOWN) in WTF and BENABLE_MALLOC_HEAP_BREAKDOWN in bmalloc. And use `vmmap $PID` to dump malloc zones. To allocate objects of a class with a specific malloc-zone, use WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(HeapIdentifier) for the class, and define allocator by DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a header and DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a cpp file. This patch also introduce callstack collector for malloc. Vector, HashMap etc. are used to allocate various things, but the above malloc_zone feature only tells thing like "Vector takes XXX MB memory". But what we want to know in this case is what Vector is consuming memory. We collect StackShot for each malloc call, and combine these information to tell which callsite is consuming much memory, which tell us that what Vector is consuming memory. * WTF.xcodeproj/project.pbxproj: * wtf/Bag.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/Bag.h: (WTF::Private::BagNode::BagNode): Deleted. * wtf/BitVector.cpp: (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): * wtf/CMakeLists.txt: * wtf/ConcurrentBuffer.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/ConcurrentBuffer.h: * wtf/DebugHeap.cpp: Copied from Source/JavaScriptCore/runtime/CachePayload.cpp. (WTF::DebugHeap::DebugHeap): (WTF::DebugHeap::malloc): (WTF::DebugHeap::calloc): (WTF::DebugHeap::memalign): (WTF::DebugHeap::realloc): (WTF::DebugHeap::free): * wtf/DebugHeap.h: Added. * wtf/FastBitVector.cpp: (WTF::FastBitVectorWordOwner::setEqualsSlow): (WTF::FastBitVectorWordOwner::resizeSlow): * wtf/FastBitVector.h: (WTF::FastBitVectorWordOwner::~FastBitVectorWordOwner): * wtf/FastMalloc.cpp: (WTF::fastMallocDumpMallocStats): (WTF::AvoidRecordingScope::AvoidRecordingScope): (WTF::AvoidRecordingScope::~AvoidRecordingScope): (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): (WTF::MallocCallTracker::singleton): (WTF::MallocCallTracker::MallocCallTracker): (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): (WTF::fastMalloc): (WTF::fastRealloc): (WTF::fastFree): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): (WTF::fastAlignedFree): * wtf/FastMalloc.h: (WTF::FastMalloc::zeroedMalloc): (WTF::FastMalloc::tryZeroedMalloc): * wtf/Forward.h: * wtf/HashTable.cpp: * wtf/HashTable.h: (WTF::KeyTraits>::allocateTable): (WTF::KeyTraits>::deallocateTable): (WTF::KeyTraits>::rehash): * wtf/MallocPtr.h: (WTF::MallocPtr::MallocPtr): (WTF::MallocPtr::malloc): (WTF::MallocPtr::zeroedMalloc): (WTF::MallocPtr::tryMalloc): (WTF::MallocPtr::tryZeroedMalloc): (WTF::adoptMallocPtr): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): * wtf/MetaAllocatorHandle.h: * wtf/Platform.h: * wtf/RefCountedArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::~RefCountedArray): (WTF::RefCountedArray::assign): * wtf/SegmentedVector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SegmentedVector.h: * wtf/SmallPtrSet.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SmallPtrSet.h: (WTF::SmallPtrSet::~SmallPtrSet): (WTF::SmallPtrSet::grow): * wtf/UniqueArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/UniqueArray.h: (WTF::UniqueArrayFree::operator() const): (WTF::UniqueArrayFree<T::operator() const): * wtf/Vector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/Vector.h: (WTF::VectorBufferBase::allocateBuffer): (WTF::VectorBufferBase::tryAllocateBuffer): (WTF::VectorBufferBase::reallocateBuffer): (WTF::VectorBufferBase::deallocateBuffer): (WTF::VectorBufferBase::releaseBuffer): (WTF::VectorBuffer::releaseBuffer): (WTF::Vector::swap): (WTF::Malloc>::Vector): (WTF::=): (WTF::Malloc>::contains const): (WTF::Malloc>::findMatching const): (WTF::Malloc>::find const): (WTF::Malloc>::reverseFind const): (WTF::Malloc>::appendIfNotContains): (WTF::Malloc>::fill): (WTF::Malloc>::appendRange): (WTF::Malloc>::expandCapacity): (WTF::Malloc>::tryExpandCapacity): (WTF::Malloc>::resize): (WTF::Malloc>::resizeToFit): (WTF::Malloc>::shrink): (WTF::Malloc>::grow): (WTF::Malloc>::asanSetInitialBufferSizeTo): (WTF::Malloc>::asanSetBufferSizeToFullCapacity): (WTF::Malloc>::asanBufferSizeWillChangeTo): (WTF::Malloc>::reserveCapacity): (WTF::Malloc>::tryReserveCapacity): (WTF::Malloc>::reserveInitialCapacity): (WTF::Malloc>::shrinkCapacity): (WTF::Malloc>::append): (WTF::Malloc>::tryAppend): (WTF::Malloc>::constructAndAppend): (WTF::Malloc>::tryConstructAndAppend): (WTF::Malloc>::appendSlowCase): (WTF::Malloc>::constructAndAppendSlowCase): (WTF::Malloc>::tryConstructAndAppendSlowCase): (WTF::Malloc>::uncheckedAppend): (WTF::Malloc>::uncheckedConstructAndAppend): (WTF::Malloc>::appendVector): (WTF::Malloc>::insert): (WTF::Malloc>::insertVector): (WTF::Malloc>::remove): (WTF::Malloc>::removeFirst): (WTF::Malloc>::removeFirstMatching): (WTF::Malloc>::removeAll): (WTF::Malloc>::removeAllMatching): (WTF::Malloc>::reverse): (WTF::Malloc>::map const): (WTF::Malloc>::releaseBuffer): (WTF::Malloc>::checkConsistency): (WTF::swap): (WTF::operator==): (WTF::operator!=): (WTF::Malloc>::isolatedCopy const): (WTF::removeRepeatedElements): (WTF::minCapacity>::Vector): Deleted. (WTF::minCapacity>::contains const): Deleted. (WTF::minCapacity>::findMatching const): Deleted. (WTF::minCapacity>::find const): Deleted. (WTF::minCapacity>::reverseFind const): Deleted. (WTF::minCapacity>::appendIfNotContains): Deleted. (WTF::minCapacity>::fill): Deleted. (WTF::minCapacity>::appendRange): Deleted. (WTF::minCapacity>::expandCapacity): Deleted. (WTF::minCapacity>::tryExpandCapacity): Deleted. (WTF::minCapacity>::resize): Deleted. (WTF::minCapacity>::resizeToFit): Deleted. (WTF::minCapacity>::shrink): Deleted. (WTF::minCapacity>::grow): Deleted. (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted. (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted. (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted. (WTF::minCapacity>::reserveCapacity): Deleted. (WTF::minCapacity>::tryReserveCapacity): Deleted. (WTF::minCapacity>::reserveInitialCapacity): Deleted. (WTF::minCapacity>::shrinkCapacity): Deleted. (WTF::minCapacity>::append): Deleted. (WTF::minCapacity>::tryAppend): Deleted. (WTF::minCapacity>::constructAndAppend): Deleted. (WTF::minCapacity>::tryConstructAndAppend): Deleted. (WTF::minCapacity>::appendSlowCase): Deleted. (WTF::minCapacity>::constructAndAppendSlowCase): Deleted. (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted. (WTF::minCapacity>::uncheckedAppend): Deleted. (WTF::minCapacity>::uncheckedConstructAndAppend): Deleted. (WTF::minCapacity>::appendVector): Deleted. (WTF::minCapacity>::insert): Deleted. (WTF::minCapacity>::insertVector): Deleted. (WTF::minCapacity>::remove): Deleted. (WTF::minCapacity>::removeFirst): Deleted. (WTF::minCapacity>::removeFirstMatching): Deleted. (WTF::minCapacity>::removeAll): Deleted. (WTF::minCapacity>::removeAllMatching): Deleted. (WTF::minCapacity>::reverse): Deleted. (WTF::minCapacity>::map const): Deleted. (WTF::minCapacity>::releaseBuffer): Deleted. (WTF::minCapacity>::checkConsistency): Deleted. (WTF::minCapacity>::isolatedCopy const): Deleted. * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: * wtf/text/StringBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): (WTF::StringBuffer::~StringBuffer): (WTF::StringBuffer::resize): (WTF::StringBuffer::release): * wtf/text/StringImpl.cpp: (WTF::StringImpl::~StringImpl): (WTF::StringImpl::destroy): (WTF::StringImpl::createUninitializedInternalNonEmpty): (WTF::StringImpl::reallocateInternal): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::adopt): * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocate): (WTF::StringWrapperCFAllocator::reallocate): (WTF::StringWrapperCFAllocator::deallocate): Canonical link: https://commits.webkit.org/218863@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-03 02:36:43 +00:00
DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(MetaAllocatorHandle);
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(MetaAllocatorFreeSpace);
DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(MetaAllocatorFreeSpace);
MetaAllocator::~MetaAllocator()
{
for (FreeSpaceNode* node = m_freeSpaceSizeMap.first(); node;) {
FreeSpaceNode* next = node->successor();
m_freeSpaceSizeMap.remove(node);
freeFreeSpaceNode(node);
node = next;
}
#ifndef NDEBUG
ASSERT(!m_mallocBalance);
#endif
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
void MetaAllocatorTracker::notify(MetaAllocatorHandle& handle)
{
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
m_allocations.insert(&handle);
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
void MetaAllocatorTracker::release(MetaAllocatorHandle& handle)
{
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
m_allocations.remove(&handle);
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
void MetaAllocator::release(const LockHolder&, MetaAllocatorHandle& handle)
{
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
if (handle.sizeInBytes()) {
MemoryPtr start = handle.start();
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
size_t sizeInBytes = handle.sizeInBytes();
decrementPageOccupancy(start.untaggedPtr(), sizeInBytes);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
addFreeSpaceFromReleasedHandle(FreeSpacePtr(start), sizeInBytes);
}
if (UNLIKELY(!!m_tracker))
m_tracker->release(handle);
}
MetaAllocatorHandle::MetaAllocatorHandle(MetaAllocator& allocator, MetaAllocatorHandle::MemoryPtr start, size_t sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
: m_allocator(allocator)
, m_start(start)
, m_end(start + sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
ASSERT(start);
ASSERT(sizeInBytes);
}
MetaAllocatorHandle::~MetaAllocatorHandle()
{
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { allocator().m_lock };
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
allocator().release(locker, *this);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
void MetaAllocatorHandle::shrink(size_t newSizeInBytes)
{
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
size_t sizeInBytes = this->sizeInBytes();
ASSERT(newSizeInBytes <= sizeInBytes);
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
MetaAllocator& allocator = this->allocator();
Replace LockHolder with Locker in local variables https://bugs.webkit.org/show_bug.cgi?id=226133 Reviewed by Darin Adler. Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock type more easily since the compiler with deduce the lock type T for Locker<T>. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSValue.mm: (handerForStructTag): * API/tests/testapi.cpp: (testCAPIViaCpp): * assembler/testmasm.cpp: (JSC::run): * b3/air/testair.cpp: * b3/testb3_1.cpp: (run): * bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): (JSC::DirectEvalCodeCache::clear): (JSC::DirectEvalCodeCache::visitAggregateImpl): * bytecode/SuperSampler.cpp: (JSC::initializeSuperSampler): (JSC::resetSuperSamplerState): (JSC::printSuperSamplerState): (JSC::enableSuperSampler): (JSC::disableSuperSampler): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::~Worklist): (JSC::DFG::Worklist::finishCreation): (JSC::DFG::Worklist::isActiveForVM const): (JSC::DFG::Worklist::enqueue): (JSC::DFG::Worklist::compilationState): (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady): (JSC::DFG::Worklist::removeAllReadyPlansForVM): (JSC::DFG::Worklist::completeAllReadyPlansForVM): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::Worklist::removeDeadPlans): (JSC::DFG::Worklist::removeNonCompilingPlansForVM): (JSC::DFG::Worklist::queueLength): (JSC::DFG::Worklist::dump const): (JSC::DFG::Worklist::setNumberOfThreads): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::addBlock): * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterateCurrentlyExecuting): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::add): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::lastChanceToFinalize): (JSC::Heap::collectAsync): (JSC::Heap::runBeginPhase): (JSC::Heap::waitForCollector): (JSC::Heap::requestCollection): (JSC::Heap::notifyIsSafeToCollect): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didReachTermination): * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::startTracking): (Inspector::InspectorScriptProfilerAgent::trackingComplete): (Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting): * inspector/remote/RemoteConnectionToTarget.cpp: (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::targetClosed): * inspector/remote/RemoteInspector.cpp: (Inspector::RemoteInspector::registerTarget): (Inspector::RemoteInspector::unregisterTarget): (Inspector::RemoteInspector::updateTarget): (Inspector::RemoteInspector::updateClientCapabilities): (Inspector::RemoteInspector::setClient): (Inspector::RemoteInspector::setupFailed): (Inspector::RemoteInspector::setupCompleted): (Inspector::RemoteInspector::stop): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): (Inspector::RemoteTargetHandleRunSourceWithInfo): (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::targetClosed): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop): * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupXPCConnectionIfNeeded): (Inspector::RemoteInspector::setParentProcessInformation): (Inspector::RemoteInspector::xpcConnectionReceivedMessage): (Inspector::RemoteInspector::xpcConnectionFailed): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::receivedIndicateMessage): (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: (Inspector::RemoteInspectorXPCConnection::close): (Inspector::RemoteInspectorXPCConnection::closeFromMessage): (Inspector::RemoteInspectorXPCConnection::deserializeMessage): (Inspector::RemoteInspectorXPCConnection::handleEvent): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupConnection): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::receivedGetTargetListMessage): (Inspector::RemoteInspector::receivedDataMessage): (Inspector::RemoteInspector::receivedCloseMessage): (Inspector::RemoteInspector::setup): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::didReceive): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::didClose): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::setup): (Inspector::RemoteInspector::setupInspectorClient): (Inspector::RemoteInspector::frontendDidClose): (Inspector::RemoteInspector::sendMessageToBackend): (Inspector::RemoteInspector::startAutomationSession): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::listenInet): (Inspector::RemoteInspectorSocketEndpoint::isListening): (Inspector::RemoteInspectorSocketEndpoint::workerThread): (Inspector::RemoteInspectorSocketEndpoint::createClient): (Inspector::RemoteInspectorSocketEndpoint::disconnect): (Inspector::RemoteInspectorSocketEndpoint::invalidateClient): (Inspector::RemoteInspectorSocketEndpoint::invalidateListener): (Inspector::RemoteInspectorSocketEndpoint::getPort const): (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::send): (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): * interpreter/CLoopStack.cpp: (JSC::CLoopStack::addToCommittedByteCount): (JSC::CLoopStack::committedByteCount): * jit/ExecutableAllocator.cpp: (JSC::dumpJITMemory): * jit/ICStats.cpp: (JSC::ICStats::ICStats): (JSC::ICStats::~ICStats): * jit/JITThunks.cpp: (JSC::JITThunks::ctiStub): (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::compileInThread): (JSC::JITWorklist::Plan::isFinishedCompiling): (JSC::JITWorklist::JITWorklist): (JSC::JITWorklist::completeAllForVM): (JSC::JITWorklist::poll): (JSC::JITWorklist::compileLater): (JSC::JITWorklist::finalizePlans): * parser/SourceProvider.cpp: (JSC::SourceProvider::getID): * profiler/ProfilerDatabase.cpp: (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::addCompilation): (JSC::Profiler::Database::logEvent): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::removeFirstAtExitDatabase): * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/DeferredWorkTimer.cpp: (JSC::DeferredWorkTimer::scheduleWorkSoon): (JSC::DeferredWorkTimer::didResumeScriptExecutionOwner): * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::timerLoop): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::registerForReportAtExit): * runtime/Watchdog.cpp: (JSC::Watchdog::startTimer): (JSC::Watchdog::willDestroyVM): * tools/VMInspector.cpp: (JSC::VMInspector::isValidExecutableMemory): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::addCompletionTask): (JSC::Wasm::Plan::waitForCompletion): (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSignature.cpp: (JSC::Wasm::SignatureInformation::signatureFor): (JSC::Wasm::SignatureInformation::tryCleanup): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): (JSC::Wasm::Worklist::completePlanSynchronously): (JSC::Wasm::Worklist::stopAllPlansForContext): (JSC::Wasm::Worklist::Worklist): (JSC::Wasm::Worklist::~Worklist): Source/WebCore: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::fullPathForDatabase): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNames): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::doneCreatingDatabase): (WebCore::DatabaseTracker::openDatabases): (WebCore::DatabaseTracker::addOpenDatabase): (WebCore::DatabaseTracker::removeOpenDatabase): (WebCore::DatabaseTracker::originLockFor): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::deleteDatabaseFile): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]): (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (WebCore::ImageDecoderAVFObjC::setTrack): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage): (WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::drain): (VideoRenderRequestScheduler::requestRender): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformInPlace): (sinkEventHandler): (webKitMediaCommonEncryptionDecryptIsFlushing): (setContext): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::beginPainting): (Nicosia::Buffer::completePainting): (Nicosia::Buffer::waitUntilPaintingComplete): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::setSceneIntegration): (Nicosia::PlatformLayer::createUpdateScope): (Nicosia::CompositionLayer::updateState): (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessPending): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: (Nicosia::Scene::accessState): * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: (Nicosia::SceneIntegration::setClient): (Nicosia::SceneIntegration::invalidate): (Nicosia::SceneIntegration::requestUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::load): (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::removeListener): (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameBytesAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::setTilesOpaque): (WebCore::LegacyTileCache::doLayoutTiles): (WebCore::LegacyTileCache::setCurrentScale): (WebCore::LegacyTileCache::commitScaleChange): (WebCore::LegacyTileCache::layoutTilesNow): (WebCore::LegacyTileCache::layoutTilesNowForRect): (WebCore::LegacyTileCache::removeAllNonVisibleTiles): (WebCore::LegacyTileCache::removeAllTiles): (WebCore::LegacyTileCache::removeForegroundTiles): (WebCore::LegacyTileCache::setContentReplacementImage): (WebCore::LegacyTileCache::contentReplacementImage const): (WebCore::LegacyTileCache::tileCreationTimerFired): (WebCore::LegacyTileCache::setNeedsDisplayInRect): (WebCore::LegacyTileCache::updateTilingMode): (WebCore::LegacyTileCache::setTilingMode): (WebCore::LegacyTileCache::doPendingRepaints): (WebCore::LegacyTileCache::flushSavedDisplayRects): (WebCore::LegacyTileCache::prepareToDraw): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::takeLayerWithSize): (WebCore::LegacyTileLayerPool::setCapacity): (WebCore::LegacyTileLayerPool::prune): (WebCore::LegacyTileLayerPool::drain): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow setExposedScrollViewRect:]): (-[WAKWindow exposedScrollViewRect]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::openNextStream): (WebCore::formFinalize): (WebCore::formClose): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setRequestPaused): (WebCore::CurlRequest::setCallbackPaused): (WebCore::CurlRequest::pausedStatusChanged): (WebCore::CurlRequest::enableDownloadToFile): (WebCore::CurlRequest::getDownloadedFilePath): (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled): (WebCore::CurlRequest::closeDownloadFile): (WebCore::CurlRequest::cleanupDownloadFile): * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): (WebCore::CurlSSLHandle::setClientCertificateInfo): (WebCore::CurlSSLHandle::getSSLClientCertificate const): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::runIncrementalVacuumCommand): (WebCore::SQLiteDatabase::interrupt): (WebCore::SQLiteDatabase::setAuthorizer): (WebCore::constructAndPrepareStatement): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::step): Source/WebKit: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::m_closeCallback): (WebKit::WebIDBServer::getOrigins): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::renameOrigin): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/glib/DNSCache.cpp: (WebKit::DNSCache::lookup): (WebKit::DNSCache::update): (WebKit::DNSCache::removeExpiredResponsesFired): (WebKit::DNSCache::clear): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::suspend): (WebKit::CompositingRunLoop::resume): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateTimerFired): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): Source/WebKitLegacy: * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::InProcessIDBServer): (InProcessIDBServer::deleteDatabase): (InProcessIDBServer::openDatabase): (InProcessIDBServer::abortTransaction): (InProcessIDBServer::commitTransaction): (InProcessIDBServer::didFinishHandlingVersionChangeTransaction): (InProcessIDBServer::createObjectStore): (InProcessIDBServer::deleteObjectStore): (InProcessIDBServer::renameObjectStore): (InProcessIDBServer::clearObjectStore): (InProcessIDBServer::createIndex): (InProcessIDBServer::deleteIndex): (InProcessIDBServer::renameIndex): (InProcessIDBServer::putOrAdd): (InProcessIDBServer::getRecord): (InProcessIDBServer::getAllRecords): (InProcessIDBServer::getCount): (InProcessIDBServer::deleteRecord): (InProcessIDBServer::openCursor): (InProcessIDBServer::iterateCursor): (InProcessIDBServer::establishTransaction): (InProcessIDBServer::databaseConnectionPendingClose): (InProcessIDBServer::databaseConnectionClosed): (InProcessIDBServer::abortOpenAndUpgradeNeeded): (InProcessIDBServer::didFireVersionChangeEvent): (InProcessIDBServer::openDBRequestCancelled): (InProcessIDBServer::getAllDatabaseNamesAndVersions): (InProcessIDBServer::closeAndDeleteDatabasesModifiedSince): * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::syncTimerFired): (WebKit::StorageAreaSync::performSync): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::finishedImportingOriginIdentifiers): (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): (WebKit::StorageTracker::setOriginDetails): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::origins): (WebKit::StorageTracker::deleteAllOrigins): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::deleteOrigin): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::canDeleteOrigin): (WebKit::StorageTracker::cancelDeletingOrigin): (WebKit::StorageTracker::diskUsageForOrigin): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _synchronizeCustomFixedPositionLayoutRect]): (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]): (-[WebView _setCustomFixedPositionLayoutRect:]): (-[WebView _fetchCustomFixedPositionLayoutRect:]): Source/WebKitLegacy/win: * Plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::registerPlugin): (WebCore::PluginMainThreadScheduler::unregisterPlugin): (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Source/WTF: * benchmarks/LockSpeedTest.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::~AutomaticThread): (WTF::AutomaticThread::join): (WTF::AutomaticThread::start): * wtf/AutomaticThread.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::ParallelHelperClient): (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::setTask): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::doSomeHelping): (WTF::ParallelHelperClient::runTask): (WTF::ParallelHelperPool::~ParallelHelperPool): (WTF::ParallelHelperPool::ensureThreads): (WTF::ParallelHelperPool::doSomeHelping): * wtf/Seconds.cpp: (WTF::sleep): * wtf/TimeWithDynamicClockType.cpp: (WTF::sleep): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): (WTF::WorkerPool::~WorkerPool): (WTF::WorkerPool::postTask): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): * wtf/win/DbgHelperWin.cpp: (WTF::DbgHelper::SymFromAddress): * wtf/win/ThreadingWin.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): Tools: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp: (TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn): (TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread): Canonical link: https://commits.webkit.org/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { allocator.m_lock };
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
newSizeInBytes = allocator.roundUp(newSizeInBytes);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
ASSERT(newSizeInBytes <= sizeInBytes);
if (newSizeInBytes == sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
return;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
MemoryPtr freeStart = m_start + newSizeInBytes;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
size_t freeSize = sizeInBytes - newSizeInBytes;
uintptr_t freeStartValue = freeStart.untaggedPtr<uintptr_t>();
uintptr_t freeEnd = freeStartValue + freeSize;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
uintptr_t firstCompletelyFreePage = roundUpToMultipleOf(allocator.m_pageSize, freeStartValue);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
if (firstCompletelyFreePage < freeEnd)
allocator.decrementPageOccupancy(reinterpret_cast<void*>(firstCompletelyFreePage), freeSize - (firstCompletelyFreePage - freeStartValue));
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
allocator.addFreeSpaceFromReleasedHandle(MetaAllocator::FreeSpacePtr(freeStart), freeSize);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
m_end = freeStart;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
void MetaAllocatorHandle::dump(PrintStream& out) const
{
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
out.print(RawPointer(start().untaggedPtr()), "...", RawPointer(end().untaggedPtr()));
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
MetaAllocator::MetaAllocator(Lock& lock, size_t allocationGranule, size_t pageSize)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
: m_allocationGranule(allocationGranule)
Regions should be allocated from the same contiguous segment of virtual memory https://bugs.webkit.org/show_bug.cgi?id=113662 Reviewed by Filip Pizlo. Instead of letting the OS spread our Regions all over the place, we should allocate them all within some range of each other. This change will open the door to some other optimizations, e.g. doing simple range checks for our write barriers and compressing JSCell pointers to 32-bits. Source/JavaScriptCore: Added new SuperRegion class that encapsulates allocating Regions from a contiguous reserved chunk of virtual address space. It functions very similarly to the FixedVMPoolExecutableAllocator class used by the JIT. Also added two new subclasses of Region, NormalRegion and ExcessRegion. NormalRegion is the type of Region that is normally allocated when there is available space remaining in the SuperRegion. If we ever run out of space in the SuperRegion, we fall back to allocating ExcessRegions, which are identical to how Regions have behaved up until now, i.e. they contain a PageAllocationAligned. We only use the SuperRegion (and NormalRegions) on 64-bit systems, since it doesn't make sense to reserve the entire 4 GB address space on 32-bit systems just for the JS heap. * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * heap/BlockAllocator.cpp: (JSC::BlockAllocator::BlockAllocator): * heap/BlockAllocator.h: (JSC): (BlockAllocator): (JSC::BlockAllocator::allocate): (JSC::BlockAllocator::allocateCustomSize): (JSC::BlockAllocator::deallocateCustomSize): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC): (JSC::Heap::didExceedFixedHeapSizeLimit): * heap/Heap.h: (Heap): * heap/MarkedBlock.cpp: (JSC::MarkedBlock::create): * heap/Region.h: (Region): (JSC): (NormalRegion): (JSC::NormalRegion::base): (JSC::NormalRegion::size): (ExcessRegion): (JSC::ExcessRegion::base): (JSC::ExcessRegion::size): (JSC::NormalRegion::NormalRegion): (JSC::NormalRegion::tryCreate): (JSC::NormalRegion::tryCreateCustomSize): (JSC::NormalRegion::reset): (JSC::ExcessRegion::ExcessRegion): (JSC::ExcessRegion::~ExcessRegion): (JSC::ExcessRegion::create): (JSC::ExcessRegion::createCustomSize): (JSC::ExcessRegion::reset): (JSC::Region::Region): (JSC::Region::initializeBlockList): (JSC::Region::create): (JSC::Region::createCustomSize): (JSC::Region::~Region): (JSC::Region::destroy): (JSC::Region::reset): (JSC::Region::deallocate): (JSC::Region::base): (JSC::Region::size): * heap/SuperRegion.cpp: Added. (JSC): (JSC::SuperRegion::SuperRegion): (JSC::SuperRegion::getAlignedBase): (JSC::SuperRegion::allocateNewSpace): (JSC::SuperRegion::notifyNeedPage): (JSC::SuperRegion::notifyPageIsFree): * heap/SuperRegion.h: Added. (JSC): (SuperRegion): Source/WTF: * wtf/MetaAllocator.cpp: Changed the MetaAllocator to allow custom page sizes if the derived class wants to use something other than the system page size. (WTF::MetaAllocator::MetaAllocator): * wtf/MetaAllocator.h: (MetaAllocator): Canonical link: https://commits.webkit.org/132016@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-01 15:23:49 +00:00
, m_pageSize(pageSize)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
, m_bytesAllocated(0)
, m_bytesReserved(0)
, m_bytesCommitted(0)
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
, m_lock(lock)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
#ifndef NDEBUG
, m_mallocBalance(0)
#endif
#if ENABLE(META_ALLOCATOR_PROFILE)
, m_numAllocations(0)
, m_numFrees(0)
#endif
{
for (m_logPageSize = 0; m_logPageSize < 32; ++m_logPageSize) {
if (static_cast<size_t>(1) << m_logPageSize == m_pageSize)
break;
}
ASSERT(static_cast<size_t>(1) << m_logPageSize == m_pageSize);
for (m_logAllocationGranule = 0; m_logAllocationGranule < 32; ++m_logAllocationGranule) {
if (static_cast<size_t>(1) << m_logAllocationGranule == m_allocationGranule)
break;
}
ASSERT(static_cast<size_t>(1) << m_logAllocationGranule == m_allocationGranule);
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
RefPtr<MetaAllocatorHandle> MetaAllocator::allocate(const LockHolder&, size_t sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
if (!sizeInBytes)
Remove all uses of PassRefPtr in WTF https://bugs.webkit.org/show_bug.cgi?id=157596 <rdar://problem/26234391> Reviewed by Chris Dumez. Source/JavaScriptCore: Update calls to interfaces that no longer take or return PassRefPtrs. * runtime/JSString.cpp: (JSC::JSRopeString::resolveRope): * runtime/JSString.h: (JSC::JSString::JSString): (JSC::jsSubstring): * runtime/PrivateName.h: (JSC::PrivateName::PrivateName): * runtime/SmallStrings.cpp: (JSC::SmallStringsStorage::SmallStringsStorage): * runtime/StringConstructor.cpp: (JSC::stringFromCharCodeSlowCase): * runtime/StringPrototype.cpp: (JSC::jsSpliceSubstrings): (JSC::jsSpliceSubstringsWithSeparators): (JSC::replaceUsingStringSearch): (JSC::repeatCharacter): (JSC::stringProtoFuncFontsize): (JSC::stringProtoFuncLink): (JSC::normalize): Source/WebCore: Update calls to interfaces that no longer take or return PassRefPtrs. No new tests: no new functionality so changes are covered by existing tests. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberValue): * dom/Document.cpp: (WebCore::Document::displayStringModifiedByEncoding): * xml/XPathGrammar.y: Source/WTF: Remove/update most interfaces that take or return PassRefPtrs. Remaining references include those in non-Cocoa implementations and those required for continued compatibility with modules that still use PassRefPtrs (specifically: Forward.h, RefPtr interoperability, SizeLimits.h, WorkQueue (Windows) DispatchQueueEfl, DispatchWorkItemEfl, and PassRefPtr itself). Update calls to interfaces that no longer take or return PassRefPtrs. Update adoptRef(T*) to return a RefPtr instead of a PassRefPtr and move it to RefPtr.h from PassRefPtr.h. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocate): * wtf/MetaAllocator.h: * wtf/ParallelJobsGeneric.h: (WTF::ParallelEnvironment::ThreadPrivate::create): * wtf/text/AtomicStringImpl.cpp: (WTF::HashAndUTF8CharactersTranslator::translate): (WTF::SubstringTranslator::translate): * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString): (WTF::StringBuilder::resize): (WTF::StringBuilder::reallocateBuffer<LChar>): (WTF::StringBuilder::reallocateBuffer<UChar>): * wtf/text/StringImpl.cpp: (WTF::StringImpl::reallocateInternal): (WTF::StringImpl::reallocate): (WTF::StringImpl::create8BitIfPossible): (WTF::StringImpl::createSymbol): (WTF::StringImpl::createNullSymbol): (WTF::StringImpl::convertToLowercaseWithoutLocale): (WTF::StringImpl::convertToUppercaseWithoutLocale): (WTF::StringImpl::convertToLowercaseWithLocale): (WTF::StringImpl::convertToUppercaseWithLocale): (WTF::StringImpl::convertASCIICase): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::extractFoldedStringInSymbol): * wtf/text/SymbolRegistry.cpp: (WTF::SymbolRegistry::symbolForKey): * wtf/text/WTFString.cpp: (WTF::String::substringSharingImpl): * wtf/text/WTFString.h: (WTF::String::String): Deleted. * wtf/text/cf/StringImplCF.cpp: Tools: Update calls to interfaces that no longer take or return PassRefPtrs. * TestWebKitAPI/Tests/WTF/StringImpl.cpp: (TestWebKitAPI::stringFromUTF8): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/176568@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-08 01:31:17 +00:00
return nullptr;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
sizeInBytes = roundUp(sizeInBytes);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr start = findAndRemoveFreeSpace(sizeInBytes);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
if (!start) {
size_t requestedNumberOfPages = (sizeInBytes + m_pageSize - 1) >> m_logPageSize;
size_t numberOfPages = requestedNumberOfPages;
start = allocateNewSpace(numberOfPages);
if (!start)
Remove all uses of PassRefPtr in WTF https://bugs.webkit.org/show_bug.cgi?id=157596 <rdar://problem/26234391> Reviewed by Chris Dumez. Source/JavaScriptCore: Update calls to interfaces that no longer take or return PassRefPtrs. * runtime/JSString.cpp: (JSC::JSRopeString::resolveRope): * runtime/JSString.h: (JSC::JSString::JSString): (JSC::jsSubstring): * runtime/PrivateName.h: (JSC::PrivateName::PrivateName): * runtime/SmallStrings.cpp: (JSC::SmallStringsStorage::SmallStringsStorage): * runtime/StringConstructor.cpp: (JSC::stringFromCharCodeSlowCase): * runtime/StringPrototype.cpp: (JSC::jsSpliceSubstrings): (JSC::jsSpliceSubstringsWithSeparators): (JSC::replaceUsingStringSearch): (JSC::repeatCharacter): (JSC::stringProtoFuncFontsize): (JSC::stringProtoFuncLink): (JSC::normalize): Source/WebCore: Update calls to interfaces that no longer take or return PassRefPtrs. No new tests: no new functionality so changes are covered by existing tests. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberValue): * dom/Document.cpp: (WebCore::Document::displayStringModifiedByEncoding): * xml/XPathGrammar.y: Source/WTF: Remove/update most interfaces that take or return PassRefPtrs. Remaining references include those in non-Cocoa implementations and those required for continued compatibility with modules that still use PassRefPtrs (specifically: Forward.h, RefPtr interoperability, SizeLimits.h, WorkQueue (Windows) DispatchQueueEfl, DispatchWorkItemEfl, and PassRefPtr itself). Update calls to interfaces that no longer take or return PassRefPtrs. Update adoptRef(T*) to return a RefPtr instead of a PassRefPtr and move it to RefPtr.h from PassRefPtr.h. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocate): * wtf/MetaAllocator.h: * wtf/ParallelJobsGeneric.h: (WTF::ParallelEnvironment::ThreadPrivate::create): * wtf/text/AtomicStringImpl.cpp: (WTF::HashAndUTF8CharactersTranslator::translate): (WTF::SubstringTranslator::translate): * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString): (WTF::StringBuilder::resize): (WTF::StringBuilder::reallocateBuffer<LChar>): (WTF::StringBuilder::reallocateBuffer<UChar>): * wtf/text/StringImpl.cpp: (WTF::StringImpl::reallocateInternal): (WTF::StringImpl::reallocate): (WTF::StringImpl::create8BitIfPossible): (WTF::StringImpl::createSymbol): (WTF::StringImpl::createNullSymbol): (WTF::StringImpl::convertToLowercaseWithoutLocale): (WTF::StringImpl::convertToUppercaseWithoutLocale): (WTF::StringImpl::convertToLowercaseWithLocale): (WTF::StringImpl::convertToUppercaseWithLocale): (WTF::StringImpl::convertASCIICase): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::extractFoldedStringInSymbol): * wtf/text/SymbolRegistry.cpp: (WTF::SymbolRegistry::symbolForKey): * wtf/text/WTFString.cpp: (WTF::String::substringSharingImpl): * wtf/text/WTFString.h: (WTF::String::String): Deleted. * wtf/text/cf/StringImplCF.cpp: Tools: Update calls to interfaces that no longer take or return PassRefPtrs. * TestWebKitAPI/Tests/WTF/StringImpl.cpp: (TestWebKitAPI::stringFromUTF8): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/176568@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-08 01:31:17 +00:00
return nullptr;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
ASSERT(numberOfPages >= requestedNumberOfPages);
size_t roundedUpSize = numberOfPages << m_logPageSize;
ASSERT(roundedUpSize >= sizeInBytes);
m_bytesReserved += roundedUpSize;
if (roundedUpSize > sizeInBytes) {
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr freeSpaceStart = start + sizeInBytes;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
size_t freeSpaceSize = roundedUpSize - sizeInBytes;
addFreeSpace(freeSpaceStart, freeSpaceSize);
}
}
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
incrementPageOccupancy(start.untaggedPtr(), sizeInBytes);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_bytesAllocated += sizeInBytes;
#if ENABLE(META_ALLOCATOR_PROFILE)
m_numAllocations++;
#endif
auto handle = adoptRef(*new MetaAllocatorHandle(*this, MemoryPtr(start), sizeInBytes));
if (UNLIKELY(!!m_tracker))
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
m_tracker->notify(*handle.ptr());
return handle;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
Implement 1GB of executable memory on arm64 https://bugs.webkit.org/show_bug.cgi?id=208490 <rdar://problem/60797127> Reviewed by Keith Miller. JSTests: Run JetStream2 wasm tests. * wasm.yaml: * wasm/lowExecutableMemory/executable-memory-oom.js: PerformanceTests: * JetStream2/JetStreamDriver.js: (Driver.prototype.dumpJSONResultsIfNeeded): (DefaultBenchmark.prototype.updateUIAfterRun): (DefaultBenchmark): (WSLBenchmark.prototype.updateUIAfterRun): (WSLBenchmark): (WasmBenchmark.prototype.updateUIAfterRun): (WasmBenchmark): (Driver.async fetchResources.statusElement.innerHTML.a.href.string_appeared_here): (Driver.prototype.async fetchResources): Source/JavaScriptCore: This patch implements the 1GB executable memory space on arm64. To make this work, we implement jumps larger than +/-128MB to use jump islands. Jump islands work by splitting up the ~1GB region into 9 112MB chunks (1008 MB total). Each chunk is split into two: 96MB of executable region, and 16MB of jump island region. With this split, any jump inside a jump island region can get to the adjacent island (forwards or backwards) in a single +/-128MB jump. When linking a jump from A to B, where |A - B| > 128MB, we instead point the jump to an island, where this island has a potential series of jumps that finally lands at B. To allocate executable memory, use a MetaAllocator for each 96MB chunk. To allocate islands, we have a bit vector we use to track used and freed islands. We only grow this bit vector as islands are allocated, so it frequently remains empty or very small. The goal of this patch is to have minimal perf impact when not using islands, so the data structures are designed to only incur overhead when actually using islands. We expect the use of islands to be minimal. We use a red black tree to track all island locations. This allows us to deallocate all islands when an executable memory handle is freed. Typically, this red black tree is empty, so freeing an executable memory handle incurs no extra overhead. To make islands work for Wasm, we now have to link tier up code in two phases. Previously, we would just patch jumps concurrently to Wasm threads running after resetting the icache, knowing that we would be able to atomically update the jump instruction to point to the new destination. However, now when repatching these jumps in a world with jump islands, we might need to allocate islands depending on the jump location and its target. So we now allocate and collect the set of islands, then reset the icache, then atomically update the branch to point to the destination (or an island that jumps to the destination). One important implementation detail here is that for normal island repatching, if we have a jump from A to B, and it allocates a set if islands X, we usually can deallocate X when repatching A to go to B'. This is because the typical repatch scenario in JS happens when that code is not being executed. For Wasm though, those islands X might be running while we want to repatch A to go to B'. So instead of deallocating X, we just append to X in this scenario, and we free the new set X' when the code itself is freed. (This patch also fixes a bug in the Wasm LLInt to BBQ tier up that I spotted, where we would publish a LLInt callee's BBQ replacement before we finished linking the outgoing calls of the BBQ replacement.) This patch also removes the old "CodeProfiling" code that has been unused for a long time. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::b): (JSC::ARM64Assembler::bl): (JSC::ARM64Assembler::replaceWithJump): (JSC::ARM64Assembler::prepareForAtomicRelinkJumpConcurrently): (JSC::ARM64Assembler::prepareForAtomicRelinkCallConcurrently): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::canEmitJump): (JSC::ARM64Assembler::linkJumpOrCall): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): (JSC::LinkBuffer::performFinalization): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::setIsJumpIsland): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * jit/ExecutableAllocator.cpp: (JSC::initializeJITPageReservation): (JSC::ExecutableAllocator::initializeUnderlyingAllocator): (JSC::ExecutableAllocator::isValid const): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::getJumpIslandTo): (JSC::ExecutableAllocator::getJumpIslandToConcurrently): (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator): Deleted. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::allocate): * runtime/CommonSlowPaths.cpp: * runtime/Completion.cpp: (JSC::evaluate): * runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): * runtime/OptionsList.h: * tools/CodeProfile.cpp: (JSC::truncateTrace): Deleted. (JSC::CodeProfile::sample): Deleted. (JSC::CodeProfile::report): Deleted. * tools/CodeProfile.h: (JSC::CodeProfile::CodeProfile): Deleted. (JSC::CodeProfile::parent): Deleted. (JSC::CodeProfile::addChild): Deleted. (): Deleted. (JSC::CodeProfile::CodeRecord::CodeRecord): Deleted. * tools/CodeProfiling.cpp: (JSC::setProfileTimer): Deleted. (JSC::profilingTimer): Deleted. (JSC::CodeProfiling::sample): Deleted. (JSC::CodeProfiling::notifyAllocator): Deleted. (JSC::CodeProfiling::getOwnerUIDForPC): Deleted. (JSC::CodeProfiling::begin): Deleted. (JSC::CodeProfiling::end): Deleted. * tools/CodeProfiling.h: (): Deleted. (JSC::CodeProfiling::CodeProfiling): Deleted. (JSC::CodeProfiling::~CodeProfiling): Deleted. (JSC::CodeProfiling::enabled): Deleted. (JSC::CodeProfiling::beVerbose): Deleted. (JSC::CodeProfiling::beVeryVerbose): Deleted. * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmCodeBlock.h: * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::updateCallSitesToCallUs): * wasm/WasmPlan.h: Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorTracker::notify): (WTF::MetaAllocatorTracker::release): (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::getLock): Deleted. * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::allocator): (WTF::MetaAllocatorHandle::isManaged): Deleted. (WTF::MetaAllocatorHandle::ownerUID): Deleted. * wtf/PlatformEnable.h: * wtf/RedBlackTree.h: * wtf/StdLibExtras.h: (WTF::constructFixedSizeArrayWithArgumentsImpl): (WTF::constructFixedSizeArrayWithArguments): Tools: * Scripts/run-jsc-stress-tests: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/222973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-06 18:19:52 +00:00
MetaAllocator::Statistics MetaAllocator::currentStatistics(const LockHolder&)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
Statistics result;
result.bytesAllocated = m_bytesAllocated;
result.bytesReserved = m_bytesReserved;
result.bytesCommitted = m_bytesCommitted;
return result;
}
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
MetaAllocator::FreeSpacePtr MetaAllocator::findAndRemoveFreeSpace(size_t sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
FreeSpaceNode* node = m_freeSpaceSizeMap.findLeastGreaterThanOrEqual(sizeInBytes);
if (!node)
[clang-tidy] Run modernize-use-nullptr over WTF https://bugs.webkit.org/show_bug.cgi?id=211628 Reviewed by Yusuke Suzuki. Use the fix option in clang-tidy to ensure nullptr is being used across WTF. * wtf/Assertions.cpp: * wtf/BumpPointerAllocator.h: (WTF::BumpPointerPool::BumpPointerPool): (WTF::BumpPointerPool::create): (WTF::BumpPointerAllocator::BumpPointerAllocator): * wtf/DataLog.cpp: (WTF::setDataFile): * wtf/DateMath.cpp: (WTF::parseES5DatePortion): (WTF::parseES5TimePortion): * wtf/FastMalloc.cpp: (WTF::fastZeroedMalloc): (WTF::fastStrDup): (WTF::tryFastZeroedMalloc): (WTF::isFastMallocEnabled): (WTF::fastMallocGoodSize): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): (WTF::fastAlignedFree): (WTF::tryFastMalloc): (WTF::fastMalloc): (WTF::tryFastCalloc): (WTF::fastCalloc): (WTF::fastFree): (WTF::fastRealloc): (WTF::tryFastRealloc): (WTF::releaseFastMallocFreeMemory): (WTF::releaseFastMallocFreeMemoryForThisThread): (WTF::fastMallocStatistics): (WTF::fastMallocSize): (WTF::fastCommitAlignedMemory): (WTF::fastDecommitAlignedMemory): (WTF::fastEnableMiniMode): (WTF::fastDisableScavenger): (WTF::fastMallocDumpMallocStats): (WTF::AvoidRecordingScope::avoidRecordingCount): (WTF::AvoidRecordingScope::AvoidRecordingScope): (WTF::AvoidRecordingScope::~AvoidRecordingScope): (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): (WTF::MallocCallTracker::singleton): (WTF::MallocCallTracker::MallocCallTracker): (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): * wtf/HashTable.h: (WTF::KeyTraits>::inlineLookup): (WTF::KeyTraits>::lookupForWriting): (WTF::KeyTraits>::fullLookupForWriting): (WTF::KeyTraits>::add): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): * wtf/ParallelJobsGeneric.cpp: * wtf/RandomDevice.cpp: (WTF::RandomDevice::cryptographicallyRandomValues): * wtf/RawPointer.h: (WTF::RawPointer::RawPointer): * wtf/RedBlackTree.h: * wtf/SHA1.cpp: (WTF::SHA1::hexDigest): * wtf/SchedulePair.h: (WTF::SchedulePair::SchedulePair): * wtf/StackTrace.cpp: (WTFGetBacktrace): (WTF::StackTrace::dump const): * wtf/StringExtras.h: (strnstr): * wtf/Variant.h: * wtf/Vector.h: (WTF::VectorBufferBase::deallocateBuffer): (WTF::VectorBufferBase::releaseBuffer): (WTF::VectorBufferBase::VectorBufferBase): * wtf/cf/CFURLExtras.cpp: (WTF::createCFURLFromBuffer): (WTF::getURLBytes): * wtf/cf/CFURLExtras.h: * wtf/cf/FileSystemCF.cpp: (WTF::FileSystem::pathAsURL): * wtf/dtoa/double-conversion.cc: * wtf/dtoa/utils.h: (WTF::double_conversion::BufferReference::BufferReference): * wtf/text/CString.cpp: (WTF::CString::mutableData): * wtf/text/CString.h: * wtf/text/StringBuffer.h: (WTF::StringBuffer::release): * wtf/text/StringImpl.cpp: (WTF::StringImpl::createUninitializedInternal): (WTF::StringImpl::reallocateInternal): * wtf/text/StringImpl.h: (WTF::StringImpl::constructInternal<LChar>): (WTF::StringImpl::constructInternal<UChar>): (WTF::StringImpl::characters<LChar> const): (WTF::StringImpl::characters<UChar> const): (WTF::find): (WTF::reverseFindLineTerminator): (WTF::reverseFind): (WTF::equalIgnoringNullity): (WTF::codePointCompare): (WTF::isSpaceOrNewline): (WTF::lengthOfNullTerminatedString): (WTF::StringImplShape::StringImplShape): (WTF::StringImpl::isolatedCopy const): (WTF::StringImpl::isAllASCII const): (WTF::StringImpl::isAllLatin1 const): (WTF::isAllSpecialCharacters): (WTF::isSpecialCharacter const): (WTF::StringImpl::StringImpl): (WTF::StringImpl::create8BitIfPossible): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::createFromLiteral): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::adopt): (WTF::StringImpl::cost const): (WTF::StringImpl::costDuringGC): (WTF::StringImpl::setIsAtom): (WTF::StringImpl::setHash const): (WTF::StringImpl::ref): (WTF::StringImpl::deref): (WTF::StringImpl::copyCharacters): (WTF::StringImpl::at const): (WTF::StringImpl::allocationSize): (WTF::StringImpl::maxInternalLength): (WTF::StringImpl::tailOffset): (WTF::StringImpl::requiresCopy const): (WTF::StringImpl::tailPointer const): (WTF::StringImpl::tailPointer): (WTF::StringImpl::substringBuffer const): (WTF::StringImpl::substringBuffer): (WTF::StringImpl::assertHashIsCorrect const): (WTF::StringImpl::StaticStringImpl::StaticStringImpl): (WTF::StringImpl::StaticStringImpl::operator StringImpl&): (WTF::equalIgnoringASCIICase): (WTF::startsWithLettersIgnoringASCIICase): (WTF::equalLettersIgnoringASCIICase): * wtf/text/TextBreakIterator.cpp: (WTF::initializeIterator): (WTF::setContextAwareTextForIterator): (WTF::openLineBreakIterator): * wtf/text/TextBreakIterator.h: (WTF::LazyLineBreakIterator::get): * wtf/text/WTFString.cpp: (WTF::charactersToFloat): * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocate): (WTF::StringWrapperCFAllocator::create): (WTF::StringImpl::createCFString): * wtf/text/icu/UTextProviderLatin1.cpp: (WTF::uTextLatin1Clone): (WTF::openLatin1ContextAwareUTextProvider): * wtf/text/icu/UTextProviderUTF16.cpp: (WTF::openUTF16ContextAwareUTextProvider): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::storageDirectory): (WTF::FileSystemImpl::openTemporaryFile): (WTF::FileSystemImpl::openFile): (WTF::FileSystemImpl::writeToFile): (WTF::FileSystemImpl::readFromFile): (WTF::FileSystemImpl::deleteNonEmptyDirectory): * wtf/win/LanguageWin.cpp: (WTF::localeInfo): * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThreadPlatform): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/RunLoopWin.cpp: (WTF::RunLoop::run): (WTF::RunLoop::iterate): (WTF::RunLoop::RunLoop): (WTF::RunLoop::cycle): (WTF::RunLoop::TimerBase::start): * wtf/win/ThreadingWin.cpp: (WTF::Thread::establishHandle): Canonical link: https://commits.webkit.org/224543@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-08 17:31:54 +00:00
return nullptr;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
size_t nodeSizeInBytes = node->sizeInBytes();
RELEASE_ASSERT(nodeSizeInBytes >= sizeInBytes);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.remove(node);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr result;
if (nodeSizeInBytes == sizeInBytes) {
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
// Easy case: perfect fit, so just remove the node entirely.
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
result = node->m_start;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
m_freeSpaceStartAddressMap.remove(node->m_start);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
m_freeSpaceEndAddressMap.remove(node->m_end);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
freeFreeSpaceNode(node);
} else {
// Try to be a good citizen and ensure that the returned chunk of memory
// straddles as few pages as possible, but only insofar as doing so will
// not increase fragmentation. The intuition is that minimizing
// fragmentation is a strictly higher priority than minimizing the number
// of committed pages, since in the long run, smaller fragmentation means
// fewer committed pages and fewer failures in general.
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
uintptr_t nodeStartAsInt = node->m_start.untaggedPtr<uintptr_t>();
uintptr_t firstPage = nodeStartAsInt >> m_logPageSize;
uintptr_t lastPage = (nodeStartAsInt + nodeSizeInBytes - 1) >> m_logPageSize;
uintptr_t lastPageForLeftAllocation = (nodeStartAsInt + sizeInBytes - 1) >> m_logPageSize;
uintptr_t firstPageForRightAllocation = (nodeStartAsInt + nodeSizeInBytes - sizeInBytes) >> m_logPageSize;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
if (lastPageForLeftAllocation - firstPage + 1 <= lastPage - firstPageForRightAllocation + 1) {
// Allocate in the left side of the returned chunk, and slide the node to the right.
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
result = node->m_start;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
m_freeSpaceStartAddressMap.remove(node->m_start);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
node->m_start += sizeInBytes;
RELEASE_ASSERT(nodeStartAsInt < node->m_start.untaggedPtr<uintptr_t>() && node->m_start.untaggedPtr<uintptr_t>() < node->m_end.untaggedPtr<uintptr_t>());
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(node);
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
m_freeSpaceStartAddressMap.add(node->m_start, node);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
} else {
// Allocate in the right size of the returned chunk, and slide the node to the left;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
result = node->m_end - sizeInBytes;
m_freeSpaceEndAddressMap.remove(node->m_end);
node->m_end = result;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(node);
m_freeSpaceEndAddressMap.add(result, node);
}
}
#if ENABLE(META_ALLOCATOR_PROFILE)
dumpProfile();
#endif
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
return result;
}
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
void MetaAllocator::addFreeSpaceFromReleasedHandle(FreeSpacePtr start, size_t sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
#if ENABLE(META_ALLOCATOR_PROFILE)
m_numFrees++;
#endif
m_bytesAllocated -= sizeInBytes;
addFreeSpace(start, sizeInBytes);
}
void MetaAllocator::addFreshFreeSpace(void* start, size_t sizeInBytes)
{
Config::AssertNotFrozenScope assertNotFrozenScope;
Replace LockHolder with Locker in local variables https://bugs.webkit.org/show_bug.cgi?id=226133 Reviewed by Darin Adler. Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock type more easily since the compiler with deduce the lock type T for Locker<T>. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSValue.mm: (handerForStructTag): * API/tests/testapi.cpp: (testCAPIViaCpp): * assembler/testmasm.cpp: (JSC::run): * b3/air/testair.cpp: * b3/testb3_1.cpp: (run): * bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): (JSC::DirectEvalCodeCache::clear): (JSC::DirectEvalCodeCache::visitAggregateImpl): * bytecode/SuperSampler.cpp: (JSC::initializeSuperSampler): (JSC::resetSuperSamplerState): (JSC::printSuperSamplerState): (JSC::enableSuperSampler): (JSC::disableSuperSampler): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::~Worklist): (JSC::DFG::Worklist::finishCreation): (JSC::DFG::Worklist::isActiveForVM const): (JSC::DFG::Worklist::enqueue): (JSC::DFG::Worklist::compilationState): (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady): (JSC::DFG::Worklist::removeAllReadyPlansForVM): (JSC::DFG::Worklist::completeAllReadyPlansForVM): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::Worklist::removeDeadPlans): (JSC::DFG::Worklist::removeNonCompilingPlansForVM): (JSC::DFG::Worklist::queueLength): (JSC::DFG::Worklist::dump const): (JSC::DFG::Worklist::setNumberOfThreads): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::addBlock): * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterateCurrentlyExecuting): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::add): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::lastChanceToFinalize): (JSC::Heap::collectAsync): (JSC::Heap::runBeginPhase): (JSC::Heap::waitForCollector): (JSC::Heap::requestCollection): (JSC::Heap::notifyIsSafeToCollect): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didReachTermination): * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::startTracking): (Inspector::InspectorScriptProfilerAgent::trackingComplete): (Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting): * inspector/remote/RemoteConnectionToTarget.cpp: (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::targetClosed): * inspector/remote/RemoteInspector.cpp: (Inspector::RemoteInspector::registerTarget): (Inspector::RemoteInspector::unregisterTarget): (Inspector::RemoteInspector::updateTarget): (Inspector::RemoteInspector::updateClientCapabilities): (Inspector::RemoteInspector::setClient): (Inspector::RemoteInspector::setupFailed): (Inspector::RemoteInspector::setupCompleted): (Inspector::RemoteInspector::stop): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): (Inspector::RemoteTargetHandleRunSourceWithInfo): (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::targetClosed): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop): * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupXPCConnectionIfNeeded): (Inspector::RemoteInspector::setParentProcessInformation): (Inspector::RemoteInspector::xpcConnectionReceivedMessage): (Inspector::RemoteInspector::xpcConnectionFailed): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::receivedIndicateMessage): (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: (Inspector::RemoteInspectorXPCConnection::close): (Inspector::RemoteInspectorXPCConnection::closeFromMessage): (Inspector::RemoteInspectorXPCConnection::deserializeMessage): (Inspector::RemoteInspectorXPCConnection::handleEvent): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupConnection): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::receivedGetTargetListMessage): (Inspector::RemoteInspector::receivedDataMessage): (Inspector::RemoteInspector::receivedCloseMessage): (Inspector::RemoteInspector::setup): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::didReceive): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::didClose): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::setup): (Inspector::RemoteInspector::setupInspectorClient): (Inspector::RemoteInspector::frontendDidClose): (Inspector::RemoteInspector::sendMessageToBackend): (Inspector::RemoteInspector::startAutomationSession): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::listenInet): (Inspector::RemoteInspectorSocketEndpoint::isListening): (Inspector::RemoteInspectorSocketEndpoint::workerThread): (Inspector::RemoteInspectorSocketEndpoint::createClient): (Inspector::RemoteInspectorSocketEndpoint::disconnect): (Inspector::RemoteInspectorSocketEndpoint::invalidateClient): (Inspector::RemoteInspectorSocketEndpoint::invalidateListener): (Inspector::RemoteInspectorSocketEndpoint::getPort const): (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::send): (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): * interpreter/CLoopStack.cpp: (JSC::CLoopStack::addToCommittedByteCount): (JSC::CLoopStack::committedByteCount): * jit/ExecutableAllocator.cpp: (JSC::dumpJITMemory): * jit/ICStats.cpp: (JSC::ICStats::ICStats): (JSC::ICStats::~ICStats): * jit/JITThunks.cpp: (JSC::JITThunks::ctiStub): (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::compileInThread): (JSC::JITWorklist::Plan::isFinishedCompiling): (JSC::JITWorklist::JITWorklist): (JSC::JITWorklist::completeAllForVM): (JSC::JITWorklist::poll): (JSC::JITWorklist::compileLater): (JSC::JITWorklist::finalizePlans): * parser/SourceProvider.cpp: (JSC::SourceProvider::getID): * profiler/ProfilerDatabase.cpp: (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::addCompilation): (JSC::Profiler::Database::logEvent): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::removeFirstAtExitDatabase): * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/DeferredWorkTimer.cpp: (JSC::DeferredWorkTimer::scheduleWorkSoon): (JSC::DeferredWorkTimer::didResumeScriptExecutionOwner): * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::timerLoop): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::registerForReportAtExit): * runtime/Watchdog.cpp: (JSC::Watchdog::startTimer): (JSC::Watchdog::willDestroyVM): * tools/VMInspector.cpp: (JSC::VMInspector::isValidExecutableMemory): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::addCompletionTask): (JSC::Wasm::Plan::waitForCompletion): (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSignature.cpp: (JSC::Wasm::SignatureInformation::signatureFor): (JSC::Wasm::SignatureInformation::tryCleanup): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): (JSC::Wasm::Worklist::completePlanSynchronously): (JSC::Wasm::Worklist::stopAllPlansForContext): (JSC::Wasm::Worklist::Worklist): (JSC::Wasm::Worklist::~Worklist): Source/WebCore: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::fullPathForDatabase): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNames): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::doneCreatingDatabase): (WebCore::DatabaseTracker::openDatabases): (WebCore::DatabaseTracker::addOpenDatabase): (WebCore::DatabaseTracker::removeOpenDatabase): (WebCore::DatabaseTracker::originLockFor): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::deleteDatabaseFile): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]): (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (WebCore::ImageDecoderAVFObjC::setTrack): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage): (WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::drain): (VideoRenderRequestScheduler::requestRender): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformInPlace): (sinkEventHandler): (webKitMediaCommonEncryptionDecryptIsFlushing): (setContext): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::beginPainting): (Nicosia::Buffer::completePainting): (Nicosia::Buffer::waitUntilPaintingComplete): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::setSceneIntegration): (Nicosia::PlatformLayer::createUpdateScope): (Nicosia::CompositionLayer::updateState): (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessPending): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: (Nicosia::Scene::accessState): * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: (Nicosia::SceneIntegration::setClient): (Nicosia::SceneIntegration::invalidate): (Nicosia::SceneIntegration::requestUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::load): (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::removeListener): (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameBytesAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::setTilesOpaque): (WebCore::LegacyTileCache::doLayoutTiles): (WebCore::LegacyTileCache::setCurrentScale): (WebCore::LegacyTileCache::commitScaleChange): (WebCore::LegacyTileCache::layoutTilesNow): (WebCore::LegacyTileCache::layoutTilesNowForRect): (WebCore::LegacyTileCache::removeAllNonVisibleTiles): (WebCore::LegacyTileCache::removeAllTiles): (WebCore::LegacyTileCache::removeForegroundTiles): (WebCore::LegacyTileCache::setContentReplacementImage): (WebCore::LegacyTileCache::contentReplacementImage const): (WebCore::LegacyTileCache::tileCreationTimerFired): (WebCore::LegacyTileCache::setNeedsDisplayInRect): (WebCore::LegacyTileCache::updateTilingMode): (WebCore::LegacyTileCache::setTilingMode): (WebCore::LegacyTileCache::doPendingRepaints): (WebCore::LegacyTileCache::flushSavedDisplayRects): (WebCore::LegacyTileCache::prepareToDraw): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::takeLayerWithSize): (WebCore::LegacyTileLayerPool::setCapacity): (WebCore::LegacyTileLayerPool::prune): (WebCore::LegacyTileLayerPool::drain): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow setExposedScrollViewRect:]): (-[WAKWindow exposedScrollViewRect]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::openNextStream): (WebCore::formFinalize): (WebCore::formClose): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setRequestPaused): (WebCore::CurlRequest::setCallbackPaused): (WebCore::CurlRequest::pausedStatusChanged): (WebCore::CurlRequest::enableDownloadToFile): (WebCore::CurlRequest::getDownloadedFilePath): (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled): (WebCore::CurlRequest::closeDownloadFile): (WebCore::CurlRequest::cleanupDownloadFile): * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): (WebCore::CurlSSLHandle::setClientCertificateInfo): (WebCore::CurlSSLHandle::getSSLClientCertificate const): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::runIncrementalVacuumCommand): (WebCore::SQLiteDatabase::interrupt): (WebCore::SQLiteDatabase::setAuthorizer): (WebCore::constructAndPrepareStatement): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::step): Source/WebKit: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::m_closeCallback): (WebKit::WebIDBServer::getOrigins): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::renameOrigin): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/glib/DNSCache.cpp: (WebKit::DNSCache::lookup): (WebKit::DNSCache::update): (WebKit::DNSCache::removeExpiredResponsesFired): (WebKit::DNSCache::clear): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::suspend): (WebKit::CompositingRunLoop::resume): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateTimerFired): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): Source/WebKitLegacy: * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::InProcessIDBServer): (InProcessIDBServer::deleteDatabase): (InProcessIDBServer::openDatabase): (InProcessIDBServer::abortTransaction): (InProcessIDBServer::commitTransaction): (InProcessIDBServer::didFinishHandlingVersionChangeTransaction): (InProcessIDBServer::createObjectStore): (InProcessIDBServer::deleteObjectStore): (InProcessIDBServer::renameObjectStore): (InProcessIDBServer::clearObjectStore): (InProcessIDBServer::createIndex): (InProcessIDBServer::deleteIndex): (InProcessIDBServer::renameIndex): (InProcessIDBServer::putOrAdd): (InProcessIDBServer::getRecord): (InProcessIDBServer::getAllRecords): (InProcessIDBServer::getCount): (InProcessIDBServer::deleteRecord): (InProcessIDBServer::openCursor): (InProcessIDBServer::iterateCursor): (InProcessIDBServer::establishTransaction): (InProcessIDBServer::databaseConnectionPendingClose): (InProcessIDBServer::databaseConnectionClosed): (InProcessIDBServer::abortOpenAndUpgradeNeeded): (InProcessIDBServer::didFireVersionChangeEvent): (InProcessIDBServer::openDBRequestCancelled): (InProcessIDBServer::getAllDatabaseNamesAndVersions): (InProcessIDBServer::closeAndDeleteDatabasesModifiedSince): * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::syncTimerFired): (WebKit::StorageAreaSync::performSync): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::finishedImportingOriginIdentifiers): (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): (WebKit::StorageTracker::setOriginDetails): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::origins): (WebKit::StorageTracker::deleteAllOrigins): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::deleteOrigin): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::canDeleteOrigin): (WebKit::StorageTracker::cancelDeletingOrigin): (WebKit::StorageTracker::diskUsageForOrigin): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _synchronizeCustomFixedPositionLayoutRect]): (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]): (-[WebView _setCustomFixedPositionLayoutRect:]): (-[WebView _fetchCustomFixedPositionLayoutRect:]): Source/WebKitLegacy/win: * Plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::registerPlugin): (WebCore::PluginMainThreadScheduler::unregisterPlugin): (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Source/WTF: * benchmarks/LockSpeedTest.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::~AutomaticThread): (WTF::AutomaticThread::join): (WTF::AutomaticThread::start): * wtf/AutomaticThread.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::ParallelHelperClient): (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::setTask): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::doSomeHelping): (WTF::ParallelHelperClient::runTask): (WTF::ParallelHelperPool::~ParallelHelperPool): (WTF::ParallelHelperPool::ensureThreads): (WTF::ParallelHelperPool::doSomeHelping): * wtf/Seconds.cpp: (WTF::sleep): * wtf/TimeWithDynamicClockType.cpp: (WTF::sleep): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): (WTF::WorkerPool::~WorkerPool): (WTF::WorkerPool::postTask): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): * wtf/win/DbgHelperWin.cpp: (WTF::DbgHelper::SymFromAddress): * wtf/win/ThreadingWin.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): Tools: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp: (TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn): (TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread): Canonical link: https://commits.webkit.org/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { m_lock };
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_bytesReserved += sizeInBytes;
addFreeSpace(FreeSpacePtr::makeFromRawPointer(start), sizeInBytes);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
size_t MetaAllocator::debugFreeSpaceSize()
{
#ifndef NDEBUG
Replace LockHolder with Locker in local variables https://bugs.webkit.org/show_bug.cgi?id=226133 Reviewed by Darin Adler. Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock type more easily since the compiler with deduce the lock type T for Locker<T>. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSValue.mm: (handerForStructTag): * API/tests/testapi.cpp: (testCAPIViaCpp): * assembler/testmasm.cpp: (JSC::run): * b3/air/testair.cpp: * b3/testb3_1.cpp: (run): * bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): (JSC::DirectEvalCodeCache::clear): (JSC::DirectEvalCodeCache::visitAggregateImpl): * bytecode/SuperSampler.cpp: (JSC::initializeSuperSampler): (JSC::resetSuperSamplerState): (JSC::printSuperSamplerState): (JSC::enableSuperSampler): (JSC::disableSuperSampler): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::~Worklist): (JSC::DFG::Worklist::finishCreation): (JSC::DFG::Worklist::isActiveForVM const): (JSC::DFG::Worklist::enqueue): (JSC::DFG::Worklist::compilationState): (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady): (JSC::DFG::Worklist::removeAllReadyPlansForVM): (JSC::DFG::Worklist::completeAllReadyPlansForVM): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::Worklist::removeDeadPlans): (JSC::DFG::Worklist::removeNonCompilingPlansForVM): (JSC::DFG::Worklist::queueLength): (JSC::DFG::Worklist::dump const): (JSC::DFG::Worklist::setNumberOfThreads): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::addBlock): * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterateCurrentlyExecuting): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::add): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::lastChanceToFinalize): (JSC::Heap::collectAsync): (JSC::Heap::runBeginPhase): (JSC::Heap::waitForCollector): (JSC::Heap::requestCollection): (JSC::Heap::notifyIsSafeToCollect): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didReachTermination): * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::startTracking): (Inspector::InspectorScriptProfilerAgent::trackingComplete): (Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting): * inspector/remote/RemoteConnectionToTarget.cpp: (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::targetClosed): * inspector/remote/RemoteInspector.cpp: (Inspector::RemoteInspector::registerTarget): (Inspector::RemoteInspector::unregisterTarget): (Inspector::RemoteInspector::updateTarget): (Inspector::RemoteInspector::updateClientCapabilities): (Inspector::RemoteInspector::setClient): (Inspector::RemoteInspector::setupFailed): (Inspector::RemoteInspector::setupCompleted): (Inspector::RemoteInspector::stop): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): (Inspector::RemoteTargetHandleRunSourceWithInfo): (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::targetClosed): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop): * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupXPCConnectionIfNeeded): (Inspector::RemoteInspector::setParentProcessInformation): (Inspector::RemoteInspector::xpcConnectionReceivedMessage): (Inspector::RemoteInspector::xpcConnectionFailed): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::receivedIndicateMessage): (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: (Inspector::RemoteInspectorXPCConnection::close): (Inspector::RemoteInspectorXPCConnection::closeFromMessage): (Inspector::RemoteInspectorXPCConnection::deserializeMessage): (Inspector::RemoteInspectorXPCConnection::handleEvent): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupConnection): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::receivedGetTargetListMessage): (Inspector::RemoteInspector::receivedDataMessage): (Inspector::RemoteInspector::receivedCloseMessage): (Inspector::RemoteInspector::setup): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::didReceive): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::didClose): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::setup): (Inspector::RemoteInspector::setupInspectorClient): (Inspector::RemoteInspector::frontendDidClose): (Inspector::RemoteInspector::sendMessageToBackend): (Inspector::RemoteInspector::startAutomationSession): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::listenInet): (Inspector::RemoteInspectorSocketEndpoint::isListening): (Inspector::RemoteInspectorSocketEndpoint::workerThread): (Inspector::RemoteInspectorSocketEndpoint::createClient): (Inspector::RemoteInspectorSocketEndpoint::disconnect): (Inspector::RemoteInspectorSocketEndpoint::invalidateClient): (Inspector::RemoteInspectorSocketEndpoint::invalidateListener): (Inspector::RemoteInspectorSocketEndpoint::getPort const): (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::send): (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): * interpreter/CLoopStack.cpp: (JSC::CLoopStack::addToCommittedByteCount): (JSC::CLoopStack::committedByteCount): * jit/ExecutableAllocator.cpp: (JSC::dumpJITMemory): * jit/ICStats.cpp: (JSC::ICStats::ICStats): (JSC::ICStats::~ICStats): * jit/JITThunks.cpp: (JSC::JITThunks::ctiStub): (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::compileInThread): (JSC::JITWorklist::Plan::isFinishedCompiling): (JSC::JITWorklist::JITWorklist): (JSC::JITWorklist::completeAllForVM): (JSC::JITWorklist::poll): (JSC::JITWorklist::compileLater): (JSC::JITWorklist::finalizePlans): * parser/SourceProvider.cpp: (JSC::SourceProvider::getID): * profiler/ProfilerDatabase.cpp: (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::addCompilation): (JSC::Profiler::Database::logEvent): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::removeFirstAtExitDatabase): * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/DeferredWorkTimer.cpp: (JSC::DeferredWorkTimer::scheduleWorkSoon): (JSC::DeferredWorkTimer::didResumeScriptExecutionOwner): * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::timerLoop): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::registerForReportAtExit): * runtime/Watchdog.cpp: (JSC::Watchdog::startTimer): (JSC::Watchdog::willDestroyVM): * tools/VMInspector.cpp: (JSC::VMInspector::isValidExecutableMemory): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::addCompletionTask): (JSC::Wasm::Plan::waitForCompletion): (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSignature.cpp: (JSC::Wasm::SignatureInformation::signatureFor): (JSC::Wasm::SignatureInformation::tryCleanup): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): (JSC::Wasm::Worklist::completePlanSynchronously): (JSC::Wasm::Worklist::stopAllPlansForContext): (JSC::Wasm::Worklist::Worklist): (JSC::Wasm::Worklist::~Worklist): Source/WebCore: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::fullPathForDatabase): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNames): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::doneCreatingDatabase): (WebCore::DatabaseTracker::openDatabases): (WebCore::DatabaseTracker::addOpenDatabase): (WebCore::DatabaseTracker::removeOpenDatabase): (WebCore::DatabaseTracker::originLockFor): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::deleteDatabaseFile): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]): (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (WebCore::ImageDecoderAVFObjC::setTrack): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage): (WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::drain): (VideoRenderRequestScheduler::requestRender): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformInPlace): (sinkEventHandler): (webKitMediaCommonEncryptionDecryptIsFlushing): (setContext): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::beginPainting): (Nicosia::Buffer::completePainting): (Nicosia::Buffer::waitUntilPaintingComplete): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::setSceneIntegration): (Nicosia::PlatformLayer::createUpdateScope): (Nicosia::CompositionLayer::updateState): (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessPending): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: (Nicosia::Scene::accessState): * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: (Nicosia::SceneIntegration::setClient): (Nicosia::SceneIntegration::invalidate): (Nicosia::SceneIntegration::requestUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::load): (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::removeListener): (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameBytesAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::setTilesOpaque): (WebCore::LegacyTileCache::doLayoutTiles): (WebCore::LegacyTileCache::setCurrentScale): (WebCore::LegacyTileCache::commitScaleChange): (WebCore::LegacyTileCache::layoutTilesNow): (WebCore::LegacyTileCache::layoutTilesNowForRect): (WebCore::LegacyTileCache::removeAllNonVisibleTiles): (WebCore::LegacyTileCache::removeAllTiles): (WebCore::LegacyTileCache::removeForegroundTiles): (WebCore::LegacyTileCache::setContentReplacementImage): (WebCore::LegacyTileCache::contentReplacementImage const): (WebCore::LegacyTileCache::tileCreationTimerFired): (WebCore::LegacyTileCache::setNeedsDisplayInRect): (WebCore::LegacyTileCache::updateTilingMode): (WebCore::LegacyTileCache::setTilingMode): (WebCore::LegacyTileCache::doPendingRepaints): (WebCore::LegacyTileCache::flushSavedDisplayRects): (WebCore::LegacyTileCache::prepareToDraw): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::takeLayerWithSize): (WebCore::LegacyTileLayerPool::setCapacity): (WebCore::LegacyTileLayerPool::prune): (WebCore::LegacyTileLayerPool::drain): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow setExposedScrollViewRect:]): (-[WAKWindow exposedScrollViewRect]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::openNextStream): (WebCore::formFinalize): (WebCore::formClose): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setRequestPaused): (WebCore::CurlRequest::setCallbackPaused): (WebCore::CurlRequest::pausedStatusChanged): (WebCore::CurlRequest::enableDownloadToFile): (WebCore::CurlRequest::getDownloadedFilePath): (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled): (WebCore::CurlRequest::closeDownloadFile): (WebCore::CurlRequest::cleanupDownloadFile): * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): (WebCore::CurlSSLHandle::setClientCertificateInfo): (WebCore::CurlSSLHandle::getSSLClientCertificate const): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::runIncrementalVacuumCommand): (WebCore::SQLiteDatabase::interrupt): (WebCore::SQLiteDatabase::setAuthorizer): (WebCore::constructAndPrepareStatement): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::step): Source/WebKit: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::m_closeCallback): (WebKit::WebIDBServer::getOrigins): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::renameOrigin): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/glib/DNSCache.cpp: (WebKit::DNSCache::lookup): (WebKit::DNSCache::update): (WebKit::DNSCache::removeExpiredResponsesFired): (WebKit::DNSCache::clear): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::suspend): (WebKit::CompositingRunLoop::resume): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateTimerFired): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): Source/WebKitLegacy: * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::InProcessIDBServer): (InProcessIDBServer::deleteDatabase): (InProcessIDBServer::openDatabase): (InProcessIDBServer::abortTransaction): (InProcessIDBServer::commitTransaction): (InProcessIDBServer::didFinishHandlingVersionChangeTransaction): (InProcessIDBServer::createObjectStore): (InProcessIDBServer::deleteObjectStore): (InProcessIDBServer::renameObjectStore): (InProcessIDBServer::clearObjectStore): (InProcessIDBServer::createIndex): (InProcessIDBServer::deleteIndex): (InProcessIDBServer::renameIndex): (InProcessIDBServer::putOrAdd): (InProcessIDBServer::getRecord): (InProcessIDBServer::getAllRecords): (InProcessIDBServer::getCount): (InProcessIDBServer::deleteRecord): (InProcessIDBServer::openCursor): (InProcessIDBServer::iterateCursor): (InProcessIDBServer::establishTransaction): (InProcessIDBServer::databaseConnectionPendingClose): (InProcessIDBServer::databaseConnectionClosed): (InProcessIDBServer::abortOpenAndUpgradeNeeded): (InProcessIDBServer::didFireVersionChangeEvent): (InProcessIDBServer::openDBRequestCancelled): (InProcessIDBServer::getAllDatabaseNamesAndVersions): (InProcessIDBServer::closeAndDeleteDatabasesModifiedSince): * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::syncTimerFired): (WebKit::StorageAreaSync::performSync): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::finishedImportingOriginIdentifiers): (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): (WebKit::StorageTracker::setOriginDetails): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::origins): (WebKit::StorageTracker::deleteAllOrigins): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::deleteOrigin): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::canDeleteOrigin): (WebKit::StorageTracker::cancelDeletingOrigin): (WebKit::StorageTracker::diskUsageForOrigin): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _synchronizeCustomFixedPositionLayoutRect]): (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]): (-[WebView _setCustomFixedPositionLayoutRect:]): (-[WebView _fetchCustomFixedPositionLayoutRect:]): Source/WebKitLegacy/win: * Plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::registerPlugin): (WebCore::PluginMainThreadScheduler::unregisterPlugin): (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Source/WTF: * benchmarks/LockSpeedTest.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::~AutomaticThread): (WTF::AutomaticThread::join): (WTF::AutomaticThread::start): * wtf/AutomaticThread.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::ParallelHelperClient): (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::setTask): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::doSomeHelping): (WTF::ParallelHelperClient::runTask): (WTF::ParallelHelperPool::~ParallelHelperPool): (WTF::ParallelHelperPool::ensureThreads): (WTF::ParallelHelperPool::doSomeHelping): * wtf/Seconds.cpp: (WTF::sleep): * wtf/TimeWithDynamicClockType.cpp: (WTF::sleep): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): (WTF::WorkerPool::~WorkerPool): (WTF::WorkerPool::postTask): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): * wtf/win/DbgHelperWin.cpp: (WTF::DbgHelper::SymFromAddress): * wtf/win/ThreadingWin.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): Tools: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp: (TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn): (TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread): Canonical link: https://commits.webkit.org/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { m_lock };
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
size_t result = 0;
for (FreeSpaceNode* node = m_freeSpaceSizeMap.first(); node; node = node->successor())
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
result += node->sizeInBytes();
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
return result;
#else
CRASH();
return 0;
#endif
}
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
void MetaAllocator::addFreeSpace(FreeSpacePtr start, size_t sizeInBytes)
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
{
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr end = start + sizeInBytes;
HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator leftNeighbor = m_freeSpaceEndAddressMap.find(start);
HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator rightNeighbor = m_freeSpaceStartAddressMap.find(end);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
if (leftNeighbor != m_freeSpaceEndAddressMap.end()) {
// We have something we can coalesce with on the left. Remove it from the tree, and
// remove its end from the end address map.
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
ASSERT(leftNeighbor->value->m_end == leftNeighbor->key);
Rename first/second to key/value in HashMap iterators https://bugs.webkit.org/show_bug.cgi?id=82784 Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> on 2012-10-07 Reviewed by Eric Seidel. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnNonIndexPropertyNames): * API/JSClassRef.cpp: (OpaqueJSClass::~OpaqueJSClass): (OpaqueJSClassContextData::OpaqueJSClassContextData): (OpaqueJSClass::contextData): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::EvalCodeCache::visitAggregate): (JSC::CodeBlock::nameForRegister): * bytecode/JumpTable.h: (JSC::StringJumpTable::offsetForValue): (JSC::StringJumpTable::ctiForValue): * bytecode/LazyOperandValueProfile.cpp: (JSC::LazyOperandValueProfileParser::getIfPresent): * bytecode/SamplingTool.cpp: (JSC::SamplingTool::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addVar): (JSC::BytecodeGenerator::addGlobalVar): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addConstantValue): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitLazyNewFunction): * bytecompiler/NodesCodegen.cpp: (JSC::PropertyListNode::emitBytecode): * debugger/Debugger.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild): * dfg/DFGAssemblyHelpers.cpp: (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): * dfg/DFGByteCodeCache.h: (JSC::DFG::ByteCodeCache::~ByteCodeCache): (JSC::DFG::ByteCodeCache::get): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstant): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck): (JSC::DFG::StructureCheckHoistingPhase::noticeClobber): * heap/Heap.cpp: (JSC::Heap::markProtectedObjects): * heap/Heap.h: (JSC::Heap::forEachProtectedCell): * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::markSlow): (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::internalAppend): * heap/Weak.h: (JSC::weakRemove): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JITStubs.cpp: (JSC::JITThunks::ctiStub): * parser/Parser.cpp: (JSC::::parseStrictObjectLiteral): * profiler/Profile.cpp: (JSC::functionNameCountPairComparator): (JSC::Profile::debugPrintDataSampleStyle): * runtime/Identifier.cpp: (JSC::Identifier::add): * runtime/JSActivation.cpp: (JSC::JSActivation::getOwnNonIndexPropertyNames): (JSC::JSActivation::symbolTablePutWithAttributes): * runtime/JSArray.cpp: (JSC::JSArray::setLength): * runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertySlotByIndex): (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): (JSC::JSObject::deletePropertyByIndex): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::defineOwnIndexedProperty): (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::getOwnPropertyDescriptor): * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): * runtime/JSSymbolTableObject.h: (JSC::symbolTableGet): (JSC::symbolTablePut): (JSC::symbolTablePutWithAttributes): * runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayValueMap::putEntry): (JSC::SparseArrayValueMap::putDirect): (JSC::SparseArrayValueMap::visitChildren): * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): (JSC::WeakGCMap::set): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::sampleChild): (JSC::ProfileTreeNode::childCount): (JSC::ProfileTreeNode::dumpInternal): (JSC::ProfileTreeNode::compareEntries): Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::Watchers::find): (WebCore::Geolocation::Watchers::remove): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames): * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::metadata): * Modules/indexeddb/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::deleteDatabase): (WebCore::IDBFactoryBackendImpl::openBackingStore): (WebCore::IDBFactoryBackendImpl::open): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::metadata): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::objectStoreDeleted): (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::dispatchEvent): * Modules/mediastream/MediaConstraintsImpl.cpp: (WebCore::MediaConstraintsImpl::getMandatoryConstraints): (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): * Modules/webdatabase/AbstractDatabase.cpp: (WebCore::AbstractDatabase::performOpenAndVerify): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/OriginUsageRecord.cpp: (WebCore::OriginUsageRecord::diskUsage): * Modules/webdatabase/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::acquireLock): (WebCore::SQLTransactionCoordinator::releaseLock): (WebCore::SQLTransactionCoordinator::shutdown): * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/chromium/QuotaTracker.cpp: (WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin): (WebCore::QuotaTracker::updateDatabaseSize): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCache::clearByFrame): * bindings/js/DOMObjectHashTableMap.h: (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/JSDOMBinding.cpp: (WebCore::cacheDOMStructure): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::visitChildren): * bindings/js/JSDOMGlobalObject.h: (WebCore::getDOMConstructor): * bindings/js/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::addListener): (WebCore::PageScriptDebugServer::removeListener): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): (WebCore::ScriptController::updateDocument): (WebCore::ScriptController::createRootObject): (WebCore::ScriptController::collectIsolatedContexts): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::clearScriptObjects): * bindings/js/ScriptController.h: (WebCore::ScriptController::windowShell): (WebCore::ScriptController::existingWindowShell): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::checkForDuplicate): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * bindings/scripts/CodeGeneratorV8.pm: (GenerateImplementation): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::V8Float64Array::GetRawTemplate): (WebCore::V8Float64Array::GetTemplate): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::V8TestActiveDOMObject::GetRawTemplate): (WebCore::V8TestActiveDOMObject::GetTemplate): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::V8TestCustomNamedGetter::GetRawTemplate): (WebCore::V8TestCustomNamedGetter::GetTemplate): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::GetRawTemplate): (WebCore::V8TestEventConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::V8TestEventTarget::GetRawTemplate): (WebCore::V8TestEventTarget::GetTemplate): * bindings/scripts/test/V8/V8TestException.cpp: (WebCore::V8TestException::GetRawTemplate): (WebCore::V8TestException::GetTemplate): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::V8TestInterface::GetRawTemplate): (WebCore::V8TestInterface::GetTemplate): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::V8TestMediaQueryListListener::GetRawTemplate): (WebCore::V8TestMediaQueryListListener::GetTemplate): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructor::GetRawTemplate): (WebCore::V8TestNamedConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestNode.cpp: (WebCore::V8TestNode::GetRawTemplate): (WebCore::V8TestNode::GetTemplate): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::V8TestObj::GetRawTemplate): (WebCore::V8TestObj::GetTemplate): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): * bindings/v8/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::deallocate): (WebCore::DOMWrapperWorld::ensureIsolatedWorld): * bindings/v8/NPV8Object.cpp: (WebCore::freeV8NPObject): (WebCore::npCreateV8ScriptObject): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::clearScriptObjects): (WebCore::ScriptController::resetIsolatedWorlds): (WebCore::ScriptController::ensureIsolatedWorldContext): (WebCore::ScriptController::existingWindowShellInternal): (WebCore::ScriptController::evaluateInIsolatedWorld): (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::collectIsolatedContexts): * bindings/v8/SerializedScriptValue.cpp: * bindings/v8/V8DOMMap.h: (WebCore::WeakReferenceMap::removeIfPresent): (WebCore::WeakReferenceMap::visit): * bindings/v8/V8PerContextData.cpp: (WebCore::V8PerContextData::dispose): * bindings/v8/npruntime.cpp: * bridge/IdentifierRep.cpp: (WebCore::IdentifierRep::get): * bridge/NP_jsobject.cpp: (ObjectMap::add): (ObjectMap::remove): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::invalidate): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::canvasChanged): (WebCore::CSSCanvasValue::canvasResized): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::crossfadeChanged): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): (WebCore::CSSFontSelector::getFontData): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::addClient): (WebCore::CSSImageGeneratorValue::removeClient): (WebCore::CSSImageGeneratorValue::getImage): * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::getFontData): * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoType): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): * css/RuleSet.cpp: (WebCore::reportAtomRuleMap): (WebCore::RuleSet::addToRuleSet): (WebCore::shrinkMapVectorsToFit): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCounter::applyInheritValue): (WebCore::ApplyPropertyCounter::applyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectFeatures): (WebCore::StyleResolver::ruleSetForScope): (WebCore::StyleResolver::appendAuthorStylesheets): (WebCore::StyleResolver::sweepMatchedPropertiesCache): (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAddNamespace): (WebCore::StyleSheetContents::determineNamespace): * dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/Document.cpp: (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems): (WebCore::Document::getCSSCanvasElement): (WebCore::Document::cachedImmutableAttributeData): (WebCore::Document::getCachedLocalizer): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): (WebCore::DocumentMarkerController::showMarkers): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::remove): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets): * dom/ElementAttributeData.cpp: (WebCore::ensureAttrListForElement): * dom/EventDispatcher.cpp: (WebCore::EventRelatedTargetAdjuster::findRelatedTarget): * dom/IdTargetObserverRegistry.cpp: (WebCore::IdTargetObserverRegistry::addObserver): (WebCore::IdTargetObserverRegistry::removeObserver): * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::isOldValueRequested): (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::clearRareData): (WebCore::NodeListsNodeData::invalidateCaches): (WebCore::collectMatchingObserversForMutation): * dom/NodeRareData.h: (WebCore::NodeListsNodeData::addCacheWithAtomicName): (WebCore::NodeListsNodeData::addCacheWithName): (WebCore::NodeListsNodeData::addCacheWithQualifiedName): (WebCore::NodeListsNodeData::adoptTreeScope): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * editing/mac/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): * html/FormController.cpp: (WebCore::SavedFormState::serializeTo): (WebCore::SavedFormState::appendControlState): (WebCore::SavedFormState::takeControlState): (WebCore::SavedFormState::getReferencedFilePaths): (WebCore::FormKeyGenerator::formKey): (WebCore::FormController::createSavedFormStateMap): (WebCore::FormController::formElementsState): (WebCore::FormController::takeStateForFormElement): (WebCore::FormController::getReferencedFilePaths): * html/HTMLCollection.cpp: (WebCore::HTMLCollectionCacheBase::append): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getAttachment): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::checkStatus): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * inspector/CodeGeneratorInspector.py: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::diff): (WebCore::DOMPatchSupport::innerPatchChildren): (WebCore::DOMPatchSupport::removeChildAndMoveToNew): * inspector/InjectedScriptManager.cpp: (WebCore::InjectedScriptManager::injectedScriptForId): (WebCore::InjectedScriptManager::injectedScriptIdFor): (WebCore::InjectedScriptManager::discardInjectedScriptsFor): (WebCore::InjectedScriptManager::releaseObjectGroup): (WebCore::InjectedScriptManager::injectedScriptFor): * inspector/InspectorCSSAgent.cpp: (WebCore::SelectorProfile::commitSelector): (WebCore::SelectorProfile::commitSelectorTime): (WebCore::SelectorProfile::toInspectorObject): (WebCore::UpdateRegionLayoutTask::onTimer): (WebCore::InspectorCSSAgent::forcePseudoState): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::assertStyleSheetForId): (WebCore::InspectorCSSAgent::didRemoveDOMNode): (WebCore::InspectorCSSAgent::didModifyDOMAttr): (WebCore::InspectorCSSAgent::resetPseudoStates): * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::stopTiming): (WebCore::InspectorConsoleAgent::count): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::clearFrontend): (WebCore::InspectorDOMStorageAgent::enable): (WebCore::InspectorDOMStorageAgent::storageId): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::enable): (WebCore::InspectorDatabaseAgent::databaseId): (WebCore::InspectorDatabaseAgent::findByFileName): (WebCore::InspectorDatabaseAgent::databaseForId): * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::setBreakpointByUrl): (WebCore::InspectorDebuggerAgent::removeBreakpoint): (WebCore::InspectorDebuggerAgent::resolveBreakpoint): (WebCore::InspectorDebuggerAgent::searchInContent): (WebCore::InspectorDebuggerAgent::getScriptSource): (WebCore::InspectorDebuggerAgent::didParseSource): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): * inspector/InspectorMemoryAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::cachedResourcesForFrame): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::frameDetached): * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getProfileHeaders): (WebCore): (WebCore::InspectorProfilerAgent::getProfile): * inspector/InspectorResourceAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): (WebCore::InspectorResourceAgent::willLoadXHR): (WebCore::InspectorResourceAgent::replayXHR): * inspector/InspectorState.cpp: (WebCore::InspectorState::getBoolean): (WebCore::InspectorState::getString): (WebCore::InspectorState::getLong): (WebCore::InspectorState::getDouble): (WebCore::InspectorState::getObject): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): (WebCore::InspectorStyleSheet::inspectorStyleForId): * inspector/InspectorValues.cpp: (WebCore::InspectorObjectBase::get): (WebCore::InspectorObjectBase::writeJSON): * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::workerContextTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers): (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels): * inspector/MemoryInstrumentationImpl.cpp: (WebCore::MemoryInstrumentationClientImpl::countObjectSize): * inspector/MemoryInstrumentationImpl.h: (WebCore::MemoryInstrumentationClientImpl::totalSize): (WebCore::MemoryInstrumentationClientImpl::reportedSizeForAllTypes): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setXHRReplayData): (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): * loader/CrossOriginAccessControl.cpp: (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::createAccessControlPreflightRequest): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): (WebCore::CrossOriginPreflightResultCache::canSkipPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::getSubresources): (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::servePendingRequests): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::removeResource): (WebCore::ApplicationCache::clearStorageID): (WebCore::ApplicationCache::dump): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::fillResourceList): * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::estimatedSizeInStorage): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::empty): (WebCore::ApplicationCacheStorage::storeCopyOfCache): * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::switchClientsToRevalidatedResource): (WebCore::CachedResource::updateResponseAfterRevalidation): * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): (WebCore::CachedResourceLoader::removeCachedResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeResourcesWithOrigin): (WebCore::MemoryCache::getOriginsWithCache): (WebCore::MemoryCache::getStatistics): (WebCore::MemoryCache::setDisabled): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::removeAllIcons): (WebCore::IconDatabase::iconRecordCountWithData): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/PageGroup.cpp: (WebCore::PageGroup::pageGroup): (WebCore::PageGroup::closeLocalStorage): (WebCore::PageGroup::clearLocalStorageForAllOrigins): (WebCore::PageGroup::clearLocalStorageForOrigin): (WebCore::PageGroup::syncLocalStorage): (WebCore::PageGroup::addUserScriptToWorld): (WebCore::PageGroup::addUserStyleSheetToWorld): (WebCore::PageGroup::removeUserScriptFromWorld): (WebCore::PageGroup::removeUserStyleSheetFromWorld): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): * page/Settings.cpp: (WebCore::setGenericFontFamilyMap): (WebCore::getGenericFontFamilyForScript): * page/SpeechInput.cpp: (WebCore::SpeechInput::registerListener): * page/TouchDisambiguation.cpp: (WebCore::findGoodTouchTargets): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::boolFeature): (WebCore::WindowFeatures::floatFeature): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::updateAnimations): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::numberOfActiveAnimations): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): (WebCore::CompositeAnimation::animate): (WebCore::CompositeAnimation::getAnimatedStyle): (WebCore::CompositeAnimation::setAnimating): (WebCore::CompositeAnimation::timeToNextService): (WebCore::CompositeAnimation::getAnimationForProperty): (WebCore::CompositeAnimation::suspendAnimations): (WebCore::CompositeAnimation::resumeAnimations): (WebCore::CompositeAnimation::overrideImplicitAnimations): (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations): (WebCore::CompositeAnimation::isAnimatingProperty): (WebCore::CompositeAnimation::numberOfActiveAnimations): * platform/Language.cpp: (WebCore::languageDidChange): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getNormalizedMIMEType): * platform/audio/HRTFElevation.cpp: (WebCore::getConcatenatedImpulseResponsesForSubject): * platform/blackberry/CookieManager.cpp: (WebCore::CookieManager::generateHtmlFragmentForCookies): (WebCore::CookieManager::removeAllCookies): * platform/blackberry/CookieMap.cpp: (WebCore::CookieMap::removeOldestCookie): (WebCore::CookieMap::getAllChildCookies): * platform/cf/BinaryPropertyList.cpp: (WebCore::BinaryPropertyListPlan::writeIntegerArray): * platform/chromium/support/WebHTTPLoadInfo.cpp: (WebKit::addHeader): * platform/chromium/support/WebURLRequest.cpp: (WebKit::WebURLRequest::visitHTTPHeaderFields): * platform/chromium/support/WebURLResponse.cpp: (WebKit::WebURLResponse::addHTTPHeaderField): (WebKit::WebURLResponse::visitHTTPHeaderFields): * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient): (WebCore::DisplayRefreshMonitorManager::unregisterClient): * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::getVerticalData): (WebCore::FontCache::getCachedFontData): (WebCore::FontCache::releaseFontData): (WebCore::FontCache::purgeInactiveFontData): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): (WebCore::GlyphPageTreeNode::pageCount): (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData): (WebCore::GlyphPageTreeNode::pruneTreeFontData): (WebCore::GlyphPageTreeNode::pruneCustomFontData): (WebCore::GlyphPageTreeNode::pruneFontData): (WebCore::GlyphPageTreeNode::showSubtree): (showGlyphPageTrees): * platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers): (WebCore::TiledBackingStore::resizeEdgeTiles): (WebCore::TiledBackingStore::setKeepRect): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::avfWrapperForCallbackContext): * platform/graphics/blackberry/LayerTiler.cpp: (WebCore::LayerTiler::layerVisibilityChanged): (WebCore::LayerTiler::uploadTexturesIfNeeded): (WebCore::LayerTiler::addTileJob): (WebCore::LayerTiler::deleteTextures): (WebCore::LayerTiler::pruneTextures): (WebCore::LayerTiler::bindContentsTexture): * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: (WebCore::TextureCacheCompositingThread::textureForTiledContents): (WebCore::TextureCacheCompositingThread::textureForColor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::layerDidDisplay): (WebCore::GraphicsLayerCA::updateGeometry): (WebCore::GraphicsLayerCA::updateTransform): (WebCore::GraphicsLayerCA::updateChildrenTransform): (WebCore::GraphicsLayerCA::updateMasksToBounds): (WebCore::GraphicsLayerCA::updateContentsVisibility): (WebCore::GraphicsLayerCA::updateContentsOpaque): (WebCore::GraphicsLayerCA::updateBackfaceVisibility): (WebCore::GraphicsLayerCA::updateFilters): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::updateLayerDrawsContent): (WebCore::GraphicsLayerCA::updateContentsImage): (WebCore::GraphicsLayerCA::updateContentsRect): (WebCore::GraphicsLayerCA::updateMaskLayer): (WebCore::GraphicsLayerCA::updateLayerAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::suspendAnimations): (WebCore::GraphicsLayerCA::resumeAnimations): (WebCore::GraphicsLayerCA::findOrMakeClone): (WebCore::GraphicsLayerCA::setOpacityInternal): (WebCore::GraphicsLayerCA::updateOpacityOnLayer): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::~TileCache): (WebCore::TileCache::setNeedsDisplay): (WebCore::TileCache::setScale): (WebCore::TileCache::setAcceleratesDrawing): (WebCore::TileCache::setTileDebugBorderWidth): (WebCore::TileCache::setTileDebugBorderColor): (WebCore::TileCache::revalidateTiles): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::animationStarted): (resubmitAllAnimations): (PlatformCALayer::animationForKey): * platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::LookupAltName): (WebCore::fontContainsCharacter): * platform/graphics/chromium/FontUtilsChromiumWin.cpp: (WebCore::getDerivedFontData): * platform/graphics/filters/CustomFilterGlobalContext.cpp: (WebCore::CustomFilterGlobalContext::~CustomFilterGlobalContext): (WebCore::CustomFilterGlobalContext::getValidatedProgram): (WebCore::CustomFilterGlobalContext::removeValidatedProgram): * platform/graphics/filters/CustomFilterProgram.cpp: (WebCore::CustomFilterProgram::notifyClients): * platform/graphics/harfbuzz/HarfBuzzSkia.cpp: (WebCore::getCachedHarfbuzzFace): (WebCore::releaseCachedHarfbuzzFace): * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.cpp: (WebCore::HarfBuzzNGFace::HarfBuzzNGFace): (WebCore::HarfBuzzNGFace::~HarfBuzzNGFace): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::SimpleFontData::getCFStringAttributes): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::canRenderCombiningCharacterSequence): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::mappedSymbolName): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): * platform/graphics/openvg/EGLDisplayOpenVG.cpp: (WebCore::EGLDisplayOpenVG::~EGLDisplayOpenVG): (WebCore::EGLDisplayOpenVG::destroySurface): (WebCore::EGLDisplayOpenVG::contextForSurface): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderManager::getShaderForFilter): * platform/graphics/wince/FontPlatformData.cpp: (WebCore::FixedSizeFontData::create): * platform/gtk/DataObjectGtk.cpp: (WebCore::DataObjectGtk::forClipboard): * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleGetDragData): (WebCore::GtkDragAndDropHelper::handleDragLeave): (WebCore::GtkDragAndDropHelper::handleDragMotion): (WebCore::GtkDragAndDropHelper::handleDragDataReceived): (WebCore::GtkDragAndDropHelper::handleDragDrop): * platform/gtk/RedirectedXCompositeWindow.cpp: (WebCore::filterXDamageEvent): * platform/gtk/RenderThemeGtk3.cpp: (WebCore::gtkStyleChangedCallback): (WebCore::getStyleContext): * platform/mac/ScrollbarThemeMac.mm: (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): (WebCore::CredentialStorage::get): * platform/network/HTTPHeaderMap.cpp: (WebCore::HTTPHeaderMap::copyData): (WebCore::HTTPHeaderMap::get): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::addHTTPHeaderField): (WebCore::ResourceRequestBase::addHTTPHeaderFields): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::ResourceRequest::targetTypeFromMimeType): (WebCore::ResourceRequest::initializePlatformRequest): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::makeFinalRequest): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/qt/ResourceRequestQt.cpp: (WebCore::ResourceRequest::toNetworkRequest): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): (WebCore::ResourceHandle::setClientCertificate): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessage): (WebCore::ResourceRequest::toSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::toSoupMessage): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/RunLoopQt.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/text/LocaleToScriptMappingDefault.cpp: (WebCore::scriptNameToCode): (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlacklistedCodecs): (WebCore::dumpTextEncodingNameMap): * platform/text/transcoder/FontTranscoder.cpp: (WebCore::FontTranscoder::converterType): * platform/text/win/TextCodecWin.cpp: (WebCore::LanguageManager::LanguageManager): (WebCore::getCodePage): (WebCore::TextCodecWin::registerExtendedEncodingNames): (WebCore::TextCodecWin::registerExtendedCodecs): (WebCore::TextCodecWin::enumerateSupportedEncodings): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::getDataMapItem): (WebCore::getClipboardData): (WebCore::setClipboardData): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::types): * platform/win/FileSystemWin.cpp: (WebCore::cachedStorageDirectory): * platform/win/RunLoopWin.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::createInstance): * platform/wince/MIMETypeRegistryWinCE.cpp: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/wx/ContextMenuWx.cpp: (WebCore::ContextMenu::appendItem): * plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): (WebCore::PluginDatabase::MIMETypeForExtension): (WebCore::PluginDatabase::remove): * plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::dispatchCalls): * plugins/PluginStream.cpp: (WebCore::PluginStream::startStream): * plugins/blackberry/PluginDataBlackBerry.cpp: (WebCore::PluginData::initPlugins): * plugins/wx/PluginDataWx.cpp: (WebCore::PluginData::initPlugins): * rendering/ExclusionShapeInsideInfo.cpp: (WebCore::ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::unregisterNamedFlowContentNode): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::addTextBoxVisualOverflow): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::clearFloats): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderBoxModelObject.cpp: (WebCore::ImageQualityController::highQualityRepaintTimerFired): (WebCore::ImageQualityController::shouldPaintAtLowQuality): * rendering/RenderCounter.cpp: (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (WebCore::RenderCounter::rendererStyleChanged): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::setRegionRangeForBox): (WebCore::RenderFlowThread::getRegionRangeForBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::performOverlapTests): * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayerFilterInfo::filterInfoForRenderLayer): (WebCore::RenderLayerFilterInfo::createFilterInfoForRenderLayerIfNeeded): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dependsOn): (WebCore::RenderNamedFlowThread::pushDependencies): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::setRegionObjectsRegionStyle): (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle): (WebCore::RenderRegion::computeChildrenStyleInRegion): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor): * rendering/RenderView.cpp: (WebCore::RenderView::selectionBounds): (WebCore::RenderView::setSelection): * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): * rendering/VerticalPositionCache.h: (WebCore::VerticalPositionCache::get): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::swapItemsInLayoutAttributes): * rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::dump): * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap): (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::syncTimerFired): (WebCore::StorageAreaSync::performImport): (WebCore::StorageAreaSync::sync): * storage/StorageMap.cpp: (WebCore::StorageMap::key): (WebCore::StorageMap::setItem): * storage/StorageNamespaceImpl.cpp: (WebCore::StorageNamespaceImpl::localStorageNamespace): (WebCore::StorageNamespaceImpl::copy): (WebCore::StorageNamespaceImpl::close): (WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion): (WebCore::StorageNamespaceImpl::sync): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAnimationElementFromTarget): (WebCore::SVGDocumentExtensions::removeAllAnimationElementsFromTarget): (WebCore::SVGDocumentExtensions::addPendingResource): (WebCore::SVGDocumentExtensions::isElementPendingResources): (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::updateAnimations): * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::requestedSizeAndScales): (WebCore::SVGImageCache::imageContentChanged): (WebCore::SVGImageCache::redraw): (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer): * svg/graphics/filters/SVGFilterBuilder.h: (WebCore::SVGFilterBuilder::effectReferences): (WebCore::SVGFilterBuilder::addBuiltinEffects): * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): * svg/properties/SVGAttributeToPropertyMap.cpp: (WebCore::SVGAttributeToPropertyMap::addProperties): (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): * workers/WorkerContext.cpp: (WebCore::WorkerContext::hasPendingActivity): * workers/WorkerEventQueue.cpp: (WebCore::WorkerEventQueue::close): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeaderInternal): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunction): * xml/XPathParser.cpp: (isAxisName): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/XSLTProcessorQt.cpp: (WebCore::XSLTProcessor::transformToString): Source/WebKit/blackberry: * Api/BackingStore.cpp: (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect): (BlackBerry::WebKit::BackingStorePrivate::visibleTilesRect): (BlackBerry::WebKit::BackingStorePrivate::resetTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion): (BlackBerry::WebKit::BackingStorePrivate::mapFromTransformedContentsToTiles): * WebCoreSupport/NotificationPresenterImpl.cpp: (WebCore::NotificationPresenterImpl::cancel): (WebCore::NotificationPresenterImpl::onPermission): (WebCore::NotificationPresenterImpl::notificationClicked): * WebCoreSupport/UserMediaClientImpl.cpp: (WebCore::UserMediaClientImpl::cancelUserMediaRequest): * WebKitSupport/AboutData.cpp: (BlackBerry::WebKit::dumpJSCTypeCountSetToTableHTML): * WebKitSupport/FrameLayers.cpp: (BlackBerry::WebKit::FrameLayers::removeLayerByFrame): (BlackBerry::WebKit::FrameLayers::commitOnWebKitThread): (BlackBerry::WebKit::FrameLayers::calculateRootLayer): Source/WebKit/chromium: * src/WebGeolocationPermissionRequestManager.cpp: (WebGeolocationPermissionRequestManager::remove): * src/WebIDBMetadata.cpp: (WebKit::WebIDBMetadata::WebIDBMetadata): * src/WebIntent.cpp: (WebKit::WebIntent::extrasValue): * tests/MemoryInstrumentationTest.cpp: * tests/WebSocketExtensionDispatcherTest.cpp: (WebCore::TEST_F): Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld): * WebCoreSupport/PlatformStrategiesEfl.cpp: (PlatformStrategiesEfl::getPluginInfo): * ewk/ewk_intent.cpp: (ewk_intent_extra_get): Source/WebKit/gtk: * WebCoreSupport/PlatformStrategiesGtk.cpp: (PlatformStrategiesGtk::getPluginInfo): * webkit/webkitfavicondatabase.cpp: (webkitFaviconDatabaseImportFinished): * webkit/webkitwebplugin.cpp: (webkit_web_plugin_get_mimetypes): Source/WebKit/mac: * History/WebHistory.mm: (-[WebHistoryPrivate removeItemFromDateCaches:]): (-[WebHistoryPrivate orderedLastVisitedDays]): (WebHistoryWriter::WebHistoryWriter): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPlugin): (WebKit::NetscapePluginHostManager::pluginHostDied): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::webFrameDidFinishLoadWithReason): (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): * WebCoreSupport/WebNotificationClient.mm: (WebNotificationClient::show): (WebNotificationClient::clearNotifications): (WebNotificationClient::notificationObjectDestroyed): * WebView/WebHTMLView.mm: (commandNameForSelector): Source/WebKit/qt: * Api/qwebpage.cpp: (extractContentTypeFromPluginVector): * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): * WebCoreSupport/PlatformStrategiesQt.cpp: (PlatformStrategiesQt::getPluginInfo): Source/WebKit/win: * COMPropertyBag.h: (::Read): (::GetPropertyInfo): * WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): * WebCoreSupport/WebPlatformStrategies.cpp: (WebPlatformStrategies::getPluginInfo): * WebHistory.cpp: (WebHistory::removeItemFromDateCaches): * WebKitCOMAPI.cpp: (classFactory): * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): * WebNotificationCenter.cpp: (WebNotificationCenter::postNotificationInternal): (WebNotificationCenter::addObserver): (WebNotificationCenter::removeObserver): Source/WebKit/wince: * WebCoreSupport/PlatformStrategiesWinCE.cpp: (PlatformStrategiesWinCE::getPluginInfo): Source/WebKit2: * Platform/CoreIPC/ArgumentCoders.h: * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::SyncMessageState::getOrCreate): (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::processIncomingMessage): * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerEventSourceHandler): (WorkQueue::unregisterEventSourceHandler): * Platform/mac/WorkQueueMac.cpp: (WorkQueue::unregisterMachPortEventHandler): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::pluginDestroyed): * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): * Shared/WebPreferencesStore.cpp: (WebKit::valueForKey): (WebKit::WebPreferencesStore::getBoolValueForKey): * Shared/mac/WebCoreArgumentCodersMac.mm: (CoreIPC::::decode): * Shared/qt/ArgumentCodersQt.cpp: (CoreIPC::::decode): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (CoreIPC::::decode): * UIProcess/API/efl/ewk_back_forward_list.cpp: (_Ewk_Back_Forward_List::~_Ewk_Back_Forward_List): * UIProcess/API/efl/ewk_context.cpp: (_Ewk_Context::~_Ewk_Context): * UIProcess/API/efl/ewk_view.cpp: (_ewk_view_priv_loading_resources_clear): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_subresources): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _expectedPreviewCallbackForRect:]): (pageDidDrawToPDF): (-[WKPrintingView _drawPreview:]): * UIProcess/API/mac/WKView.mm: (commandNameForSelector): (-[WKView validateUserInterfaceItem:]): * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStore::updateTile): (WebKit::CoordinatedBackingStore::texture): (WebKit::CoordinatedBackingStore::paintToTextureMapper): (WebKit::CoordinatedBackingStore::commitTileOperations): * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp: (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: (WebKit::LayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::LayerTreeRenderer::syncCanvas): (WebKit::LayerTreeRenderer::setLayerChildren): (WebKit::LayerTreeRenderer::setLayerFilters): (WebKit::LayerTreeRenderer::setLayerState): (WebKit::LayerTreeRenderer::assignImageToLayer): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::~WebInspectorServer): (WebKit::WebInspectorServer::registerPage): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::sendHTTPResponseHeader): * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp: (WebKit::WebInspectorServer::buildPageList): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): * UIProcess/WebContext.cpp: (WebKit::createDictionaryFromHashMap): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didFinishURLImport): * UIProcess/WebIntentData.cpp: (WebKit::WebIntentData::extras): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::addBackForwardItem): (WebKit::WebProcessProxy::frameCountInPage): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: (WebKit::InjectedBundleIntent::extras): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::removeNotificationFromContextMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::destroyStream): (WebKit::NetscapePlugin::frameDidFinishLoading): (WebKit::NetscapePlugin::frameDidFail): * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): (WebKit::PluginView::~PluginView): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::layerByID): * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp: (WebKit::LayerTreeCoordinator::adoptImageBackingStore): (WebKit::LayerTreeCoordinator::releaseImageBackingStore): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::commandNameForSelectorName): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::visitedLinkStateChanged): (WebKit::WebProcess::allVisitedLinkStateChanged): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::fromCountedSetToHashMap): (WebKit::WebProcess::setTextCheckerState): Source/WTF: Currently HashMap iterators follow the same interface in std::map: given an iterator it, we use it->first to access the key and it->second to access the value. This patch changes these accesses to it->key and it->value, improving the readability at call sites. One potential downside of this change would be the confusion between std::map and HashMap interfaces. However, they are already different in other aspects and the usage of std::map is more an exception than a rule in WebKit code, so we consider the confusion will be less likely to happen. * wtf/HashCountedSet.h: (WTF::::add): (WTF::::remove): (WTF::copyToVector): * wtf/HashIterators.h: (WTF::HashTableConstKeysIterator::get): (WTF::HashTableConstValuesIterator::get): (WTF::HashTableKeysIterator::get): (WTF::HashTableValuesIterator::get): * wtf/HashMap.h: (WTF::KeyValuePairKeyExtractor::extract): (WTF::HashMapValueTraits::isEmptyValue): (WTF::HashMapTranslator::translate): (WTF::HashMapTranslatorAdapter::translate): (WTF::::set): (WTF::::get): (WTF::::take): (WTF::operator==): (WTF::deleteAllValues): (WTF::deleteAllKeys): Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused. * wtf/HashTable.h: (WTF::hashTableSwap): (WTF::::checkTableConsistencyExceptSize): * wtf/HashTraits.h: (WTF): (WTF::KeyValuePair::KeyValuePair): (KeyValuePair): (WTF::KeyValuePairHashTraits::constructDeletedValue): (WTF::KeyValuePairHashTraits::isDeletedValue): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/RefCountedLeakCounter.cpp: (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): * wtf/RefPtrHashMap.h: (WTF::::set): (WTF::::get): (WTF::::inlineGet): (WTF::::take): * wtf/Spectrum.h: (WTF::Spectrum::add): (WTF::Spectrum::get): (WTF::Spectrum::buildList): * wtf/ThreadingPthreads.cpp: (WTF::identifierByPthreadHandle): Tools: * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: (MockWebSpeechInputController::addMockRecognitionResult): * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::simulateClick): (NotificationPresenter::show): * DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp: (CppBoundClass::~CppBoundClass): (CppBoundClass::invoke): (CppBoundClass::getProperty): (CppBoundClass::setProperty): (CppBoundClass::bindCallback): (CppBoundClass::bindProperty): * DumpRenderTree/chromium/WebPreferences.cpp: (applyFontMap): * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printResourceDescription): * DumpRenderTree/mac/TestRunnerMac.mm: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * DumpRenderTree/win/AccessibilityControllerWin.cpp: (AccessibilityController::~AccessibilityController): (AccessibilityController::winNotificationReceived): * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::descriptionSuitableForTestResult): * DumpRenderTree/win/TestRunnerWin.cpp: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::worldIDForWorld): (WTR::TestRunner::evaluateScriptInIsolatedWorld): Canonical link: https://commits.webkit.org/116599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-07 23:12:07 +00:00
FreeSpaceNode* leftNode = leftNeighbor->value;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr leftEnd = leftNode->m_end;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
ASSERT(leftEnd == start);
m_freeSpaceSizeMap.remove(leftNode);
m_freeSpaceEndAddressMap.remove(leftEnd);
// Now check if there is also something to coalesce with on the right.
if (rightNeighbor != m_freeSpaceStartAddressMap.end()) {
// Freeing something in the middle of free blocks. Coalesce both left and
// right, whilst removing the right neighbor from the maps.
Rename first/second to key/value in HashMap iterators https://bugs.webkit.org/show_bug.cgi?id=82784 Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> on 2012-10-07 Reviewed by Eric Seidel. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnNonIndexPropertyNames): * API/JSClassRef.cpp: (OpaqueJSClass::~OpaqueJSClass): (OpaqueJSClassContextData::OpaqueJSClassContextData): (OpaqueJSClass::contextData): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::EvalCodeCache::visitAggregate): (JSC::CodeBlock::nameForRegister): * bytecode/JumpTable.h: (JSC::StringJumpTable::offsetForValue): (JSC::StringJumpTable::ctiForValue): * bytecode/LazyOperandValueProfile.cpp: (JSC::LazyOperandValueProfileParser::getIfPresent): * bytecode/SamplingTool.cpp: (JSC::SamplingTool::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addVar): (JSC::BytecodeGenerator::addGlobalVar): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addConstantValue): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitLazyNewFunction): * bytecompiler/NodesCodegen.cpp: (JSC::PropertyListNode::emitBytecode): * debugger/Debugger.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild): * dfg/DFGAssemblyHelpers.cpp: (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): * dfg/DFGByteCodeCache.h: (JSC::DFG::ByteCodeCache::~ByteCodeCache): (JSC::DFG::ByteCodeCache::get): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstant): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck): (JSC::DFG::StructureCheckHoistingPhase::noticeClobber): * heap/Heap.cpp: (JSC::Heap::markProtectedObjects): * heap/Heap.h: (JSC::Heap::forEachProtectedCell): * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::markSlow): (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::internalAppend): * heap/Weak.h: (JSC::weakRemove): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JITStubs.cpp: (JSC::JITThunks::ctiStub): * parser/Parser.cpp: (JSC::::parseStrictObjectLiteral): * profiler/Profile.cpp: (JSC::functionNameCountPairComparator): (JSC::Profile::debugPrintDataSampleStyle): * runtime/Identifier.cpp: (JSC::Identifier::add): * runtime/JSActivation.cpp: (JSC::JSActivation::getOwnNonIndexPropertyNames): (JSC::JSActivation::symbolTablePutWithAttributes): * runtime/JSArray.cpp: (JSC::JSArray::setLength): * runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertySlotByIndex): (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): (JSC::JSObject::deletePropertyByIndex): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::defineOwnIndexedProperty): (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::getOwnPropertyDescriptor): * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): * runtime/JSSymbolTableObject.h: (JSC::symbolTableGet): (JSC::symbolTablePut): (JSC::symbolTablePutWithAttributes): * runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayValueMap::putEntry): (JSC::SparseArrayValueMap::putDirect): (JSC::SparseArrayValueMap::visitChildren): * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): (JSC::WeakGCMap::set): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::sampleChild): (JSC::ProfileTreeNode::childCount): (JSC::ProfileTreeNode::dumpInternal): (JSC::ProfileTreeNode::compareEntries): Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::Watchers::find): (WebCore::Geolocation::Watchers::remove): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames): * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::metadata): * Modules/indexeddb/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::deleteDatabase): (WebCore::IDBFactoryBackendImpl::openBackingStore): (WebCore::IDBFactoryBackendImpl::open): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::metadata): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::objectStoreDeleted): (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::dispatchEvent): * Modules/mediastream/MediaConstraintsImpl.cpp: (WebCore::MediaConstraintsImpl::getMandatoryConstraints): (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): * Modules/webdatabase/AbstractDatabase.cpp: (WebCore::AbstractDatabase::performOpenAndVerify): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/OriginUsageRecord.cpp: (WebCore::OriginUsageRecord::diskUsage): * Modules/webdatabase/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::acquireLock): (WebCore::SQLTransactionCoordinator::releaseLock): (WebCore::SQLTransactionCoordinator::shutdown): * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/chromium/QuotaTracker.cpp: (WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin): (WebCore::QuotaTracker::updateDatabaseSize): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCache::clearByFrame): * bindings/js/DOMObjectHashTableMap.h: (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/JSDOMBinding.cpp: (WebCore::cacheDOMStructure): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::visitChildren): * bindings/js/JSDOMGlobalObject.h: (WebCore::getDOMConstructor): * bindings/js/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::addListener): (WebCore::PageScriptDebugServer::removeListener): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): (WebCore::ScriptController::updateDocument): (WebCore::ScriptController::createRootObject): (WebCore::ScriptController::collectIsolatedContexts): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::clearScriptObjects): * bindings/js/ScriptController.h: (WebCore::ScriptController::windowShell): (WebCore::ScriptController::existingWindowShell): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::checkForDuplicate): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * bindings/scripts/CodeGeneratorV8.pm: (GenerateImplementation): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::V8Float64Array::GetRawTemplate): (WebCore::V8Float64Array::GetTemplate): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::V8TestActiveDOMObject::GetRawTemplate): (WebCore::V8TestActiveDOMObject::GetTemplate): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::V8TestCustomNamedGetter::GetRawTemplate): (WebCore::V8TestCustomNamedGetter::GetTemplate): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::GetRawTemplate): (WebCore::V8TestEventConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::V8TestEventTarget::GetRawTemplate): (WebCore::V8TestEventTarget::GetTemplate): * bindings/scripts/test/V8/V8TestException.cpp: (WebCore::V8TestException::GetRawTemplate): (WebCore::V8TestException::GetTemplate): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::V8TestInterface::GetRawTemplate): (WebCore::V8TestInterface::GetTemplate): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::V8TestMediaQueryListListener::GetRawTemplate): (WebCore::V8TestMediaQueryListListener::GetTemplate): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructor::GetRawTemplate): (WebCore::V8TestNamedConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestNode.cpp: (WebCore::V8TestNode::GetRawTemplate): (WebCore::V8TestNode::GetTemplate): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::V8TestObj::GetRawTemplate): (WebCore::V8TestObj::GetTemplate): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): * bindings/v8/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::deallocate): (WebCore::DOMWrapperWorld::ensureIsolatedWorld): * bindings/v8/NPV8Object.cpp: (WebCore::freeV8NPObject): (WebCore::npCreateV8ScriptObject): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::clearScriptObjects): (WebCore::ScriptController::resetIsolatedWorlds): (WebCore::ScriptController::ensureIsolatedWorldContext): (WebCore::ScriptController::existingWindowShellInternal): (WebCore::ScriptController::evaluateInIsolatedWorld): (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::collectIsolatedContexts): * bindings/v8/SerializedScriptValue.cpp: * bindings/v8/V8DOMMap.h: (WebCore::WeakReferenceMap::removeIfPresent): (WebCore::WeakReferenceMap::visit): * bindings/v8/V8PerContextData.cpp: (WebCore::V8PerContextData::dispose): * bindings/v8/npruntime.cpp: * bridge/IdentifierRep.cpp: (WebCore::IdentifierRep::get): * bridge/NP_jsobject.cpp: (ObjectMap::add): (ObjectMap::remove): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::invalidate): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::canvasChanged): (WebCore::CSSCanvasValue::canvasResized): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::crossfadeChanged): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): (WebCore::CSSFontSelector::getFontData): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::addClient): (WebCore::CSSImageGeneratorValue::removeClient): (WebCore::CSSImageGeneratorValue::getImage): * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::getFontData): * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoType): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): * css/RuleSet.cpp: (WebCore::reportAtomRuleMap): (WebCore::RuleSet::addToRuleSet): (WebCore::shrinkMapVectorsToFit): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCounter::applyInheritValue): (WebCore::ApplyPropertyCounter::applyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectFeatures): (WebCore::StyleResolver::ruleSetForScope): (WebCore::StyleResolver::appendAuthorStylesheets): (WebCore::StyleResolver::sweepMatchedPropertiesCache): (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAddNamespace): (WebCore::StyleSheetContents::determineNamespace): * dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/Document.cpp: (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems): (WebCore::Document::getCSSCanvasElement): (WebCore::Document::cachedImmutableAttributeData): (WebCore::Document::getCachedLocalizer): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): (WebCore::DocumentMarkerController::showMarkers): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::remove): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets): * dom/ElementAttributeData.cpp: (WebCore::ensureAttrListForElement): * dom/EventDispatcher.cpp: (WebCore::EventRelatedTargetAdjuster::findRelatedTarget): * dom/IdTargetObserverRegistry.cpp: (WebCore::IdTargetObserverRegistry::addObserver): (WebCore::IdTargetObserverRegistry::removeObserver): * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::isOldValueRequested): (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::clearRareData): (WebCore::NodeListsNodeData::invalidateCaches): (WebCore::collectMatchingObserversForMutation): * dom/NodeRareData.h: (WebCore::NodeListsNodeData::addCacheWithAtomicName): (WebCore::NodeListsNodeData::addCacheWithName): (WebCore::NodeListsNodeData::addCacheWithQualifiedName): (WebCore::NodeListsNodeData::adoptTreeScope): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * editing/mac/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): * html/FormController.cpp: (WebCore::SavedFormState::serializeTo): (WebCore::SavedFormState::appendControlState): (WebCore::SavedFormState::takeControlState): (WebCore::SavedFormState::getReferencedFilePaths): (WebCore::FormKeyGenerator::formKey): (WebCore::FormController::createSavedFormStateMap): (WebCore::FormController::formElementsState): (WebCore::FormController::takeStateForFormElement): (WebCore::FormController::getReferencedFilePaths): * html/HTMLCollection.cpp: (WebCore::HTMLCollectionCacheBase::append): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getAttachment): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::checkStatus): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * inspector/CodeGeneratorInspector.py: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::diff): (WebCore::DOMPatchSupport::innerPatchChildren): (WebCore::DOMPatchSupport::removeChildAndMoveToNew): * inspector/InjectedScriptManager.cpp: (WebCore::InjectedScriptManager::injectedScriptForId): (WebCore::InjectedScriptManager::injectedScriptIdFor): (WebCore::InjectedScriptManager::discardInjectedScriptsFor): (WebCore::InjectedScriptManager::releaseObjectGroup): (WebCore::InjectedScriptManager::injectedScriptFor): * inspector/InspectorCSSAgent.cpp: (WebCore::SelectorProfile::commitSelector): (WebCore::SelectorProfile::commitSelectorTime): (WebCore::SelectorProfile::toInspectorObject): (WebCore::UpdateRegionLayoutTask::onTimer): (WebCore::InspectorCSSAgent::forcePseudoState): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::assertStyleSheetForId): (WebCore::InspectorCSSAgent::didRemoveDOMNode): (WebCore::InspectorCSSAgent::didModifyDOMAttr): (WebCore::InspectorCSSAgent::resetPseudoStates): * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::stopTiming): (WebCore::InspectorConsoleAgent::count): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::clearFrontend): (WebCore::InspectorDOMStorageAgent::enable): (WebCore::InspectorDOMStorageAgent::storageId): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::enable): (WebCore::InspectorDatabaseAgent::databaseId): (WebCore::InspectorDatabaseAgent::findByFileName): (WebCore::InspectorDatabaseAgent::databaseForId): * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::setBreakpointByUrl): (WebCore::InspectorDebuggerAgent::removeBreakpoint): (WebCore::InspectorDebuggerAgent::resolveBreakpoint): (WebCore::InspectorDebuggerAgent::searchInContent): (WebCore::InspectorDebuggerAgent::getScriptSource): (WebCore::InspectorDebuggerAgent::didParseSource): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): * inspector/InspectorMemoryAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::cachedResourcesForFrame): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::frameDetached): * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getProfileHeaders): (WebCore): (WebCore::InspectorProfilerAgent::getProfile): * inspector/InspectorResourceAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): (WebCore::InspectorResourceAgent::willLoadXHR): (WebCore::InspectorResourceAgent::replayXHR): * inspector/InspectorState.cpp: (WebCore::InspectorState::getBoolean): (WebCore::InspectorState::getString): (WebCore::InspectorState::getLong): (WebCore::InspectorState::getDouble): (WebCore::InspectorState::getObject): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): (WebCore::InspectorStyleSheet::inspectorStyleForId): * inspector/InspectorValues.cpp: (WebCore::InspectorObjectBase::get): (WebCore::InspectorObjectBase::writeJSON): * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::workerContextTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers): (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels): * inspector/MemoryInstrumentationImpl.cpp: (WebCore::MemoryInstrumentationClientImpl::countObjectSize): * inspector/MemoryInstrumentationImpl.h: (WebCore::MemoryInstrumentationClientImpl::totalSize): (WebCore::MemoryInstrumentationClientImpl::reportedSizeForAllTypes): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setXHRReplayData): (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): * loader/CrossOriginAccessControl.cpp: (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::createAccessControlPreflightRequest): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): (WebCore::CrossOriginPreflightResultCache::canSkipPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::getSubresources): (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::servePendingRequests): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::removeResource): (WebCore::ApplicationCache::clearStorageID): (WebCore::ApplicationCache::dump): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::fillResourceList): * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::estimatedSizeInStorage): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::empty): (WebCore::ApplicationCacheStorage::storeCopyOfCache): * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::switchClientsToRevalidatedResource): (WebCore::CachedResource::updateResponseAfterRevalidation): * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): (WebCore::CachedResourceLoader::removeCachedResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeResourcesWithOrigin): (WebCore::MemoryCache::getOriginsWithCache): (WebCore::MemoryCache::getStatistics): (WebCore::MemoryCache::setDisabled): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::removeAllIcons): (WebCore::IconDatabase::iconRecordCountWithData): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/PageGroup.cpp: (WebCore::PageGroup::pageGroup): (WebCore::PageGroup::closeLocalStorage): (WebCore::PageGroup::clearLocalStorageForAllOrigins): (WebCore::PageGroup::clearLocalStorageForOrigin): (WebCore::PageGroup::syncLocalStorage): (WebCore::PageGroup::addUserScriptToWorld): (WebCore::PageGroup::addUserStyleSheetToWorld): (WebCore::PageGroup::removeUserScriptFromWorld): (WebCore::PageGroup::removeUserStyleSheetFromWorld): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): * page/Settings.cpp: (WebCore::setGenericFontFamilyMap): (WebCore::getGenericFontFamilyForScript): * page/SpeechInput.cpp: (WebCore::SpeechInput::registerListener): * page/TouchDisambiguation.cpp: (WebCore::findGoodTouchTargets): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::boolFeature): (WebCore::WindowFeatures::floatFeature): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::updateAnimations): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::numberOfActiveAnimations): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): (WebCore::CompositeAnimation::animate): (WebCore::CompositeAnimation::getAnimatedStyle): (WebCore::CompositeAnimation::setAnimating): (WebCore::CompositeAnimation::timeToNextService): (WebCore::CompositeAnimation::getAnimationForProperty): (WebCore::CompositeAnimation::suspendAnimations): (WebCore::CompositeAnimation::resumeAnimations): (WebCore::CompositeAnimation::overrideImplicitAnimations): (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations): (WebCore::CompositeAnimation::isAnimatingProperty): (WebCore::CompositeAnimation::numberOfActiveAnimations): * platform/Language.cpp: (WebCore::languageDidChange): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getNormalizedMIMEType): * platform/audio/HRTFElevation.cpp: (WebCore::getConcatenatedImpulseResponsesForSubject): * platform/blackberry/CookieManager.cpp: (WebCore::CookieManager::generateHtmlFragmentForCookies): (WebCore::CookieManager::removeAllCookies): * platform/blackberry/CookieMap.cpp: (WebCore::CookieMap::removeOldestCookie): (WebCore::CookieMap::getAllChildCookies): * platform/cf/BinaryPropertyList.cpp: (WebCore::BinaryPropertyListPlan::writeIntegerArray): * platform/chromium/support/WebHTTPLoadInfo.cpp: (WebKit::addHeader): * platform/chromium/support/WebURLRequest.cpp: (WebKit::WebURLRequest::visitHTTPHeaderFields): * platform/chromium/support/WebURLResponse.cpp: (WebKit::WebURLResponse::addHTTPHeaderField): (WebKit::WebURLResponse::visitHTTPHeaderFields): * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient): (WebCore::DisplayRefreshMonitorManager::unregisterClient): * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::getVerticalData): (WebCore::FontCache::getCachedFontData): (WebCore::FontCache::releaseFontData): (WebCore::FontCache::purgeInactiveFontData): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): (WebCore::GlyphPageTreeNode::pageCount): (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData): (WebCore::GlyphPageTreeNode::pruneTreeFontData): (WebCore::GlyphPageTreeNode::pruneCustomFontData): (WebCore::GlyphPageTreeNode::pruneFontData): (WebCore::GlyphPageTreeNode::showSubtree): (showGlyphPageTrees): * platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers): (WebCore::TiledBackingStore::resizeEdgeTiles): (WebCore::TiledBackingStore::setKeepRect): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::avfWrapperForCallbackContext): * platform/graphics/blackberry/LayerTiler.cpp: (WebCore::LayerTiler::layerVisibilityChanged): (WebCore::LayerTiler::uploadTexturesIfNeeded): (WebCore::LayerTiler::addTileJob): (WebCore::LayerTiler::deleteTextures): (WebCore::LayerTiler::pruneTextures): (WebCore::LayerTiler::bindContentsTexture): * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: (WebCore::TextureCacheCompositingThread::textureForTiledContents): (WebCore::TextureCacheCompositingThread::textureForColor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::layerDidDisplay): (WebCore::GraphicsLayerCA::updateGeometry): (WebCore::GraphicsLayerCA::updateTransform): (WebCore::GraphicsLayerCA::updateChildrenTransform): (WebCore::GraphicsLayerCA::updateMasksToBounds): (WebCore::GraphicsLayerCA::updateContentsVisibility): (WebCore::GraphicsLayerCA::updateContentsOpaque): (WebCore::GraphicsLayerCA::updateBackfaceVisibility): (WebCore::GraphicsLayerCA::updateFilters): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::updateLayerDrawsContent): (WebCore::GraphicsLayerCA::updateContentsImage): (WebCore::GraphicsLayerCA::updateContentsRect): (WebCore::GraphicsLayerCA::updateMaskLayer): (WebCore::GraphicsLayerCA::updateLayerAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::suspendAnimations): (WebCore::GraphicsLayerCA::resumeAnimations): (WebCore::GraphicsLayerCA::findOrMakeClone): (WebCore::GraphicsLayerCA::setOpacityInternal): (WebCore::GraphicsLayerCA::updateOpacityOnLayer): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::~TileCache): (WebCore::TileCache::setNeedsDisplay): (WebCore::TileCache::setScale): (WebCore::TileCache::setAcceleratesDrawing): (WebCore::TileCache::setTileDebugBorderWidth): (WebCore::TileCache::setTileDebugBorderColor): (WebCore::TileCache::revalidateTiles): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::animationStarted): (resubmitAllAnimations): (PlatformCALayer::animationForKey): * platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::LookupAltName): (WebCore::fontContainsCharacter): * platform/graphics/chromium/FontUtilsChromiumWin.cpp: (WebCore::getDerivedFontData): * platform/graphics/filters/CustomFilterGlobalContext.cpp: (WebCore::CustomFilterGlobalContext::~CustomFilterGlobalContext): (WebCore::CustomFilterGlobalContext::getValidatedProgram): (WebCore::CustomFilterGlobalContext::removeValidatedProgram): * platform/graphics/filters/CustomFilterProgram.cpp: (WebCore::CustomFilterProgram::notifyClients): * platform/graphics/harfbuzz/HarfBuzzSkia.cpp: (WebCore::getCachedHarfbuzzFace): (WebCore::releaseCachedHarfbuzzFace): * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.cpp: (WebCore::HarfBuzzNGFace::HarfBuzzNGFace): (WebCore::HarfBuzzNGFace::~HarfBuzzNGFace): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::SimpleFontData::getCFStringAttributes): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::canRenderCombiningCharacterSequence): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::mappedSymbolName): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): * platform/graphics/openvg/EGLDisplayOpenVG.cpp: (WebCore::EGLDisplayOpenVG::~EGLDisplayOpenVG): (WebCore::EGLDisplayOpenVG::destroySurface): (WebCore::EGLDisplayOpenVG::contextForSurface): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderManager::getShaderForFilter): * platform/graphics/wince/FontPlatformData.cpp: (WebCore::FixedSizeFontData::create): * platform/gtk/DataObjectGtk.cpp: (WebCore::DataObjectGtk::forClipboard): * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleGetDragData): (WebCore::GtkDragAndDropHelper::handleDragLeave): (WebCore::GtkDragAndDropHelper::handleDragMotion): (WebCore::GtkDragAndDropHelper::handleDragDataReceived): (WebCore::GtkDragAndDropHelper::handleDragDrop): * platform/gtk/RedirectedXCompositeWindow.cpp: (WebCore::filterXDamageEvent): * platform/gtk/RenderThemeGtk3.cpp: (WebCore::gtkStyleChangedCallback): (WebCore::getStyleContext): * platform/mac/ScrollbarThemeMac.mm: (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): (WebCore::CredentialStorage::get): * platform/network/HTTPHeaderMap.cpp: (WebCore::HTTPHeaderMap::copyData): (WebCore::HTTPHeaderMap::get): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::addHTTPHeaderField): (WebCore::ResourceRequestBase::addHTTPHeaderFields): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::ResourceRequest::targetTypeFromMimeType): (WebCore::ResourceRequest::initializePlatformRequest): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::makeFinalRequest): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/qt/ResourceRequestQt.cpp: (WebCore::ResourceRequest::toNetworkRequest): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): (WebCore::ResourceHandle::setClientCertificate): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessage): (WebCore::ResourceRequest::toSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::toSoupMessage): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/RunLoopQt.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/text/LocaleToScriptMappingDefault.cpp: (WebCore::scriptNameToCode): (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlacklistedCodecs): (WebCore::dumpTextEncodingNameMap): * platform/text/transcoder/FontTranscoder.cpp: (WebCore::FontTranscoder::converterType): * platform/text/win/TextCodecWin.cpp: (WebCore::LanguageManager::LanguageManager): (WebCore::getCodePage): (WebCore::TextCodecWin::registerExtendedEncodingNames): (WebCore::TextCodecWin::registerExtendedCodecs): (WebCore::TextCodecWin::enumerateSupportedEncodings): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::getDataMapItem): (WebCore::getClipboardData): (WebCore::setClipboardData): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::types): * platform/win/FileSystemWin.cpp: (WebCore::cachedStorageDirectory): * platform/win/RunLoopWin.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::createInstance): * platform/wince/MIMETypeRegistryWinCE.cpp: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/wx/ContextMenuWx.cpp: (WebCore::ContextMenu::appendItem): * plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): (WebCore::PluginDatabase::MIMETypeForExtension): (WebCore::PluginDatabase::remove): * plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::dispatchCalls): * plugins/PluginStream.cpp: (WebCore::PluginStream::startStream): * plugins/blackberry/PluginDataBlackBerry.cpp: (WebCore::PluginData::initPlugins): * plugins/wx/PluginDataWx.cpp: (WebCore::PluginData::initPlugins): * rendering/ExclusionShapeInsideInfo.cpp: (WebCore::ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::unregisterNamedFlowContentNode): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::addTextBoxVisualOverflow): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::clearFloats): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderBoxModelObject.cpp: (WebCore::ImageQualityController::highQualityRepaintTimerFired): (WebCore::ImageQualityController::shouldPaintAtLowQuality): * rendering/RenderCounter.cpp: (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (WebCore::RenderCounter::rendererStyleChanged): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::setRegionRangeForBox): (WebCore::RenderFlowThread::getRegionRangeForBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::performOverlapTests): * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayerFilterInfo::filterInfoForRenderLayer): (WebCore::RenderLayerFilterInfo::createFilterInfoForRenderLayerIfNeeded): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dependsOn): (WebCore::RenderNamedFlowThread::pushDependencies): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::setRegionObjectsRegionStyle): (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle): (WebCore::RenderRegion::computeChildrenStyleInRegion): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor): * rendering/RenderView.cpp: (WebCore::RenderView::selectionBounds): (WebCore::RenderView::setSelection): * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): * rendering/VerticalPositionCache.h: (WebCore::VerticalPositionCache::get): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::swapItemsInLayoutAttributes): * rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::dump): * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap): (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::syncTimerFired): (WebCore::StorageAreaSync::performImport): (WebCore::StorageAreaSync::sync): * storage/StorageMap.cpp: (WebCore::StorageMap::key): (WebCore::StorageMap::setItem): * storage/StorageNamespaceImpl.cpp: (WebCore::StorageNamespaceImpl::localStorageNamespace): (WebCore::StorageNamespaceImpl::copy): (WebCore::StorageNamespaceImpl::close): (WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion): (WebCore::StorageNamespaceImpl::sync): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAnimationElementFromTarget): (WebCore::SVGDocumentExtensions::removeAllAnimationElementsFromTarget): (WebCore::SVGDocumentExtensions::addPendingResource): (WebCore::SVGDocumentExtensions::isElementPendingResources): (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::updateAnimations): * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::requestedSizeAndScales): (WebCore::SVGImageCache::imageContentChanged): (WebCore::SVGImageCache::redraw): (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer): * svg/graphics/filters/SVGFilterBuilder.h: (WebCore::SVGFilterBuilder::effectReferences): (WebCore::SVGFilterBuilder::addBuiltinEffects): * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): * svg/properties/SVGAttributeToPropertyMap.cpp: (WebCore::SVGAttributeToPropertyMap::addProperties): (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): * workers/WorkerContext.cpp: (WebCore::WorkerContext::hasPendingActivity): * workers/WorkerEventQueue.cpp: (WebCore::WorkerEventQueue::close): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeaderInternal): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunction): * xml/XPathParser.cpp: (isAxisName): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/XSLTProcessorQt.cpp: (WebCore::XSLTProcessor::transformToString): Source/WebKit/blackberry: * Api/BackingStore.cpp: (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect): (BlackBerry::WebKit::BackingStorePrivate::visibleTilesRect): (BlackBerry::WebKit::BackingStorePrivate::resetTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion): (BlackBerry::WebKit::BackingStorePrivate::mapFromTransformedContentsToTiles): * WebCoreSupport/NotificationPresenterImpl.cpp: (WebCore::NotificationPresenterImpl::cancel): (WebCore::NotificationPresenterImpl::onPermission): (WebCore::NotificationPresenterImpl::notificationClicked): * WebCoreSupport/UserMediaClientImpl.cpp: (WebCore::UserMediaClientImpl::cancelUserMediaRequest): * WebKitSupport/AboutData.cpp: (BlackBerry::WebKit::dumpJSCTypeCountSetToTableHTML): * WebKitSupport/FrameLayers.cpp: (BlackBerry::WebKit::FrameLayers::removeLayerByFrame): (BlackBerry::WebKit::FrameLayers::commitOnWebKitThread): (BlackBerry::WebKit::FrameLayers::calculateRootLayer): Source/WebKit/chromium: * src/WebGeolocationPermissionRequestManager.cpp: (WebGeolocationPermissionRequestManager::remove): * src/WebIDBMetadata.cpp: (WebKit::WebIDBMetadata::WebIDBMetadata): * src/WebIntent.cpp: (WebKit::WebIntent::extrasValue): * tests/MemoryInstrumentationTest.cpp: * tests/WebSocketExtensionDispatcherTest.cpp: (WebCore::TEST_F): Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld): * WebCoreSupport/PlatformStrategiesEfl.cpp: (PlatformStrategiesEfl::getPluginInfo): * ewk/ewk_intent.cpp: (ewk_intent_extra_get): Source/WebKit/gtk: * WebCoreSupport/PlatformStrategiesGtk.cpp: (PlatformStrategiesGtk::getPluginInfo): * webkit/webkitfavicondatabase.cpp: (webkitFaviconDatabaseImportFinished): * webkit/webkitwebplugin.cpp: (webkit_web_plugin_get_mimetypes): Source/WebKit/mac: * History/WebHistory.mm: (-[WebHistoryPrivate removeItemFromDateCaches:]): (-[WebHistoryPrivate orderedLastVisitedDays]): (WebHistoryWriter::WebHistoryWriter): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPlugin): (WebKit::NetscapePluginHostManager::pluginHostDied): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::webFrameDidFinishLoadWithReason): (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): * WebCoreSupport/WebNotificationClient.mm: (WebNotificationClient::show): (WebNotificationClient::clearNotifications): (WebNotificationClient::notificationObjectDestroyed): * WebView/WebHTMLView.mm: (commandNameForSelector): Source/WebKit/qt: * Api/qwebpage.cpp: (extractContentTypeFromPluginVector): * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): * WebCoreSupport/PlatformStrategiesQt.cpp: (PlatformStrategiesQt::getPluginInfo): Source/WebKit/win: * COMPropertyBag.h: (::Read): (::GetPropertyInfo): * WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): * WebCoreSupport/WebPlatformStrategies.cpp: (WebPlatformStrategies::getPluginInfo): * WebHistory.cpp: (WebHistory::removeItemFromDateCaches): * WebKitCOMAPI.cpp: (classFactory): * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): * WebNotificationCenter.cpp: (WebNotificationCenter::postNotificationInternal): (WebNotificationCenter::addObserver): (WebNotificationCenter::removeObserver): Source/WebKit/wince: * WebCoreSupport/PlatformStrategiesWinCE.cpp: (PlatformStrategiesWinCE::getPluginInfo): Source/WebKit2: * Platform/CoreIPC/ArgumentCoders.h: * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::SyncMessageState::getOrCreate): (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::processIncomingMessage): * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerEventSourceHandler): (WorkQueue::unregisterEventSourceHandler): * Platform/mac/WorkQueueMac.cpp: (WorkQueue::unregisterMachPortEventHandler): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::pluginDestroyed): * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): * Shared/WebPreferencesStore.cpp: (WebKit::valueForKey): (WebKit::WebPreferencesStore::getBoolValueForKey): * Shared/mac/WebCoreArgumentCodersMac.mm: (CoreIPC::::decode): * Shared/qt/ArgumentCodersQt.cpp: (CoreIPC::::decode): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (CoreIPC::::decode): * UIProcess/API/efl/ewk_back_forward_list.cpp: (_Ewk_Back_Forward_List::~_Ewk_Back_Forward_List): * UIProcess/API/efl/ewk_context.cpp: (_Ewk_Context::~_Ewk_Context): * UIProcess/API/efl/ewk_view.cpp: (_ewk_view_priv_loading_resources_clear): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_subresources): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _expectedPreviewCallbackForRect:]): (pageDidDrawToPDF): (-[WKPrintingView _drawPreview:]): * UIProcess/API/mac/WKView.mm: (commandNameForSelector): (-[WKView validateUserInterfaceItem:]): * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStore::updateTile): (WebKit::CoordinatedBackingStore::texture): (WebKit::CoordinatedBackingStore::paintToTextureMapper): (WebKit::CoordinatedBackingStore::commitTileOperations): * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp: (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: (WebKit::LayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::LayerTreeRenderer::syncCanvas): (WebKit::LayerTreeRenderer::setLayerChildren): (WebKit::LayerTreeRenderer::setLayerFilters): (WebKit::LayerTreeRenderer::setLayerState): (WebKit::LayerTreeRenderer::assignImageToLayer): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::~WebInspectorServer): (WebKit::WebInspectorServer::registerPage): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::sendHTTPResponseHeader): * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp: (WebKit::WebInspectorServer::buildPageList): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): * UIProcess/WebContext.cpp: (WebKit::createDictionaryFromHashMap): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didFinishURLImport): * UIProcess/WebIntentData.cpp: (WebKit::WebIntentData::extras): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::addBackForwardItem): (WebKit::WebProcessProxy::frameCountInPage): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: (WebKit::InjectedBundleIntent::extras): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::removeNotificationFromContextMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::destroyStream): (WebKit::NetscapePlugin::frameDidFinishLoading): (WebKit::NetscapePlugin::frameDidFail): * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): (WebKit::PluginView::~PluginView): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::layerByID): * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp: (WebKit::LayerTreeCoordinator::adoptImageBackingStore): (WebKit::LayerTreeCoordinator::releaseImageBackingStore): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::commandNameForSelectorName): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::visitedLinkStateChanged): (WebKit::WebProcess::allVisitedLinkStateChanged): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::fromCountedSetToHashMap): (WebKit::WebProcess::setTextCheckerState): Source/WTF: Currently HashMap iterators follow the same interface in std::map: given an iterator it, we use it->first to access the key and it->second to access the value. This patch changes these accesses to it->key and it->value, improving the readability at call sites. One potential downside of this change would be the confusion between std::map and HashMap interfaces. However, they are already different in other aspects and the usage of std::map is more an exception than a rule in WebKit code, so we consider the confusion will be less likely to happen. * wtf/HashCountedSet.h: (WTF::::add): (WTF::::remove): (WTF::copyToVector): * wtf/HashIterators.h: (WTF::HashTableConstKeysIterator::get): (WTF::HashTableConstValuesIterator::get): (WTF::HashTableKeysIterator::get): (WTF::HashTableValuesIterator::get): * wtf/HashMap.h: (WTF::KeyValuePairKeyExtractor::extract): (WTF::HashMapValueTraits::isEmptyValue): (WTF::HashMapTranslator::translate): (WTF::HashMapTranslatorAdapter::translate): (WTF::::set): (WTF::::get): (WTF::::take): (WTF::operator==): (WTF::deleteAllValues): (WTF::deleteAllKeys): Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused. * wtf/HashTable.h: (WTF::hashTableSwap): (WTF::::checkTableConsistencyExceptSize): * wtf/HashTraits.h: (WTF): (WTF::KeyValuePair::KeyValuePair): (KeyValuePair): (WTF::KeyValuePairHashTraits::constructDeletedValue): (WTF::KeyValuePairHashTraits::isDeletedValue): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/RefCountedLeakCounter.cpp: (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): * wtf/RefPtrHashMap.h: (WTF::::set): (WTF::::get): (WTF::::inlineGet): (WTF::::take): * wtf/Spectrum.h: (WTF::Spectrum::add): (WTF::Spectrum::get): (WTF::Spectrum::buildList): * wtf/ThreadingPthreads.cpp: (WTF::identifierByPthreadHandle): Tools: * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: (MockWebSpeechInputController::addMockRecognitionResult): * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::simulateClick): (NotificationPresenter::show): * DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp: (CppBoundClass::~CppBoundClass): (CppBoundClass::invoke): (CppBoundClass::getProperty): (CppBoundClass::setProperty): (CppBoundClass::bindCallback): (CppBoundClass::bindProperty): * DumpRenderTree/chromium/WebPreferences.cpp: (applyFontMap): * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printResourceDescription): * DumpRenderTree/mac/TestRunnerMac.mm: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * DumpRenderTree/win/AccessibilityControllerWin.cpp: (AccessibilityController::~AccessibilityController): (AccessibilityController::winNotificationReceived): * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::descriptionSuitableForTestResult): * DumpRenderTree/win/TestRunnerWin.cpp: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::worldIDForWorld): (WTR::TestRunner::evaluateScriptInIsolatedWorld): Canonical link: https://commits.webkit.org/116599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-07 23:12:07 +00:00
ASSERT(rightNeighbor->value->m_start == rightNeighbor->key);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
Rename first/second to key/value in HashMap iterators https://bugs.webkit.org/show_bug.cgi?id=82784 Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> on 2012-10-07 Reviewed by Eric Seidel. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnNonIndexPropertyNames): * API/JSClassRef.cpp: (OpaqueJSClass::~OpaqueJSClass): (OpaqueJSClassContextData::OpaqueJSClassContextData): (OpaqueJSClass::contextData): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::EvalCodeCache::visitAggregate): (JSC::CodeBlock::nameForRegister): * bytecode/JumpTable.h: (JSC::StringJumpTable::offsetForValue): (JSC::StringJumpTable::ctiForValue): * bytecode/LazyOperandValueProfile.cpp: (JSC::LazyOperandValueProfileParser::getIfPresent): * bytecode/SamplingTool.cpp: (JSC::SamplingTool::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addVar): (JSC::BytecodeGenerator::addGlobalVar): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addConstantValue): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitLazyNewFunction): * bytecompiler/NodesCodegen.cpp: (JSC::PropertyListNode::emitBytecode): * debugger/Debugger.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild): * dfg/DFGAssemblyHelpers.cpp: (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): * dfg/DFGByteCodeCache.h: (JSC::DFG::ByteCodeCache::~ByteCodeCache): (JSC::DFG::ByteCodeCache::get): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstant): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck): (JSC::DFG::StructureCheckHoistingPhase::noticeClobber): * heap/Heap.cpp: (JSC::Heap::markProtectedObjects): * heap/Heap.h: (JSC::Heap::forEachProtectedCell): * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::markSlow): (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::internalAppend): * heap/Weak.h: (JSC::weakRemove): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JITStubs.cpp: (JSC::JITThunks::ctiStub): * parser/Parser.cpp: (JSC::::parseStrictObjectLiteral): * profiler/Profile.cpp: (JSC::functionNameCountPairComparator): (JSC::Profile::debugPrintDataSampleStyle): * runtime/Identifier.cpp: (JSC::Identifier::add): * runtime/JSActivation.cpp: (JSC::JSActivation::getOwnNonIndexPropertyNames): (JSC::JSActivation::symbolTablePutWithAttributes): * runtime/JSArray.cpp: (JSC::JSArray::setLength): * runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertySlotByIndex): (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): (JSC::JSObject::deletePropertyByIndex): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::defineOwnIndexedProperty): (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::getOwnPropertyDescriptor): * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): * runtime/JSSymbolTableObject.h: (JSC::symbolTableGet): (JSC::symbolTablePut): (JSC::symbolTablePutWithAttributes): * runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayValueMap::putEntry): (JSC::SparseArrayValueMap::putDirect): (JSC::SparseArrayValueMap::visitChildren): * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): (JSC::WeakGCMap::set): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::sampleChild): (JSC::ProfileTreeNode::childCount): (JSC::ProfileTreeNode::dumpInternal): (JSC::ProfileTreeNode::compareEntries): Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::Watchers::find): (WebCore::Geolocation::Watchers::remove): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames): * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::metadata): * Modules/indexeddb/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::deleteDatabase): (WebCore::IDBFactoryBackendImpl::openBackingStore): (WebCore::IDBFactoryBackendImpl::open): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::metadata): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::objectStoreDeleted): (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::dispatchEvent): * Modules/mediastream/MediaConstraintsImpl.cpp: (WebCore::MediaConstraintsImpl::getMandatoryConstraints): (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): * Modules/webdatabase/AbstractDatabase.cpp: (WebCore::AbstractDatabase::performOpenAndVerify): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/OriginUsageRecord.cpp: (WebCore::OriginUsageRecord::diskUsage): * Modules/webdatabase/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::acquireLock): (WebCore::SQLTransactionCoordinator::releaseLock): (WebCore::SQLTransactionCoordinator::shutdown): * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/chromium/QuotaTracker.cpp: (WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin): (WebCore::QuotaTracker::updateDatabaseSize): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCache::clearByFrame): * bindings/js/DOMObjectHashTableMap.h: (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/JSDOMBinding.cpp: (WebCore::cacheDOMStructure): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::visitChildren): * bindings/js/JSDOMGlobalObject.h: (WebCore::getDOMConstructor): * bindings/js/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::addListener): (WebCore::PageScriptDebugServer::removeListener): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): (WebCore::ScriptController::updateDocument): (WebCore::ScriptController::createRootObject): (WebCore::ScriptController::collectIsolatedContexts): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::clearScriptObjects): * bindings/js/ScriptController.h: (WebCore::ScriptController::windowShell): (WebCore::ScriptController::existingWindowShell): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::checkForDuplicate): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * bindings/scripts/CodeGeneratorV8.pm: (GenerateImplementation): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::V8Float64Array::GetRawTemplate): (WebCore::V8Float64Array::GetTemplate): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::V8TestActiveDOMObject::GetRawTemplate): (WebCore::V8TestActiveDOMObject::GetTemplate): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::V8TestCustomNamedGetter::GetRawTemplate): (WebCore::V8TestCustomNamedGetter::GetTemplate): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::GetRawTemplate): (WebCore::V8TestEventConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::V8TestEventTarget::GetRawTemplate): (WebCore::V8TestEventTarget::GetTemplate): * bindings/scripts/test/V8/V8TestException.cpp: (WebCore::V8TestException::GetRawTemplate): (WebCore::V8TestException::GetTemplate): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::V8TestInterface::GetRawTemplate): (WebCore::V8TestInterface::GetTemplate): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::V8TestMediaQueryListListener::GetRawTemplate): (WebCore::V8TestMediaQueryListListener::GetTemplate): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructor::GetRawTemplate): (WebCore::V8TestNamedConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestNode.cpp: (WebCore::V8TestNode::GetRawTemplate): (WebCore::V8TestNode::GetTemplate): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::V8TestObj::GetRawTemplate): (WebCore::V8TestObj::GetTemplate): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): * bindings/v8/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::deallocate): (WebCore::DOMWrapperWorld::ensureIsolatedWorld): * bindings/v8/NPV8Object.cpp: (WebCore::freeV8NPObject): (WebCore::npCreateV8ScriptObject): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::clearScriptObjects): (WebCore::ScriptController::resetIsolatedWorlds): (WebCore::ScriptController::ensureIsolatedWorldContext): (WebCore::ScriptController::existingWindowShellInternal): (WebCore::ScriptController::evaluateInIsolatedWorld): (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::collectIsolatedContexts): * bindings/v8/SerializedScriptValue.cpp: * bindings/v8/V8DOMMap.h: (WebCore::WeakReferenceMap::removeIfPresent): (WebCore::WeakReferenceMap::visit): * bindings/v8/V8PerContextData.cpp: (WebCore::V8PerContextData::dispose): * bindings/v8/npruntime.cpp: * bridge/IdentifierRep.cpp: (WebCore::IdentifierRep::get): * bridge/NP_jsobject.cpp: (ObjectMap::add): (ObjectMap::remove): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::invalidate): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::canvasChanged): (WebCore::CSSCanvasValue::canvasResized): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::crossfadeChanged): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): (WebCore::CSSFontSelector::getFontData): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::addClient): (WebCore::CSSImageGeneratorValue::removeClient): (WebCore::CSSImageGeneratorValue::getImage): * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::getFontData): * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoType): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): * css/RuleSet.cpp: (WebCore::reportAtomRuleMap): (WebCore::RuleSet::addToRuleSet): (WebCore::shrinkMapVectorsToFit): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCounter::applyInheritValue): (WebCore::ApplyPropertyCounter::applyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectFeatures): (WebCore::StyleResolver::ruleSetForScope): (WebCore::StyleResolver::appendAuthorStylesheets): (WebCore::StyleResolver::sweepMatchedPropertiesCache): (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAddNamespace): (WebCore::StyleSheetContents::determineNamespace): * dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/Document.cpp: (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems): (WebCore::Document::getCSSCanvasElement): (WebCore::Document::cachedImmutableAttributeData): (WebCore::Document::getCachedLocalizer): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): (WebCore::DocumentMarkerController::showMarkers): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::remove): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets): * dom/ElementAttributeData.cpp: (WebCore::ensureAttrListForElement): * dom/EventDispatcher.cpp: (WebCore::EventRelatedTargetAdjuster::findRelatedTarget): * dom/IdTargetObserverRegistry.cpp: (WebCore::IdTargetObserverRegistry::addObserver): (WebCore::IdTargetObserverRegistry::removeObserver): * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::isOldValueRequested): (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::clearRareData): (WebCore::NodeListsNodeData::invalidateCaches): (WebCore::collectMatchingObserversForMutation): * dom/NodeRareData.h: (WebCore::NodeListsNodeData::addCacheWithAtomicName): (WebCore::NodeListsNodeData::addCacheWithName): (WebCore::NodeListsNodeData::addCacheWithQualifiedName): (WebCore::NodeListsNodeData::adoptTreeScope): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * editing/mac/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): * html/FormController.cpp: (WebCore::SavedFormState::serializeTo): (WebCore::SavedFormState::appendControlState): (WebCore::SavedFormState::takeControlState): (WebCore::SavedFormState::getReferencedFilePaths): (WebCore::FormKeyGenerator::formKey): (WebCore::FormController::createSavedFormStateMap): (WebCore::FormController::formElementsState): (WebCore::FormController::takeStateForFormElement): (WebCore::FormController::getReferencedFilePaths): * html/HTMLCollection.cpp: (WebCore::HTMLCollectionCacheBase::append): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getAttachment): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::checkStatus): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * inspector/CodeGeneratorInspector.py: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::diff): (WebCore::DOMPatchSupport::innerPatchChildren): (WebCore::DOMPatchSupport::removeChildAndMoveToNew): * inspector/InjectedScriptManager.cpp: (WebCore::InjectedScriptManager::injectedScriptForId): (WebCore::InjectedScriptManager::injectedScriptIdFor): (WebCore::InjectedScriptManager::discardInjectedScriptsFor): (WebCore::InjectedScriptManager::releaseObjectGroup): (WebCore::InjectedScriptManager::injectedScriptFor): * inspector/InspectorCSSAgent.cpp: (WebCore::SelectorProfile::commitSelector): (WebCore::SelectorProfile::commitSelectorTime): (WebCore::SelectorProfile::toInspectorObject): (WebCore::UpdateRegionLayoutTask::onTimer): (WebCore::InspectorCSSAgent::forcePseudoState): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::assertStyleSheetForId): (WebCore::InspectorCSSAgent::didRemoveDOMNode): (WebCore::InspectorCSSAgent::didModifyDOMAttr): (WebCore::InspectorCSSAgent::resetPseudoStates): * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::stopTiming): (WebCore::InspectorConsoleAgent::count): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::clearFrontend): (WebCore::InspectorDOMStorageAgent::enable): (WebCore::InspectorDOMStorageAgent::storageId): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::enable): (WebCore::InspectorDatabaseAgent::databaseId): (WebCore::InspectorDatabaseAgent::findByFileName): (WebCore::InspectorDatabaseAgent::databaseForId): * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::setBreakpointByUrl): (WebCore::InspectorDebuggerAgent::removeBreakpoint): (WebCore::InspectorDebuggerAgent::resolveBreakpoint): (WebCore::InspectorDebuggerAgent::searchInContent): (WebCore::InspectorDebuggerAgent::getScriptSource): (WebCore::InspectorDebuggerAgent::didParseSource): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): * inspector/InspectorMemoryAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::cachedResourcesForFrame): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::frameDetached): * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getProfileHeaders): (WebCore): (WebCore::InspectorProfilerAgent::getProfile): * inspector/InspectorResourceAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): (WebCore::InspectorResourceAgent::willLoadXHR): (WebCore::InspectorResourceAgent::replayXHR): * inspector/InspectorState.cpp: (WebCore::InspectorState::getBoolean): (WebCore::InspectorState::getString): (WebCore::InspectorState::getLong): (WebCore::InspectorState::getDouble): (WebCore::InspectorState::getObject): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): (WebCore::InspectorStyleSheet::inspectorStyleForId): * inspector/InspectorValues.cpp: (WebCore::InspectorObjectBase::get): (WebCore::InspectorObjectBase::writeJSON): * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::workerContextTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers): (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels): * inspector/MemoryInstrumentationImpl.cpp: (WebCore::MemoryInstrumentationClientImpl::countObjectSize): * inspector/MemoryInstrumentationImpl.h: (WebCore::MemoryInstrumentationClientImpl::totalSize): (WebCore::MemoryInstrumentationClientImpl::reportedSizeForAllTypes): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setXHRReplayData): (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): * loader/CrossOriginAccessControl.cpp: (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::createAccessControlPreflightRequest): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): (WebCore::CrossOriginPreflightResultCache::canSkipPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::getSubresources): (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::servePendingRequests): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::removeResource): (WebCore::ApplicationCache::clearStorageID): (WebCore::ApplicationCache::dump): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::fillResourceList): * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::estimatedSizeInStorage): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::empty): (WebCore::ApplicationCacheStorage::storeCopyOfCache): * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::switchClientsToRevalidatedResource): (WebCore::CachedResource::updateResponseAfterRevalidation): * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): (WebCore::CachedResourceLoader::removeCachedResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeResourcesWithOrigin): (WebCore::MemoryCache::getOriginsWithCache): (WebCore::MemoryCache::getStatistics): (WebCore::MemoryCache::setDisabled): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::removeAllIcons): (WebCore::IconDatabase::iconRecordCountWithData): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/PageGroup.cpp: (WebCore::PageGroup::pageGroup): (WebCore::PageGroup::closeLocalStorage): (WebCore::PageGroup::clearLocalStorageForAllOrigins): (WebCore::PageGroup::clearLocalStorageForOrigin): (WebCore::PageGroup::syncLocalStorage): (WebCore::PageGroup::addUserScriptToWorld): (WebCore::PageGroup::addUserStyleSheetToWorld): (WebCore::PageGroup::removeUserScriptFromWorld): (WebCore::PageGroup::removeUserStyleSheetFromWorld): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): * page/Settings.cpp: (WebCore::setGenericFontFamilyMap): (WebCore::getGenericFontFamilyForScript): * page/SpeechInput.cpp: (WebCore::SpeechInput::registerListener): * page/TouchDisambiguation.cpp: (WebCore::findGoodTouchTargets): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::boolFeature): (WebCore::WindowFeatures::floatFeature): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::updateAnimations): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::numberOfActiveAnimations): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): (WebCore::CompositeAnimation::animate): (WebCore::CompositeAnimation::getAnimatedStyle): (WebCore::CompositeAnimation::setAnimating): (WebCore::CompositeAnimation::timeToNextService): (WebCore::CompositeAnimation::getAnimationForProperty): (WebCore::CompositeAnimation::suspendAnimations): (WebCore::CompositeAnimation::resumeAnimations): (WebCore::CompositeAnimation::overrideImplicitAnimations): (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations): (WebCore::CompositeAnimation::isAnimatingProperty): (WebCore::CompositeAnimation::numberOfActiveAnimations): * platform/Language.cpp: (WebCore::languageDidChange): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getNormalizedMIMEType): * platform/audio/HRTFElevation.cpp: (WebCore::getConcatenatedImpulseResponsesForSubject): * platform/blackberry/CookieManager.cpp: (WebCore::CookieManager::generateHtmlFragmentForCookies): (WebCore::CookieManager::removeAllCookies): * platform/blackberry/CookieMap.cpp: (WebCore::CookieMap::removeOldestCookie): (WebCore::CookieMap::getAllChildCookies): * platform/cf/BinaryPropertyList.cpp: (WebCore::BinaryPropertyListPlan::writeIntegerArray): * platform/chromium/support/WebHTTPLoadInfo.cpp: (WebKit::addHeader): * platform/chromium/support/WebURLRequest.cpp: (WebKit::WebURLRequest::visitHTTPHeaderFields): * platform/chromium/support/WebURLResponse.cpp: (WebKit::WebURLResponse::addHTTPHeaderField): (WebKit::WebURLResponse::visitHTTPHeaderFields): * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient): (WebCore::DisplayRefreshMonitorManager::unregisterClient): * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::getVerticalData): (WebCore::FontCache::getCachedFontData): (WebCore::FontCache::releaseFontData): (WebCore::FontCache::purgeInactiveFontData): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): (WebCore::GlyphPageTreeNode::pageCount): (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData): (WebCore::GlyphPageTreeNode::pruneTreeFontData): (WebCore::GlyphPageTreeNode::pruneCustomFontData): (WebCore::GlyphPageTreeNode::pruneFontData): (WebCore::GlyphPageTreeNode::showSubtree): (showGlyphPageTrees): * platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers): (WebCore::TiledBackingStore::resizeEdgeTiles): (WebCore::TiledBackingStore::setKeepRect): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::avfWrapperForCallbackContext): * platform/graphics/blackberry/LayerTiler.cpp: (WebCore::LayerTiler::layerVisibilityChanged): (WebCore::LayerTiler::uploadTexturesIfNeeded): (WebCore::LayerTiler::addTileJob): (WebCore::LayerTiler::deleteTextures): (WebCore::LayerTiler::pruneTextures): (WebCore::LayerTiler::bindContentsTexture): * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: (WebCore::TextureCacheCompositingThread::textureForTiledContents): (WebCore::TextureCacheCompositingThread::textureForColor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::layerDidDisplay): (WebCore::GraphicsLayerCA::updateGeometry): (WebCore::GraphicsLayerCA::updateTransform): (WebCore::GraphicsLayerCA::updateChildrenTransform): (WebCore::GraphicsLayerCA::updateMasksToBounds): (WebCore::GraphicsLayerCA::updateContentsVisibility): (WebCore::GraphicsLayerCA::updateContentsOpaque): (WebCore::GraphicsLayerCA::updateBackfaceVisibility): (WebCore::GraphicsLayerCA::updateFilters): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::updateLayerDrawsContent): (WebCore::GraphicsLayerCA::updateContentsImage): (WebCore::GraphicsLayerCA::updateContentsRect): (WebCore::GraphicsLayerCA::updateMaskLayer): (WebCore::GraphicsLayerCA::updateLayerAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::suspendAnimations): (WebCore::GraphicsLayerCA::resumeAnimations): (WebCore::GraphicsLayerCA::findOrMakeClone): (WebCore::GraphicsLayerCA::setOpacityInternal): (WebCore::GraphicsLayerCA::updateOpacityOnLayer): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::~TileCache): (WebCore::TileCache::setNeedsDisplay): (WebCore::TileCache::setScale): (WebCore::TileCache::setAcceleratesDrawing): (WebCore::TileCache::setTileDebugBorderWidth): (WebCore::TileCache::setTileDebugBorderColor): (WebCore::TileCache::revalidateTiles): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::animationStarted): (resubmitAllAnimations): (PlatformCALayer::animationForKey): * platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::LookupAltName): (WebCore::fontContainsCharacter): * platform/graphics/chromium/FontUtilsChromiumWin.cpp: (WebCore::getDerivedFontData): * platform/graphics/filters/CustomFilterGlobalContext.cpp: (WebCore::CustomFilterGlobalContext::~CustomFilterGlobalContext): (WebCore::CustomFilterGlobalContext::getValidatedProgram): (WebCore::CustomFilterGlobalContext::removeValidatedProgram): * platform/graphics/filters/CustomFilterProgram.cpp: (WebCore::CustomFilterProgram::notifyClients): * platform/graphics/harfbuzz/HarfBuzzSkia.cpp: (WebCore::getCachedHarfbuzzFace): (WebCore::releaseCachedHarfbuzzFace): * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.cpp: (WebCore::HarfBuzzNGFace::HarfBuzzNGFace): (WebCore::HarfBuzzNGFace::~HarfBuzzNGFace): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::SimpleFontData::getCFStringAttributes): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::canRenderCombiningCharacterSequence): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::mappedSymbolName): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): * platform/graphics/openvg/EGLDisplayOpenVG.cpp: (WebCore::EGLDisplayOpenVG::~EGLDisplayOpenVG): (WebCore::EGLDisplayOpenVG::destroySurface): (WebCore::EGLDisplayOpenVG::contextForSurface): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderManager::getShaderForFilter): * platform/graphics/wince/FontPlatformData.cpp: (WebCore::FixedSizeFontData::create): * platform/gtk/DataObjectGtk.cpp: (WebCore::DataObjectGtk::forClipboard): * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleGetDragData): (WebCore::GtkDragAndDropHelper::handleDragLeave): (WebCore::GtkDragAndDropHelper::handleDragMotion): (WebCore::GtkDragAndDropHelper::handleDragDataReceived): (WebCore::GtkDragAndDropHelper::handleDragDrop): * platform/gtk/RedirectedXCompositeWindow.cpp: (WebCore::filterXDamageEvent): * platform/gtk/RenderThemeGtk3.cpp: (WebCore::gtkStyleChangedCallback): (WebCore::getStyleContext): * platform/mac/ScrollbarThemeMac.mm: (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): (WebCore::CredentialStorage::get): * platform/network/HTTPHeaderMap.cpp: (WebCore::HTTPHeaderMap::copyData): (WebCore::HTTPHeaderMap::get): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::addHTTPHeaderField): (WebCore::ResourceRequestBase::addHTTPHeaderFields): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::ResourceRequest::targetTypeFromMimeType): (WebCore::ResourceRequest::initializePlatformRequest): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::makeFinalRequest): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/qt/ResourceRequestQt.cpp: (WebCore::ResourceRequest::toNetworkRequest): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): (WebCore::ResourceHandle::setClientCertificate): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessage): (WebCore::ResourceRequest::toSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::toSoupMessage): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/RunLoopQt.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/text/LocaleToScriptMappingDefault.cpp: (WebCore::scriptNameToCode): (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlacklistedCodecs): (WebCore::dumpTextEncodingNameMap): * platform/text/transcoder/FontTranscoder.cpp: (WebCore::FontTranscoder::converterType): * platform/text/win/TextCodecWin.cpp: (WebCore::LanguageManager::LanguageManager): (WebCore::getCodePage): (WebCore::TextCodecWin::registerExtendedEncodingNames): (WebCore::TextCodecWin::registerExtendedCodecs): (WebCore::TextCodecWin::enumerateSupportedEncodings): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::getDataMapItem): (WebCore::getClipboardData): (WebCore::setClipboardData): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::types): * platform/win/FileSystemWin.cpp: (WebCore::cachedStorageDirectory): * platform/win/RunLoopWin.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::createInstance): * platform/wince/MIMETypeRegistryWinCE.cpp: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/wx/ContextMenuWx.cpp: (WebCore::ContextMenu::appendItem): * plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): (WebCore::PluginDatabase::MIMETypeForExtension): (WebCore::PluginDatabase::remove): * plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::dispatchCalls): * plugins/PluginStream.cpp: (WebCore::PluginStream::startStream): * plugins/blackberry/PluginDataBlackBerry.cpp: (WebCore::PluginData::initPlugins): * plugins/wx/PluginDataWx.cpp: (WebCore::PluginData::initPlugins): * rendering/ExclusionShapeInsideInfo.cpp: (WebCore::ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::unregisterNamedFlowContentNode): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::addTextBoxVisualOverflow): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::clearFloats): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderBoxModelObject.cpp: (WebCore::ImageQualityController::highQualityRepaintTimerFired): (WebCore::ImageQualityController::shouldPaintAtLowQuality): * rendering/RenderCounter.cpp: (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (WebCore::RenderCounter::rendererStyleChanged): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::setRegionRangeForBox): (WebCore::RenderFlowThread::getRegionRangeForBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::performOverlapTests): * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayerFilterInfo::filterInfoForRenderLayer): (WebCore::RenderLayerFilterInfo::createFilterInfoForRenderLayerIfNeeded): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dependsOn): (WebCore::RenderNamedFlowThread::pushDependencies): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::setRegionObjectsRegionStyle): (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle): (WebCore::RenderRegion::computeChildrenStyleInRegion): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor): * rendering/RenderView.cpp: (WebCore::RenderView::selectionBounds): (WebCore::RenderView::setSelection): * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): * rendering/VerticalPositionCache.h: (WebCore::VerticalPositionCache::get): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::swapItemsInLayoutAttributes): * rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::dump): * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap): (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::syncTimerFired): (WebCore::StorageAreaSync::performImport): (WebCore::StorageAreaSync::sync): * storage/StorageMap.cpp: (WebCore::StorageMap::key): (WebCore::StorageMap::setItem): * storage/StorageNamespaceImpl.cpp: (WebCore::StorageNamespaceImpl::localStorageNamespace): (WebCore::StorageNamespaceImpl::copy): (WebCore::StorageNamespaceImpl::close): (WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion): (WebCore::StorageNamespaceImpl::sync): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAnimationElementFromTarget): (WebCore::SVGDocumentExtensions::removeAllAnimationElementsFromTarget): (WebCore::SVGDocumentExtensions::addPendingResource): (WebCore::SVGDocumentExtensions::isElementPendingResources): (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::updateAnimations): * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::requestedSizeAndScales): (WebCore::SVGImageCache::imageContentChanged): (WebCore::SVGImageCache::redraw): (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer): * svg/graphics/filters/SVGFilterBuilder.h: (WebCore::SVGFilterBuilder::effectReferences): (WebCore::SVGFilterBuilder::addBuiltinEffects): * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): * svg/properties/SVGAttributeToPropertyMap.cpp: (WebCore::SVGAttributeToPropertyMap::addProperties): (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): * workers/WorkerContext.cpp: (WebCore::WorkerContext::hasPendingActivity): * workers/WorkerEventQueue.cpp: (WebCore::WorkerEventQueue::close): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeaderInternal): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunction): * xml/XPathParser.cpp: (isAxisName): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/XSLTProcessorQt.cpp: (WebCore::XSLTProcessor::transformToString): Source/WebKit/blackberry: * Api/BackingStore.cpp: (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect): (BlackBerry::WebKit::BackingStorePrivate::visibleTilesRect): (BlackBerry::WebKit::BackingStorePrivate::resetTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion): (BlackBerry::WebKit::BackingStorePrivate::mapFromTransformedContentsToTiles): * WebCoreSupport/NotificationPresenterImpl.cpp: (WebCore::NotificationPresenterImpl::cancel): (WebCore::NotificationPresenterImpl::onPermission): (WebCore::NotificationPresenterImpl::notificationClicked): * WebCoreSupport/UserMediaClientImpl.cpp: (WebCore::UserMediaClientImpl::cancelUserMediaRequest): * WebKitSupport/AboutData.cpp: (BlackBerry::WebKit::dumpJSCTypeCountSetToTableHTML): * WebKitSupport/FrameLayers.cpp: (BlackBerry::WebKit::FrameLayers::removeLayerByFrame): (BlackBerry::WebKit::FrameLayers::commitOnWebKitThread): (BlackBerry::WebKit::FrameLayers::calculateRootLayer): Source/WebKit/chromium: * src/WebGeolocationPermissionRequestManager.cpp: (WebGeolocationPermissionRequestManager::remove): * src/WebIDBMetadata.cpp: (WebKit::WebIDBMetadata::WebIDBMetadata): * src/WebIntent.cpp: (WebKit::WebIntent::extrasValue): * tests/MemoryInstrumentationTest.cpp: * tests/WebSocketExtensionDispatcherTest.cpp: (WebCore::TEST_F): Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld): * WebCoreSupport/PlatformStrategiesEfl.cpp: (PlatformStrategiesEfl::getPluginInfo): * ewk/ewk_intent.cpp: (ewk_intent_extra_get): Source/WebKit/gtk: * WebCoreSupport/PlatformStrategiesGtk.cpp: (PlatformStrategiesGtk::getPluginInfo): * webkit/webkitfavicondatabase.cpp: (webkitFaviconDatabaseImportFinished): * webkit/webkitwebplugin.cpp: (webkit_web_plugin_get_mimetypes): Source/WebKit/mac: * History/WebHistory.mm: (-[WebHistoryPrivate removeItemFromDateCaches:]): (-[WebHistoryPrivate orderedLastVisitedDays]): (WebHistoryWriter::WebHistoryWriter): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPlugin): (WebKit::NetscapePluginHostManager::pluginHostDied): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::webFrameDidFinishLoadWithReason): (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): * WebCoreSupport/WebNotificationClient.mm: (WebNotificationClient::show): (WebNotificationClient::clearNotifications): (WebNotificationClient::notificationObjectDestroyed): * WebView/WebHTMLView.mm: (commandNameForSelector): Source/WebKit/qt: * Api/qwebpage.cpp: (extractContentTypeFromPluginVector): * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): * WebCoreSupport/PlatformStrategiesQt.cpp: (PlatformStrategiesQt::getPluginInfo): Source/WebKit/win: * COMPropertyBag.h: (::Read): (::GetPropertyInfo): * WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): * WebCoreSupport/WebPlatformStrategies.cpp: (WebPlatformStrategies::getPluginInfo): * WebHistory.cpp: (WebHistory::removeItemFromDateCaches): * WebKitCOMAPI.cpp: (classFactory): * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): * WebNotificationCenter.cpp: (WebNotificationCenter::postNotificationInternal): (WebNotificationCenter::addObserver): (WebNotificationCenter::removeObserver): Source/WebKit/wince: * WebCoreSupport/PlatformStrategiesWinCE.cpp: (PlatformStrategiesWinCE::getPluginInfo): Source/WebKit2: * Platform/CoreIPC/ArgumentCoders.h: * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::SyncMessageState::getOrCreate): (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::processIncomingMessage): * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerEventSourceHandler): (WorkQueue::unregisterEventSourceHandler): * Platform/mac/WorkQueueMac.cpp: (WorkQueue::unregisterMachPortEventHandler): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::pluginDestroyed): * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): * Shared/WebPreferencesStore.cpp: (WebKit::valueForKey): (WebKit::WebPreferencesStore::getBoolValueForKey): * Shared/mac/WebCoreArgumentCodersMac.mm: (CoreIPC::::decode): * Shared/qt/ArgumentCodersQt.cpp: (CoreIPC::::decode): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (CoreIPC::::decode): * UIProcess/API/efl/ewk_back_forward_list.cpp: (_Ewk_Back_Forward_List::~_Ewk_Back_Forward_List): * UIProcess/API/efl/ewk_context.cpp: (_Ewk_Context::~_Ewk_Context): * UIProcess/API/efl/ewk_view.cpp: (_ewk_view_priv_loading_resources_clear): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_subresources): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _expectedPreviewCallbackForRect:]): (pageDidDrawToPDF): (-[WKPrintingView _drawPreview:]): * UIProcess/API/mac/WKView.mm: (commandNameForSelector): (-[WKView validateUserInterfaceItem:]): * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStore::updateTile): (WebKit::CoordinatedBackingStore::texture): (WebKit::CoordinatedBackingStore::paintToTextureMapper): (WebKit::CoordinatedBackingStore::commitTileOperations): * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp: (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: (WebKit::LayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::LayerTreeRenderer::syncCanvas): (WebKit::LayerTreeRenderer::setLayerChildren): (WebKit::LayerTreeRenderer::setLayerFilters): (WebKit::LayerTreeRenderer::setLayerState): (WebKit::LayerTreeRenderer::assignImageToLayer): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::~WebInspectorServer): (WebKit::WebInspectorServer::registerPage): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::sendHTTPResponseHeader): * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp: (WebKit::WebInspectorServer::buildPageList): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): * UIProcess/WebContext.cpp: (WebKit::createDictionaryFromHashMap): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didFinishURLImport): * UIProcess/WebIntentData.cpp: (WebKit::WebIntentData::extras): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::addBackForwardItem): (WebKit::WebProcessProxy::frameCountInPage): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: (WebKit::InjectedBundleIntent::extras): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::removeNotificationFromContextMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::destroyStream): (WebKit::NetscapePlugin::frameDidFinishLoading): (WebKit::NetscapePlugin::frameDidFail): * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): (WebKit::PluginView::~PluginView): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::layerByID): * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp: (WebKit::LayerTreeCoordinator::adoptImageBackingStore): (WebKit::LayerTreeCoordinator::releaseImageBackingStore): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::commandNameForSelectorName): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::visitedLinkStateChanged): (WebKit::WebProcess::allVisitedLinkStateChanged): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::fromCountedSetToHashMap): (WebKit::WebProcess::setTextCheckerState): Source/WTF: Currently HashMap iterators follow the same interface in std::map: given an iterator it, we use it->first to access the key and it->second to access the value. This patch changes these accesses to it->key and it->value, improving the readability at call sites. One potential downside of this change would be the confusion between std::map and HashMap interfaces. However, they are already different in other aspects and the usage of std::map is more an exception than a rule in WebKit code, so we consider the confusion will be less likely to happen. * wtf/HashCountedSet.h: (WTF::::add): (WTF::::remove): (WTF::copyToVector): * wtf/HashIterators.h: (WTF::HashTableConstKeysIterator::get): (WTF::HashTableConstValuesIterator::get): (WTF::HashTableKeysIterator::get): (WTF::HashTableValuesIterator::get): * wtf/HashMap.h: (WTF::KeyValuePairKeyExtractor::extract): (WTF::HashMapValueTraits::isEmptyValue): (WTF::HashMapTranslator::translate): (WTF::HashMapTranslatorAdapter::translate): (WTF::::set): (WTF::::get): (WTF::::take): (WTF::operator==): (WTF::deleteAllValues): (WTF::deleteAllKeys): Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused. * wtf/HashTable.h: (WTF::hashTableSwap): (WTF::::checkTableConsistencyExceptSize): * wtf/HashTraits.h: (WTF): (WTF::KeyValuePair::KeyValuePair): (KeyValuePair): (WTF::KeyValuePairHashTraits::constructDeletedValue): (WTF::KeyValuePairHashTraits::isDeletedValue): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/RefCountedLeakCounter.cpp: (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): * wtf/RefPtrHashMap.h: (WTF::::set): (WTF::::get): (WTF::::inlineGet): (WTF::::take): * wtf/Spectrum.h: (WTF::Spectrum::add): (WTF::Spectrum::get): (WTF::Spectrum::buildList): * wtf/ThreadingPthreads.cpp: (WTF::identifierByPthreadHandle): Tools: * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: (MockWebSpeechInputController::addMockRecognitionResult): * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::simulateClick): (NotificationPresenter::show): * DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp: (CppBoundClass::~CppBoundClass): (CppBoundClass::invoke): (CppBoundClass::getProperty): (CppBoundClass::setProperty): (CppBoundClass::bindCallback): (CppBoundClass::bindProperty): * DumpRenderTree/chromium/WebPreferences.cpp: (applyFontMap): * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printResourceDescription): * DumpRenderTree/mac/TestRunnerMac.mm: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * DumpRenderTree/win/AccessibilityControllerWin.cpp: (AccessibilityController::~AccessibilityController): (AccessibilityController::winNotificationReceived): * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::descriptionSuitableForTestResult): * DumpRenderTree/win/TestRunnerWin.cpp: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::worldIDForWorld): (WTR::TestRunner::evaluateScriptInIsolatedWorld): Canonical link: https://commits.webkit.org/116599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-07 23:12:07 +00:00
FreeSpaceNode* rightNode = rightNeighbor->value;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr rightStart = rightNeighbor->key;
size_t rightSize = rightNode->sizeInBytes();
FreeSpacePtr rightEnd = rightNode->m_end;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
ASSERT(rightStart == end);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
ASSERT(leftNode->m_start + (leftNode->sizeInBytes() + sizeInBytes + rightSize) == rightEnd);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.remove(rightNode);
m_freeSpaceStartAddressMap.remove(rightStart);
m_freeSpaceEndAddressMap.remove(rightEnd);
freeFreeSpaceNode(rightNode);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
leftNode->m_end += (sizeInBytes + rightSize);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(leftNode);
m_freeSpaceEndAddressMap.add(rightEnd, leftNode);
} else {
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
leftNode->m_end += sizeInBytes;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(leftNode);
m_freeSpaceEndAddressMap.add(end, leftNode);
}
} else {
// Cannot coalesce with left; try to see if we can coalesce with right.
if (rightNeighbor != m_freeSpaceStartAddressMap.end()) {
Rename first/second to key/value in HashMap iterators https://bugs.webkit.org/show_bug.cgi?id=82784 Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> on 2012-10-07 Reviewed by Eric Seidel. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnNonIndexPropertyNames): * API/JSClassRef.cpp: (OpaqueJSClass::~OpaqueJSClass): (OpaqueJSClassContextData::OpaqueJSClassContextData): (OpaqueJSClass::contextData): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::EvalCodeCache::visitAggregate): (JSC::CodeBlock::nameForRegister): * bytecode/JumpTable.h: (JSC::StringJumpTable::offsetForValue): (JSC::StringJumpTable::ctiForValue): * bytecode/LazyOperandValueProfile.cpp: (JSC::LazyOperandValueProfileParser::getIfPresent): * bytecode/SamplingTool.cpp: (JSC::SamplingTool::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addVar): (JSC::BytecodeGenerator::addGlobalVar): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addConstantValue): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitLazyNewFunction): * bytecompiler/NodesCodegen.cpp: (JSC::PropertyListNode::emitBytecode): * debugger/Debugger.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild): * dfg/DFGAssemblyHelpers.cpp: (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): * dfg/DFGByteCodeCache.h: (JSC::DFG::ByteCodeCache::~ByteCodeCache): (JSC::DFG::ByteCodeCache::get): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstant): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck): (JSC::DFG::StructureCheckHoistingPhase::noticeClobber): * heap/Heap.cpp: (JSC::Heap::markProtectedObjects): * heap/Heap.h: (JSC::Heap::forEachProtectedCell): * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::markSlow): (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::internalAppend): * heap/Weak.h: (JSC::weakRemove): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JITStubs.cpp: (JSC::JITThunks::ctiStub): * parser/Parser.cpp: (JSC::::parseStrictObjectLiteral): * profiler/Profile.cpp: (JSC::functionNameCountPairComparator): (JSC::Profile::debugPrintDataSampleStyle): * runtime/Identifier.cpp: (JSC::Identifier::add): * runtime/JSActivation.cpp: (JSC::JSActivation::getOwnNonIndexPropertyNames): (JSC::JSActivation::symbolTablePutWithAttributes): * runtime/JSArray.cpp: (JSC::JSArray::setLength): * runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertySlotByIndex): (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): (JSC::JSObject::deletePropertyByIndex): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::defineOwnIndexedProperty): (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::getOwnPropertyDescriptor): * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): * runtime/JSSymbolTableObject.h: (JSC::symbolTableGet): (JSC::symbolTablePut): (JSC::symbolTablePutWithAttributes): * runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayValueMap::putEntry): (JSC::SparseArrayValueMap::putDirect): (JSC::SparseArrayValueMap::visitChildren): * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): (JSC::WeakGCMap::set): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::sampleChild): (JSC::ProfileTreeNode::childCount): (JSC::ProfileTreeNode::dumpInternal): (JSC::ProfileTreeNode::compareEntries): Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::Watchers::find): (WebCore::Geolocation::Watchers::remove): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames): * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::metadata): * Modules/indexeddb/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::deleteDatabase): (WebCore::IDBFactoryBackendImpl::openBackingStore): (WebCore::IDBFactoryBackendImpl::open): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::metadata): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::objectStoreDeleted): (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::dispatchEvent): * Modules/mediastream/MediaConstraintsImpl.cpp: (WebCore::MediaConstraintsImpl::getMandatoryConstraints): (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): * Modules/webdatabase/AbstractDatabase.cpp: (WebCore::AbstractDatabase::performOpenAndVerify): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/OriginUsageRecord.cpp: (WebCore::OriginUsageRecord::diskUsage): * Modules/webdatabase/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::acquireLock): (WebCore::SQLTransactionCoordinator::releaseLock): (WebCore::SQLTransactionCoordinator::shutdown): * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/chromium/QuotaTracker.cpp: (WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin): (WebCore::QuotaTracker::updateDatabaseSize): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCache::clearByFrame): * bindings/js/DOMObjectHashTableMap.h: (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/JSDOMBinding.cpp: (WebCore::cacheDOMStructure): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::visitChildren): * bindings/js/JSDOMGlobalObject.h: (WebCore::getDOMConstructor): * bindings/js/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::addListener): (WebCore::PageScriptDebugServer::removeListener): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): (WebCore::ScriptController::updateDocument): (WebCore::ScriptController::createRootObject): (WebCore::ScriptController::collectIsolatedContexts): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::clearScriptObjects): * bindings/js/ScriptController.h: (WebCore::ScriptController::windowShell): (WebCore::ScriptController::existingWindowShell): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::checkForDuplicate): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * bindings/scripts/CodeGeneratorV8.pm: (GenerateImplementation): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::V8Float64Array::GetRawTemplate): (WebCore::V8Float64Array::GetTemplate): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::V8TestActiveDOMObject::GetRawTemplate): (WebCore::V8TestActiveDOMObject::GetTemplate): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::V8TestCustomNamedGetter::GetRawTemplate): (WebCore::V8TestCustomNamedGetter::GetTemplate): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::GetRawTemplate): (WebCore::V8TestEventConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::V8TestEventTarget::GetRawTemplate): (WebCore::V8TestEventTarget::GetTemplate): * bindings/scripts/test/V8/V8TestException.cpp: (WebCore::V8TestException::GetRawTemplate): (WebCore::V8TestException::GetTemplate): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::V8TestInterface::GetRawTemplate): (WebCore::V8TestInterface::GetTemplate): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::V8TestMediaQueryListListener::GetRawTemplate): (WebCore::V8TestMediaQueryListListener::GetTemplate): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructor::GetRawTemplate): (WebCore::V8TestNamedConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestNode.cpp: (WebCore::V8TestNode::GetRawTemplate): (WebCore::V8TestNode::GetTemplate): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::V8TestObj::GetRawTemplate): (WebCore::V8TestObj::GetTemplate): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): * bindings/v8/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::deallocate): (WebCore::DOMWrapperWorld::ensureIsolatedWorld): * bindings/v8/NPV8Object.cpp: (WebCore::freeV8NPObject): (WebCore::npCreateV8ScriptObject): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::clearScriptObjects): (WebCore::ScriptController::resetIsolatedWorlds): (WebCore::ScriptController::ensureIsolatedWorldContext): (WebCore::ScriptController::existingWindowShellInternal): (WebCore::ScriptController::evaluateInIsolatedWorld): (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::collectIsolatedContexts): * bindings/v8/SerializedScriptValue.cpp: * bindings/v8/V8DOMMap.h: (WebCore::WeakReferenceMap::removeIfPresent): (WebCore::WeakReferenceMap::visit): * bindings/v8/V8PerContextData.cpp: (WebCore::V8PerContextData::dispose): * bindings/v8/npruntime.cpp: * bridge/IdentifierRep.cpp: (WebCore::IdentifierRep::get): * bridge/NP_jsobject.cpp: (ObjectMap::add): (ObjectMap::remove): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::invalidate): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::canvasChanged): (WebCore::CSSCanvasValue::canvasResized): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::crossfadeChanged): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): (WebCore::CSSFontSelector::getFontData): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::addClient): (WebCore::CSSImageGeneratorValue::removeClient): (WebCore::CSSImageGeneratorValue::getImage): * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::getFontData): * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoType): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): * css/RuleSet.cpp: (WebCore::reportAtomRuleMap): (WebCore::RuleSet::addToRuleSet): (WebCore::shrinkMapVectorsToFit): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCounter::applyInheritValue): (WebCore::ApplyPropertyCounter::applyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectFeatures): (WebCore::StyleResolver::ruleSetForScope): (WebCore::StyleResolver::appendAuthorStylesheets): (WebCore::StyleResolver::sweepMatchedPropertiesCache): (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAddNamespace): (WebCore::StyleSheetContents::determineNamespace): * dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/Document.cpp: (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems): (WebCore::Document::getCSSCanvasElement): (WebCore::Document::cachedImmutableAttributeData): (WebCore::Document::getCachedLocalizer): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): (WebCore::DocumentMarkerController::showMarkers): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::remove): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets): * dom/ElementAttributeData.cpp: (WebCore::ensureAttrListForElement): * dom/EventDispatcher.cpp: (WebCore::EventRelatedTargetAdjuster::findRelatedTarget): * dom/IdTargetObserverRegistry.cpp: (WebCore::IdTargetObserverRegistry::addObserver): (WebCore::IdTargetObserverRegistry::removeObserver): * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::isOldValueRequested): (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::clearRareData): (WebCore::NodeListsNodeData::invalidateCaches): (WebCore::collectMatchingObserversForMutation): * dom/NodeRareData.h: (WebCore::NodeListsNodeData::addCacheWithAtomicName): (WebCore::NodeListsNodeData::addCacheWithName): (WebCore::NodeListsNodeData::addCacheWithQualifiedName): (WebCore::NodeListsNodeData::adoptTreeScope): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * editing/mac/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): * html/FormController.cpp: (WebCore::SavedFormState::serializeTo): (WebCore::SavedFormState::appendControlState): (WebCore::SavedFormState::takeControlState): (WebCore::SavedFormState::getReferencedFilePaths): (WebCore::FormKeyGenerator::formKey): (WebCore::FormController::createSavedFormStateMap): (WebCore::FormController::formElementsState): (WebCore::FormController::takeStateForFormElement): (WebCore::FormController::getReferencedFilePaths): * html/HTMLCollection.cpp: (WebCore::HTMLCollectionCacheBase::append): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getAttachment): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::checkStatus): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * inspector/CodeGeneratorInspector.py: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::diff): (WebCore::DOMPatchSupport::innerPatchChildren): (WebCore::DOMPatchSupport::removeChildAndMoveToNew): * inspector/InjectedScriptManager.cpp: (WebCore::InjectedScriptManager::injectedScriptForId): (WebCore::InjectedScriptManager::injectedScriptIdFor): (WebCore::InjectedScriptManager::discardInjectedScriptsFor): (WebCore::InjectedScriptManager::releaseObjectGroup): (WebCore::InjectedScriptManager::injectedScriptFor): * inspector/InspectorCSSAgent.cpp: (WebCore::SelectorProfile::commitSelector): (WebCore::SelectorProfile::commitSelectorTime): (WebCore::SelectorProfile::toInspectorObject): (WebCore::UpdateRegionLayoutTask::onTimer): (WebCore::InspectorCSSAgent::forcePseudoState): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::assertStyleSheetForId): (WebCore::InspectorCSSAgent::didRemoveDOMNode): (WebCore::InspectorCSSAgent::didModifyDOMAttr): (WebCore::InspectorCSSAgent::resetPseudoStates): * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::stopTiming): (WebCore::InspectorConsoleAgent::count): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::clearFrontend): (WebCore::InspectorDOMStorageAgent::enable): (WebCore::InspectorDOMStorageAgent::storageId): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::enable): (WebCore::InspectorDatabaseAgent::databaseId): (WebCore::InspectorDatabaseAgent::findByFileName): (WebCore::InspectorDatabaseAgent::databaseForId): * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::setBreakpointByUrl): (WebCore::InspectorDebuggerAgent::removeBreakpoint): (WebCore::InspectorDebuggerAgent::resolveBreakpoint): (WebCore::InspectorDebuggerAgent::searchInContent): (WebCore::InspectorDebuggerAgent::getScriptSource): (WebCore::InspectorDebuggerAgent::didParseSource): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): * inspector/InspectorMemoryAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::cachedResourcesForFrame): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::frameDetached): * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getProfileHeaders): (WebCore): (WebCore::InspectorProfilerAgent::getProfile): * inspector/InspectorResourceAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): (WebCore::InspectorResourceAgent::willLoadXHR): (WebCore::InspectorResourceAgent::replayXHR): * inspector/InspectorState.cpp: (WebCore::InspectorState::getBoolean): (WebCore::InspectorState::getString): (WebCore::InspectorState::getLong): (WebCore::InspectorState::getDouble): (WebCore::InspectorState::getObject): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): (WebCore::InspectorStyleSheet::inspectorStyleForId): * inspector/InspectorValues.cpp: (WebCore::InspectorObjectBase::get): (WebCore::InspectorObjectBase::writeJSON): * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::workerContextTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers): (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels): * inspector/MemoryInstrumentationImpl.cpp: (WebCore::MemoryInstrumentationClientImpl::countObjectSize): * inspector/MemoryInstrumentationImpl.h: (WebCore::MemoryInstrumentationClientImpl::totalSize): (WebCore::MemoryInstrumentationClientImpl::reportedSizeForAllTypes): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setXHRReplayData): (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): * loader/CrossOriginAccessControl.cpp: (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::createAccessControlPreflightRequest): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): (WebCore::CrossOriginPreflightResultCache::canSkipPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::getSubresources): (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::servePendingRequests): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::removeResource): (WebCore::ApplicationCache::clearStorageID): (WebCore::ApplicationCache::dump): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::fillResourceList): * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::estimatedSizeInStorage): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::empty): (WebCore::ApplicationCacheStorage::storeCopyOfCache): * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::switchClientsToRevalidatedResource): (WebCore::CachedResource::updateResponseAfterRevalidation): * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): (WebCore::CachedResourceLoader::removeCachedResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeResourcesWithOrigin): (WebCore::MemoryCache::getOriginsWithCache): (WebCore::MemoryCache::getStatistics): (WebCore::MemoryCache::setDisabled): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::removeAllIcons): (WebCore::IconDatabase::iconRecordCountWithData): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/PageGroup.cpp: (WebCore::PageGroup::pageGroup): (WebCore::PageGroup::closeLocalStorage): (WebCore::PageGroup::clearLocalStorageForAllOrigins): (WebCore::PageGroup::clearLocalStorageForOrigin): (WebCore::PageGroup::syncLocalStorage): (WebCore::PageGroup::addUserScriptToWorld): (WebCore::PageGroup::addUserStyleSheetToWorld): (WebCore::PageGroup::removeUserScriptFromWorld): (WebCore::PageGroup::removeUserStyleSheetFromWorld): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): * page/Settings.cpp: (WebCore::setGenericFontFamilyMap): (WebCore::getGenericFontFamilyForScript): * page/SpeechInput.cpp: (WebCore::SpeechInput::registerListener): * page/TouchDisambiguation.cpp: (WebCore::findGoodTouchTargets): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::boolFeature): (WebCore::WindowFeatures::floatFeature): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::updateAnimations): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::numberOfActiveAnimations): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): (WebCore::CompositeAnimation::animate): (WebCore::CompositeAnimation::getAnimatedStyle): (WebCore::CompositeAnimation::setAnimating): (WebCore::CompositeAnimation::timeToNextService): (WebCore::CompositeAnimation::getAnimationForProperty): (WebCore::CompositeAnimation::suspendAnimations): (WebCore::CompositeAnimation::resumeAnimations): (WebCore::CompositeAnimation::overrideImplicitAnimations): (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations): (WebCore::CompositeAnimation::isAnimatingProperty): (WebCore::CompositeAnimation::numberOfActiveAnimations): * platform/Language.cpp: (WebCore::languageDidChange): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getNormalizedMIMEType): * platform/audio/HRTFElevation.cpp: (WebCore::getConcatenatedImpulseResponsesForSubject): * platform/blackberry/CookieManager.cpp: (WebCore::CookieManager::generateHtmlFragmentForCookies): (WebCore::CookieManager::removeAllCookies): * platform/blackberry/CookieMap.cpp: (WebCore::CookieMap::removeOldestCookie): (WebCore::CookieMap::getAllChildCookies): * platform/cf/BinaryPropertyList.cpp: (WebCore::BinaryPropertyListPlan::writeIntegerArray): * platform/chromium/support/WebHTTPLoadInfo.cpp: (WebKit::addHeader): * platform/chromium/support/WebURLRequest.cpp: (WebKit::WebURLRequest::visitHTTPHeaderFields): * platform/chromium/support/WebURLResponse.cpp: (WebKit::WebURLResponse::addHTTPHeaderField): (WebKit::WebURLResponse::visitHTTPHeaderFields): * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient): (WebCore::DisplayRefreshMonitorManager::unregisterClient): * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::getVerticalData): (WebCore::FontCache::getCachedFontData): (WebCore::FontCache::releaseFontData): (WebCore::FontCache::purgeInactiveFontData): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): (WebCore::GlyphPageTreeNode::pageCount): (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData): (WebCore::GlyphPageTreeNode::pruneTreeFontData): (WebCore::GlyphPageTreeNode::pruneCustomFontData): (WebCore::GlyphPageTreeNode::pruneFontData): (WebCore::GlyphPageTreeNode::showSubtree): (showGlyphPageTrees): * platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers): (WebCore::TiledBackingStore::resizeEdgeTiles): (WebCore::TiledBackingStore::setKeepRect): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::avfWrapperForCallbackContext): * platform/graphics/blackberry/LayerTiler.cpp: (WebCore::LayerTiler::layerVisibilityChanged): (WebCore::LayerTiler::uploadTexturesIfNeeded): (WebCore::LayerTiler::addTileJob): (WebCore::LayerTiler::deleteTextures): (WebCore::LayerTiler::pruneTextures): (WebCore::LayerTiler::bindContentsTexture): * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: (WebCore::TextureCacheCompositingThread::textureForTiledContents): (WebCore::TextureCacheCompositingThread::textureForColor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::layerDidDisplay): (WebCore::GraphicsLayerCA::updateGeometry): (WebCore::GraphicsLayerCA::updateTransform): (WebCore::GraphicsLayerCA::updateChildrenTransform): (WebCore::GraphicsLayerCA::updateMasksToBounds): (WebCore::GraphicsLayerCA::updateContentsVisibility): (WebCore::GraphicsLayerCA::updateContentsOpaque): (WebCore::GraphicsLayerCA::updateBackfaceVisibility): (WebCore::GraphicsLayerCA::updateFilters): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::updateLayerDrawsContent): (WebCore::GraphicsLayerCA::updateContentsImage): (WebCore::GraphicsLayerCA::updateContentsRect): (WebCore::GraphicsLayerCA::updateMaskLayer): (WebCore::GraphicsLayerCA::updateLayerAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::suspendAnimations): (WebCore::GraphicsLayerCA::resumeAnimations): (WebCore::GraphicsLayerCA::findOrMakeClone): (WebCore::GraphicsLayerCA::setOpacityInternal): (WebCore::GraphicsLayerCA::updateOpacityOnLayer): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::~TileCache): (WebCore::TileCache::setNeedsDisplay): (WebCore::TileCache::setScale): (WebCore::TileCache::setAcceleratesDrawing): (WebCore::TileCache::setTileDebugBorderWidth): (WebCore::TileCache::setTileDebugBorderColor): (WebCore::TileCache::revalidateTiles): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::animationStarted): (resubmitAllAnimations): (PlatformCALayer::animationForKey): * platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::LookupAltName): (WebCore::fontContainsCharacter): * platform/graphics/chromium/FontUtilsChromiumWin.cpp: (WebCore::getDerivedFontData): * platform/graphics/filters/CustomFilterGlobalContext.cpp: (WebCore::CustomFilterGlobalContext::~CustomFilterGlobalContext): (WebCore::CustomFilterGlobalContext::getValidatedProgram): (WebCore::CustomFilterGlobalContext::removeValidatedProgram): * platform/graphics/filters/CustomFilterProgram.cpp: (WebCore::CustomFilterProgram::notifyClients): * platform/graphics/harfbuzz/HarfBuzzSkia.cpp: (WebCore::getCachedHarfbuzzFace): (WebCore::releaseCachedHarfbuzzFace): * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.cpp: (WebCore::HarfBuzzNGFace::HarfBuzzNGFace): (WebCore::HarfBuzzNGFace::~HarfBuzzNGFace): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::SimpleFontData::getCFStringAttributes): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::canRenderCombiningCharacterSequence): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::mappedSymbolName): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): * platform/graphics/openvg/EGLDisplayOpenVG.cpp: (WebCore::EGLDisplayOpenVG::~EGLDisplayOpenVG): (WebCore::EGLDisplayOpenVG::destroySurface): (WebCore::EGLDisplayOpenVG::contextForSurface): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderManager::getShaderForFilter): * platform/graphics/wince/FontPlatformData.cpp: (WebCore::FixedSizeFontData::create): * platform/gtk/DataObjectGtk.cpp: (WebCore::DataObjectGtk::forClipboard): * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleGetDragData): (WebCore::GtkDragAndDropHelper::handleDragLeave): (WebCore::GtkDragAndDropHelper::handleDragMotion): (WebCore::GtkDragAndDropHelper::handleDragDataReceived): (WebCore::GtkDragAndDropHelper::handleDragDrop): * platform/gtk/RedirectedXCompositeWindow.cpp: (WebCore::filterXDamageEvent): * platform/gtk/RenderThemeGtk3.cpp: (WebCore::gtkStyleChangedCallback): (WebCore::getStyleContext): * platform/mac/ScrollbarThemeMac.mm: (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): (WebCore::CredentialStorage::get): * platform/network/HTTPHeaderMap.cpp: (WebCore::HTTPHeaderMap::copyData): (WebCore::HTTPHeaderMap::get): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::addHTTPHeaderField): (WebCore::ResourceRequestBase::addHTTPHeaderFields): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::ResourceRequest::targetTypeFromMimeType): (WebCore::ResourceRequest::initializePlatformRequest): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::makeFinalRequest): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/qt/ResourceRequestQt.cpp: (WebCore::ResourceRequest::toNetworkRequest): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): (WebCore::ResourceHandle::setClientCertificate): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessage): (WebCore::ResourceRequest::toSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::toSoupMessage): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/RunLoopQt.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/text/LocaleToScriptMappingDefault.cpp: (WebCore::scriptNameToCode): (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlacklistedCodecs): (WebCore::dumpTextEncodingNameMap): * platform/text/transcoder/FontTranscoder.cpp: (WebCore::FontTranscoder::converterType): * platform/text/win/TextCodecWin.cpp: (WebCore::LanguageManager::LanguageManager): (WebCore::getCodePage): (WebCore::TextCodecWin::registerExtendedEncodingNames): (WebCore::TextCodecWin::registerExtendedCodecs): (WebCore::TextCodecWin::enumerateSupportedEncodings): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::getDataMapItem): (WebCore::getClipboardData): (WebCore::setClipboardData): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::types): * platform/win/FileSystemWin.cpp: (WebCore::cachedStorageDirectory): * platform/win/RunLoopWin.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::createInstance): * platform/wince/MIMETypeRegistryWinCE.cpp: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/wx/ContextMenuWx.cpp: (WebCore::ContextMenu::appendItem): * plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): (WebCore::PluginDatabase::MIMETypeForExtension): (WebCore::PluginDatabase::remove): * plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::dispatchCalls): * plugins/PluginStream.cpp: (WebCore::PluginStream::startStream): * plugins/blackberry/PluginDataBlackBerry.cpp: (WebCore::PluginData::initPlugins): * plugins/wx/PluginDataWx.cpp: (WebCore::PluginData::initPlugins): * rendering/ExclusionShapeInsideInfo.cpp: (WebCore::ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::unregisterNamedFlowContentNode): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::addTextBoxVisualOverflow): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::clearFloats): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderBoxModelObject.cpp: (WebCore::ImageQualityController::highQualityRepaintTimerFired): (WebCore::ImageQualityController::shouldPaintAtLowQuality): * rendering/RenderCounter.cpp: (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (WebCore::RenderCounter::rendererStyleChanged): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::setRegionRangeForBox): (WebCore::RenderFlowThread::getRegionRangeForBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::performOverlapTests): * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayerFilterInfo::filterInfoForRenderLayer): (WebCore::RenderLayerFilterInfo::createFilterInfoForRenderLayerIfNeeded): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dependsOn): (WebCore::RenderNamedFlowThread::pushDependencies): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::setRegionObjectsRegionStyle): (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle): (WebCore::RenderRegion::computeChildrenStyleInRegion): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor): * rendering/RenderView.cpp: (WebCore::RenderView::selectionBounds): (WebCore::RenderView::setSelection): * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): * rendering/VerticalPositionCache.h: (WebCore::VerticalPositionCache::get): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::swapItemsInLayoutAttributes): * rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::dump): * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap): (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::syncTimerFired): (WebCore::StorageAreaSync::performImport): (WebCore::StorageAreaSync::sync): * storage/StorageMap.cpp: (WebCore::StorageMap::key): (WebCore::StorageMap::setItem): * storage/StorageNamespaceImpl.cpp: (WebCore::StorageNamespaceImpl::localStorageNamespace): (WebCore::StorageNamespaceImpl::copy): (WebCore::StorageNamespaceImpl::close): (WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion): (WebCore::StorageNamespaceImpl::sync): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAnimationElementFromTarget): (WebCore::SVGDocumentExtensions::removeAllAnimationElementsFromTarget): (WebCore::SVGDocumentExtensions::addPendingResource): (WebCore::SVGDocumentExtensions::isElementPendingResources): (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::updateAnimations): * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::requestedSizeAndScales): (WebCore::SVGImageCache::imageContentChanged): (WebCore::SVGImageCache::redraw): (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer): * svg/graphics/filters/SVGFilterBuilder.h: (WebCore::SVGFilterBuilder::effectReferences): (WebCore::SVGFilterBuilder::addBuiltinEffects): * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): * svg/properties/SVGAttributeToPropertyMap.cpp: (WebCore::SVGAttributeToPropertyMap::addProperties): (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): * workers/WorkerContext.cpp: (WebCore::WorkerContext::hasPendingActivity): * workers/WorkerEventQueue.cpp: (WebCore::WorkerEventQueue::close): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeaderInternal): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunction): * xml/XPathParser.cpp: (isAxisName): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/XSLTProcessorQt.cpp: (WebCore::XSLTProcessor::transformToString): Source/WebKit/blackberry: * Api/BackingStore.cpp: (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect): (BlackBerry::WebKit::BackingStorePrivate::visibleTilesRect): (BlackBerry::WebKit::BackingStorePrivate::resetTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion): (BlackBerry::WebKit::BackingStorePrivate::mapFromTransformedContentsToTiles): * WebCoreSupport/NotificationPresenterImpl.cpp: (WebCore::NotificationPresenterImpl::cancel): (WebCore::NotificationPresenterImpl::onPermission): (WebCore::NotificationPresenterImpl::notificationClicked): * WebCoreSupport/UserMediaClientImpl.cpp: (WebCore::UserMediaClientImpl::cancelUserMediaRequest): * WebKitSupport/AboutData.cpp: (BlackBerry::WebKit::dumpJSCTypeCountSetToTableHTML): * WebKitSupport/FrameLayers.cpp: (BlackBerry::WebKit::FrameLayers::removeLayerByFrame): (BlackBerry::WebKit::FrameLayers::commitOnWebKitThread): (BlackBerry::WebKit::FrameLayers::calculateRootLayer): Source/WebKit/chromium: * src/WebGeolocationPermissionRequestManager.cpp: (WebGeolocationPermissionRequestManager::remove): * src/WebIDBMetadata.cpp: (WebKit::WebIDBMetadata::WebIDBMetadata): * src/WebIntent.cpp: (WebKit::WebIntent::extrasValue): * tests/MemoryInstrumentationTest.cpp: * tests/WebSocketExtensionDispatcherTest.cpp: (WebCore::TEST_F): Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld): * WebCoreSupport/PlatformStrategiesEfl.cpp: (PlatformStrategiesEfl::getPluginInfo): * ewk/ewk_intent.cpp: (ewk_intent_extra_get): Source/WebKit/gtk: * WebCoreSupport/PlatformStrategiesGtk.cpp: (PlatformStrategiesGtk::getPluginInfo): * webkit/webkitfavicondatabase.cpp: (webkitFaviconDatabaseImportFinished): * webkit/webkitwebplugin.cpp: (webkit_web_plugin_get_mimetypes): Source/WebKit/mac: * History/WebHistory.mm: (-[WebHistoryPrivate removeItemFromDateCaches:]): (-[WebHistoryPrivate orderedLastVisitedDays]): (WebHistoryWriter::WebHistoryWriter): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPlugin): (WebKit::NetscapePluginHostManager::pluginHostDied): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::webFrameDidFinishLoadWithReason): (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): * WebCoreSupport/WebNotificationClient.mm: (WebNotificationClient::show): (WebNotificationClient::clearNotifications): (WebNotificationClient::notificationObjectDestroyed): * WebView/WebHTMLView.mm: (commandNameForSelector): Source/WebKit/qt: * Api/qwebpage.cpp: (extractContentTypeFromPluginVector): * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): * WebCoreSupport/PlatformStrategiesQt.cpp: (PlatformStrategiesQt::getPluginInfo): Source/WebKit/win: * COMPropertyBag.h: (::Read): (::GetPropertyInfo): * WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): * WebCoreSupport/WebPlatformStrategies.cpp: (WebPlatformStrategies::getPluginInfo): * WebHistory.cpp: (WebHistory::removeItemFromDateCaches): * WebKitCOMAPI.cpp: (classFactory): * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): * WebNotificationCenter.cpp: (WebNotificationCenter::postNotificationInternal): (WebNotificationCenter::addObserver): (WebNotificationCenter::removeObserver): Source/WebKit/wince: * WebCoreSupport/PlatformStrategiesWinCE.cpp: (PlatformStrategiesWinCE::getPluginInfo): Source/WebKit2: * Platform/CoreIPC/ArgumentCoders.h: * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::SyncMessageState::getOrCreate): (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::processIncomingMessage): * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerEventSourceHandler): (WorkQueue::unregisterEventSourceHandler): * Platform/mac/WorkQueueMac.cpp: (WorkQueue::unregisterMachPortEventHandler): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::pluginDestroyed): * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): * Shared/WebPreferencesStore.cpp: (WebKit::valueForKey): (WebKit::WebPreferencesStore::getBoolValueForKey): * Shared/mac/WebCoreArgumentCodersMac.mm: (CoreIPC::::decode): * Shared/qt/ArgumentCodersQt.cpp: (CoreIPC::::decode): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (CoreIPC::::decode): * UIProcess/API/efl/ewk_back_forward_list.cpp: (_Ewk_Back_Forward_List::~_Ewk_Back_Forward_List): * UIProcess/API/efl/ewk_context.cpp: (_Ewk_Context::~_Ewk_Context): * UIProcess/API/efl/ewk_view.cpp: (_ewk_view_priv_loading_resources_clear): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_subresources): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _expectedPreviewCallbackForRect:]): (pageDidDrawToPDF): (-[WKPrintingView _drawPreview:]): * UIProcess/API/mac/WKView.mm: (commandNameForSelector): (-[WKView validateUserInterfaceItem:]): * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStore::updateTile): (WebKit::CoordinatedBackingStore::texture): (WebKit::CoordinatedBackingStore::paintToTextureMapper): (WebKit::CoordinatedBackingStore::commitTileOperations): * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp: (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: (WebKit::LayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::LayerTreeRenderer::syncCanvas): (WebKit::LayerTreeRenderer::setLayerChildren): (WebKit::LayerTreeRenderer::setLayerFilters): (WebKit::LayerTreeRenderer::setLayerState): (WebKit::LayerTreeRenderer::assignImageToLayer): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::~WebInspectorServer): (WebKit::WebInspectorServer::registerPage): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::sendHTTPResponseHeader): * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp: (WebKit::WebInspectorServer::buildPageList): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): * UIProcess/WebContext.cpp: (WebKit::createDictionaryFromHashMap): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didFinishURLImport): * UIProcess/WebIntentData.cpp: (WebKit::WebIntentData::extras): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::addBackForwardItem): (WebKit::WebProcessProxy::frameCountInPage): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: (WebKit::InjectedBundleIntent::extras): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::removeNotificationFromContextMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::destroyStream): (WebKit::NetscapePlugin::frameDidFinishLoading): (WebKit::NetscapePlugin::frameDidFail): * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): (WebKit::PluginView::~PluginView): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::layerByID): * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp: (WebKit::LayerTreeCoordinator::adoptImageBackingStore): (WebKit::LayerTreeCoordinator::releaseImageBackingStore): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::commandNameForSelectorName): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::visitedLinkStateChanged): (WebKit::WebProcess::allVisitedLinkStateChanged): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::fromCountedSetToHashMap): (WebKit::WebProcess::setTextCheckerState): Source/WTF: Currently HashMap iterators follow the same interface in std::map: given an iterator it, we use it->first to access the key and it->second to access the value. This patch changes these accesses to it->key and it->value, improving the readability at call sites. One potential downside of this change would be the confusion between std::map and HashMap interfaces. However, they are already different in other aspects and the usage of std::map is more an exception than a rule in WebKit code, so we consider the confusion will be less likely to happen. * wtf/HashCountedSet.h: (WTF::::add): (WTF::::remove): (WTF::copyToVector): * wtf/HashIterators.h: (WTF::HashTableConstKeysIterator::get): (WTF::HashTableConstValuesIterator::get): (WTF::HashTableKeysIterator::get): (WTF::HashTableValuesIterator::get): * wtf/HashMap.h: (WTF::KeyValuePairKeyExtractor::extract): (WTF::HashMapValueTraits::isEmptyValue): (WTF::HashMapTranslator::translate): (WTF::HashMapTranslatorAdapter::translate): (WTF::::set): (WTF::::get): (WTF::::take): (WTF::operator==): (WTF::deleteAllValues): (WTF::deleteAllKeys): Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused. * wtf/HashTable.h: (WTF::hashTableSwap): (WTF::::checkTableConsistencyExceptSize): * wtf/HashTraits.h: (WTF): (WTF::KeyValuePair::KeyValuePair): (KeyValuePair): (WTF::KeyValuePairHashTraits::constructDeletedValue): (WTF::KeyValuePairHashTraits::isDeletedValue): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/RefCountedLeakCounter.cpp: (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): * wtf/RefPtrHashMap.h: (WTF::::set): (WTF::::get): (WTF::::inlineGet): (WTF::::take): * wtf/Spectrum.h: (WTF::Spectrum::add): (WTF::Spectrum::get): (WTF::Spectrum::buildList): * wtf/ThreadingPthreads.cpp: (WTF::identifierByPthreadHandle): Tools: * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: (MockWebSpeechInputController::addMockRecognitionResult): * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::simulateClick): (NotificationPresenter::show): * DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp: (CppBoundClass::~CppBoundClass): (CppBoundClass::invoke): (CppBoundClass::getProperty): (CppBoundClass::setProperty): (CppBoundClass::bindCallback): (CppBoundClass::bindProperty): * DumpRenderTree/chromium/WebPreferences.cpp: (applyFontMap): * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printResourceDescription): * DumpRenderTree/mac/TestRunnerMac.mm: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * DumpRenderTree/win/AccessibilityControllerWin.cpp: (AccessibilityController::~AccessibilityController): (AccessibilityController::winNotificationReceived): * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::descriptionSuitableForTestResult): * DumpRenderTree/win/TestRunnerWin.cpp: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::worldIDForWorld): (WTR::TestRunner::evaluateScriptInIsolatedWorld): Canonical link: https://commits.webkit.org/116599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-07 23:12:07 +00:00
FreeSpaceNode* rightNode = rightNeighbor->value;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
FreeSpacePtr rightStart = rightNeighbor->key;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
ASSERT(rightStart == end);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
ASSERT(start + (sizeInBytes + rightNode->sizeInBytes()) == rightNode->m_end);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.remove(rightNode);
m_freeSpaceStartAddressMap.remove(rightStart);
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
rightNode->m_start = start;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(rightNode);
m_freeSpaceStartAddressMap.add(start, rightNode);
} else {
// Nothing to coalesce with, so create a new free space node and add it.
FreeSpaceNode* node = allocFreeSpaceNode();
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
https://bugs.webkit.org/show_bug.cgi?id=76855 Implement a JIT-code aware sampling profiler for JSC Reviewed by Geoff Garen. Step 2: generalize RedBlackTree. The profiler is going to want tio use a RedBlackTree, allow this class to work with subclasses of RedBlackTree::Node, Node should not need to know the names of the m_key and m_value fields (the subclass can provide a key() accessor), and RedBlackTree does not need to know anything about ValueType. * JavaScriptCore.exp: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): * wtf/MetaAllocator.h: (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::key): * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): Canonical link: https://commits.webkit.org/93680@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-23 23:30:57 +00:00
node->m_start = start;
Apply PtrTags to the MetaAllocator and friends. https://bugs.webkit.org/show_bug.cgi?id=185110 <rdar://problem/39533895> Reviewed by Saam Barati. Source/JavaScriptCore: 1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer. 2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool, and add a sanity check to verify that allocated code buffers are within those bounds. * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl): (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::debugAddress): (JSC::LinkBuffer::code): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): * bytecode/InlineAccess.cpp: (JSC::linkCodeInline): (JSC::InlineAccess::rewireStubAsJump): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::findPC): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::findPC): * jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): (JSC::ExecutableAllocator::allocate): * jit/ExecutableAllocator.h: (JSC::isJITPC): (JSC::performJITMemcpy): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITMathIC.h: (JSC::isProfileEmpty): * runtime/JSCPtrTag.h: * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmFaultSignalHandler.cpp: (JSC::Wasm::trapHandler): Source/WTF: 1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging. 2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocatorHandle::dump const): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::allocFreeSpaceNode): * wtf/MetaAllocator.h: (WTF::MetaAllocatorTracker::find): (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): (WTF::MetaAllocator::FreeSpaceNode::sizeInBytes): (WTF::MetaAllocator::FreeSpaceNode::key): * wtf/MetaAllocatorHandle.h: (WTF::MetaAllocatorHandle::start const): (WTF::MetaAllocatorHandle::end const): (WTF::MetaAllocatorHandle::startAsInteger const): (WTF::MetaAllocatorHandle::endAsInteger const): (WTF::MetaAllocatorHandle::sizeInBytes const): (WTF::MetaAllocatorHandle::containsIntegerAddress const): (WTF::MetaAllocatorHandle::key): * wtf/MetaAllocatorPtr.h: Added. (WTF::MetaAllocatorPtr::MetaAllocatorPtr): (WTF::MetaAllocatorPtr:: const): (WTF::MetaAllocatorPtr::operator bool const): (WTF::MetaAllocatorPtr::operator! const): (WTF::MetaAllocatorPtr::operator== const): (WTF::MetaAllocatorPtr::operator!= const): (WTF::MetaAllocatorPtr::operator+ const): (WTF::MetaAllocatorPtr::operator- const): (WTF::MetaAllocatorPtr::operator+=): (WTF::MetaAllocatorPtr::operator-=): (WTF::MetaAllocatorPtr::isEmptyValue const): (WTF::MetaAllocatorPtr::isDeletedValue const): (WTF::MetaAllocatorPtr::hash const): (WTF::MetaAllocatorPtr::emptyValue): (WTF::MetaAllocatorPtr::deletedValue): (WTF::MetaAllocatorPtrHash::hash): (WTF::MetaAllocatorPtrHash::equal): * wtf/PtrTag.h: Tools: Update the test to match MetaAllocator changes in WTF. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: (TestWebKitAPI::TEST_F): (WTF::tagForPtr): (WTF::ptrTagName): Canonical link: https://commits.webkit.org/200634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 22:29:21 +00:00
node->m_end = start + sizeInBytes;
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_freeSpaceSizeMap.insert(node);
m_freeSpaceStartAddressMap.add(start, node);
m_freeSpaceEndAddressMap.add(end, node);
}
}
#if ENABLE(META_ALLOCATOR_PROFILE)
dumpProfile();
#endif
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
void MetaAllocator::incrementPageOccupancy(void* address, size_t sizeInBytes)
{
uintptr_t firstPage = reinterpret_cast<uintptr_t>(address) >> m_logPageSize;
uintptr_t lastPage = (reinterpret_cast<uintptr_t>(address) + sizeInBytes - 1) >> m_logPageSize;
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
uintptr_t currentPageStart = 0;
size_t count = 0;
auto flushNeedPages = [&] {
if (!currentPageStart)
return;
notifyNeedPage(reinterpret_cast<void*>(currentPageStart << m_logPageSize), count);
currentPageStart = 0;
count = 0;
};
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
for (uintptr_t page = firstPage; page <= lastPage; ++page) {
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
auto result = m_pageOccupancyMap.add(page, 1);
if (result.isNewEntry) {
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_bytesCommitted += m_pageSize;
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
if (!currentPageStart)
currentPageStart = page;
++count;
} else {
result.iterator->value++;
flushNeedPages();
}
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
flushNeedPages();
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
void MetaAllocator::decrementPageOccupancy(void* address, size_t sizeInBytes)
{
uintptr_t firstPage = reinterpret_cast<uintptr_t>(address) >> m_logPageSize;
uintptr_t lastPage = (reinterpret_cast<uintptr_t>(address) + sizeInBytes - 1) >> m_logPageSize;
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
uintptr_t currentPageStart = 0;
size_t count = 0;
auto flushFreePages = [&] {
if (!currentPageStart)
return;
notifyPageIsFree(reinterpret_cast<void*>(currentPageStart << m_logPageSize), count);
currentPageStart = 0;
count = 0;
};
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
for (uintptr_t page = firstPage; page <= lastPage; ++page) {
HashMap<uintptr_t, size_t>::iterator iter = m_pageOccupancyMap.find(page);
ASSERT(iter != m_pageOccupancyMap.end());
Rename first/second to key/value in HashMap iterators https://bugs.webkit.org/show_bug.cgi?id=82784 Patch by Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> on 2012-10-07 Reviewed by Eric Seidel. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnNonIndexPropertyNames): * API/JSClassRef.cpp: (OpaqueJSClass::~OpaqueJSClass): (OpaqueJSClassContextData::OpaqueJSClassContextData): (OpaqueJSClass::contextData): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::EvalCodeCache::visitAggregate): (JSC::CodeBlock::nameForRegister): * bytecode/JumpTable.h: (JSC::StringJumpTable::offsetForValue): (JSC::StringJumpTable::ctiForValue): * bytecode/LazyOperandValueProfile.cpp: (JSC::LazyOperandValueProfileParser::getIfPresent): * bytecode/SamplingTool.cpp: (JSC::SamplingTool::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addVar): (JSC::BytecodeGenerator::addGlobalVar): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addConstantValue): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitLazyNewFunction): * bytecompiler/NodesCodegen.cpp: (JSC::PropertyListNode::emitBytecode): * debugger/Debugger.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse): (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild): * dfg/DFGAssemblyHelpers.cpp: (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): * dfg/DFGByteCodeCache.h: (JSC::DFG::ByteCodeCache::~ByteCodeCache): (JSC::DFG::ByteCodeCache::get): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstant): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck): (JSC::DFG::StructureCheckHoistingPhase::noticeClobber): * heap/Heap.cpp: (JSC::Heap::markProtectedObjects): * heap/Heap.h: (JSC::Heap::forEachProtectedCell): * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::markSlow): (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::internalAppend): * heap/Weak.h: (JSC::weakRemove): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JITStubs.cpp: (JSC::JITThunks::ctiStub): * parser/Parser.cpp: (JSC::::parseStrictObjectLiteral): * profiler/Profile.cpp: (JSC::functionNameCountPairComparator): (JSC::Profile::debugPrintDataSampleStyle): * runtime/Identifier.cpp: (JSC::Identifier::add): * runtime/JSActivation.cpp: (JSC::JSActivation::getOwnNonIndexPropertyNames): (JSC::JSActivation::symbolTablePutWithAttributes): * runtime/JSArray.cpp: (JSC::JSArray::setLength): * runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertySlotByIndex): (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): (JSC::JSObject::deletePropertyByIndex): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::defineOwnIndexedProperty): (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage): (JSC::JSObject::getOwnPropertyDescriptor): * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): * runtime/JSSymbolTableObject.h: (JSC::symbolTableGet): (JSC::symbolTablePut): (JSC::symbolTablePutWithAttributes): * runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayValueMap::putEntry): (JSC::SparseArrayValueMap::putDirect): (JSC::SparseArrayValueMap::visitChildren): * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): (JSC::WeakGCMap::set): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::sampleChild): (JSC::ProfileTreeNode::childCount): (JSC::ProfileTreeNode::dumpInternal): (JSC::ProfileTreeNode::compareEntries): Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::Watchers::find): (WebCore::Geolocation::Watchers::remove): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames): * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::metadata): * Modules/indexeddb/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::deleteDatabase): (WebCore::IDBFactoryBackendImpl::openBackingStore): (WebCore::IDBFactoryBackendImpl::open): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::metadata): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::objectStoreDeleted): (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::dispatchEvent): * Modules/mediastream/MediaConstraintsImpl.cpp: (WebCore::MediaConstraintsImpl::getMandatoryConstraints): (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): * Modules/webdatabase/AbstractDatabase.cpp: (WebCore::AbstractDatabase::performOpenAndVerify): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/OriginUsageRecord.cpp: (WebCore::OriginUsageRecord::diskUsage): * Modules/webdatabase/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::acquireLock): (WebCore::SQLTransactionCoordinator::releaseLock): (WebCore::SQLTransactionCoordinator::shutdown): * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::interruptAllDatabasesForContext): * Modules/webdatabase/chromium/QuotaTracker.cpp: (WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin): (WebCore::QuotaTracker::updateDatabaseSize): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCache::clearByFrame): * bindings/js/DOMObjectHashTableMap.h: (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/JSDOMBinding.cpp: (WebCore::cacheDOMStructure): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::visitChildren): * bindings/js/JSDOMGlobalObject.h: (WebCore::getDOMConstructor): * bindings/js/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::addListener): (WebCore::PageScriptDebugServer::removeListener): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): (WebCore::ScriptController::updateDocument): (WebCore::ScriptController::createRootObject): (WebCore::ScriptController::collectIsolatedContexts): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::clearScriptObjects): * bindings/js/ScriptController.h: (WebCore::ScriptController::windowShell): (WebCore::ScriptController::existingWindowShell): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::checkForDuplicate): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * bindings/scripts/CodeGeneratorV8.pm: (GenerateImplementation): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::V8Float64Array::GetRawTemplate): (WebCore::V8Float64Array::GetTemplate): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::V8TestActiveDOMObject::GetRawTemplate): (WebCore::V8TestActiveDOMObject::GetTemplate): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::V8TestCustomNamedGetter::GetRawTemplate): (WebCore::V8TestCustomNamedGetter::GetTemplate): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::GetRawTemplate): (WebCore::V8TestEventConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::V8TestEventTarget::GetRawTemplate): (WebCore::V8TestEventTarget::GetTemplate): * bindings/scripts/test/V8/V8TestException.cpp: (WebCore::V8TestException::GetRawTemplate): (WebCore::V8TestException::GetTemplate): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::V8TestInterface::GetRawTemplate): (WebCore::V8TestInterface::GetTemplate): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::V8TestMediaQueryListListener::GetRawTemplate): (WebCore::V8TestMediaQueryListListener::GetTemplate): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructor::GetRawTemplate): (WebCore::V8TestNamedConstructor::GetTemplate): * bindings/scripts/test/V8/V8TestNode.cpp: (WebCore::V8TestNode::GetRawTemplate): (WebCore::V8TestNode::GetTemplate): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::V8TestObj::GetRawTemplate): (WebCore::V8TestObj::GetTemplate): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): * bindings/v8/DOMWrapperWorld.cpp: (WebCore::DOMWrapperWorld::deallocate): (WebCore::DOMWrapperWorld::ensureIsolatedWorld): * bindings/v8/NPV8Object.cpp: (WebCore::freeV8NPObject): (WebCore::npCreateV8ScriptObject): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::clearScriptObjects): (WebCore::ScriptController::resetIsolatedWorlds): (WebCore::ScriptController::ensureIsolatedWorldContext): (WebCore::ScriptController::existingWindowShellInternal): (WebCore::ScriptController::evaluateInIsolatedWorld): (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): (WebCore::ScriptController::cleanupScriptObjectsForPlugin): (WebCore::ScriptController::collectIsolatedContexts): * bindings/v8/SerializedScriptValue.cpp: * bindings/v8/V8DOMMap.h: (WebCore::WeakReferenceMap::removeIfPresent): (WebCore::WeakReferenceMap::visit): * bindings/v8/V8PerContextData.cpp: (WebCore::V8PerContextData::dispose): * bindings/v8/npruntime.cpp: * bridge/IdentifierRep.cpp: (WebCore::IdentifierRep::get): * bridge/NP_jsobject.cpp: (ObjectMap::add): (ObjectMap::remove): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::invalidate): * css/CSSCanvasValue.cpp: (WebCore::CSSCanvasValue::canvasChanged): (WebCore::CSSCanvasValue::canvasResized): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::crossfadeChanged): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): (WebCore::CSSFontSelector::getFontData): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::addClient): (WebCore::CSSImageGeneratorValue::removeClient): (WebCore::CSSImageGeneratorValue::getImage): * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::getFontData): * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoType): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): * css/RuleSet.cpp: (WebCore::reportAtomRuleMap): (WebCore::RuleSet::addToRuleSet): (WebCore::shrinkMapVectorsToFit): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCounter::applyInheritValue): (WebCore::ApplyPropertyCounter::applyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectFeatures): (WebCore::StyleResolver::ruleSetForScope): (WebCore::StyleResolver::appendAuthorStylesheets): (WebCore::StyleResolver::sweepMatchedPropertiesCache): (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAddNamespace): (WebCore::StyleSheetContents::determineNamespace): * dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::addButton): (WebCore::CheckedRadioButtons::removeButton): * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/Document.cpp: (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems): (WebCore::Document::getCSSCanvasElement): (WebCore::Document::cachedImmutableAttributeData): (WebCore::Document::getCachedLocalizer): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): (WebCore::DocumentMarkerController::showMarkers): * dom/DocumentOrderedMap.cpp: (WebCore::DocumentOrderedMap::remove): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets): * dom/ElementAttributeData.cpp: (WebCore::ensureAttrListForElement): * dom/EventDispatcher.cpp: (WebCore::EventRelatedTargetAdjuster::findRelatedTarget): * dom/IdTargetObserverRegistry.cpp: (WebCore::IdTargetObserverRegistry::addObserver): (WebCore::IdTargetObserverRegistry::removeObserver): * dom/MutationObserverInterestGroup.cpp: (WebCore::MutationObserverInterestGroup::isOldValueRequested): (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): * dom/Node.cpp: (WebCore::Node::dumpStatistics): (WebCore::Node::clearRareData): (WebCore::NodeListsNodeData::invalidateCaches): (WebCore::collectMatchingObserversForMutation): * dom/NodeRareData.h: (WebCore::NodeListsNodeData::addCacheWithAtomicName): (WebCore::NodeListsNodeData::addCacheWithName): (WebCore::NodeListsNodeData::addCacheWithQualifiedName): (WebCore::NodeListsNodeData::adoptTreeScope): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * editing/mac/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): * html/FormController.cpp: (WebCore::SavedFormState::serializeTo): (WebCore::SavedFormState::appendControlState): (WebCore::SavedFormState::takeControlState): (WebCore::SavedFormState::getReferencedFilePaths): (WebCore::FormKeyGenerator::formKey): (WebCore::FormController::createSavedFormStateMap): (WebCore::FormController::formElementsState): (WebCore::FormController::takeStateForFormElement): (WebCore::FormController::getReferencedFilePaths): * html/HTMLCollection.cpp: (WebCore::HTMLCollectionCacheBase::append): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getAttachment): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::checkStatus): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * inspector/CodeGeneratorInspector.py: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::diff): (WebCore::DOMPatchSupport::innerPatchChildren): (WebCore::DOMPatchSupport::removeChildAndMoveToNew): * inspector/InjectedScriptManager.cpp: (WebCore::InjectedScriptManager::injectedScriptForId): (WebCore::InjectedScriptManager::injectedScriptIdFor): (WebCore::InjectedScriptManager::discardInjectedScriptsFor): (WebCore::InjectedScriptManager::releaseObjectGroup): (WebCore::InjectedScriptManager::injectedScriptFor): * inspector/InspectorCSSAgent.cpp: (WebCore::SelectorProfile::commitSelector): (WebCore::SelectorProfile::commitSelectorTime): (WebCore::SelectorProfile::toInspectorObject): (WebCore::UpdateRegionLayoutTask::onTimer): (WebCore::InspectorCSSAgent::forcePseudoState): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::assertStyleSheetForId): (WebCore::InspectorCSSAgent::didRemoveDOMNode): (WebCore::InspectorCSSAgent::didModifyDOMAttr): (WebCore::InspectorCSSAgent::resetPseudoStates): * inspector/InspectorConsoleAgent.cpp: (WebCore::InspectorConsoleAgent::stopTiming): (WebCore::InspectorConsoleAgent::count): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::clearFrontend): (WebCore::InspectorDOMStorageAgent::enable): (WebCore::InspectorDOMStorageAgent::storageId): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::enable): (WebCore::InspectorDatabaseAgent::databaseId): (WebCore::InspectorDatabaseAgent::findByFileName): (WebCore::InspectorDatabaseAgent::databaseForId): * inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::setBreakpointByUrl): (WebCore::InspectorDebuggerAgent::removeBreakpoint): (WebCore::InspectorDebuggerAgent::resolveBreakpoint): (WebCore::InspectorDebuggerAgent::searchInContent): (WebCore::InspectorDebuggerAgent::getScriptSource): (WebCore::InspectorDebuggerAgent::didParseSource): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): * inspector/InspectorMemoryAgent.cpp: (WebCore): * inspector/InspectorPageAgent.cpp: (WebCore::cachedResourcesForFrame): (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): (WebCore::InspectorPageAgent::frameDetached): * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getProfileHeaders): (WebCore): (WebCore::InspectorProfilerAgent::getProfile): * inspector/InspectorResourceAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorResourceAgent::willSendRequest): (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): (WebCore::InspectorResourceAgent::willLoadXHR): (WebCore::InspectorResourceAgent::replayXHR): * inspector/InspectorState.cpp: (WebCore::InspectorState::getBoolean): (WebCore::InspectorState::getString): (WebCore::InspectorState::getLong): (WebCore::InspectorState::getDouble): (WebCore::InspectorState::getObject): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): (WebCore::InspectorStyleSheet::inspectorStyleForId): * inspector/InspectorValues.cpp: (WebCore::InspectorObjectBase::get): (WebCore::InspectorObjectBase::writeJSON): * inspector/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::workerContextTerminated): (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers): (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels): * inspector/MemoryInstrumentationImpl.cpp: (WebCore::MemoryInstrumentationClientImpl::countObjectSize): * inspector/MemoryInstrumentationImpl.h: (WebCore::MemoryInstrumentationClientImpl::totalSize): (WebCore::MemoryInstrumentationClientImpl::reportedSizeForAllTypes): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setXHRReplayData): (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): * loader/CrossOriginAccessControl.cpp: (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::createAccessControlPreflightRequest): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): (WebCore::CrossOriginPreflightResultCache::canSkipPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::getSubresources): (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::servePendingRequests): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::removeResource): (WebCore::ApplicationCache::clearStorageID): (WebCore::ApplicationCache::dump): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::fillResourceList): * loader/appcache/ApplicationCacheResource.cpp: (WebCore::ApplicationCacheResource::estimatedSizeInStorage): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::empty): (WebCore::ApplicationCacheStorage::storeCopyOfCache): * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::canReuse): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::switchClientsToRevalidatedResource): (WebCore::CachedResource::updateResponseAfterRevalidation): * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): (WebCore::CachedResourceLoader::removeCachedResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeResourcesWithOrigin): (WebCore::MemoryCache::getOriginsWithCache): (WebCore::MemoryCache::getStatistics): (WebCore::MemoryCache::setDisabled): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::removeAllIcons): (WebCore::IconDatabase::iconRecordCountWithData): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/PageGroup.cpp: (WebCore::PageGroup::pageGroup): (WebCore::PageGroup::closeLocalStorage): (WebCore::PageGroup::clearLocalStorageForAllOrigins): (WebCore::PageGroup::clearLocalStorageForOrigin): (WebCore::PageGroup::syncLocalStorage): (WebCore::PageGroup::addUserScriptToWorld): (WebCore::PageGroup::addUserStyleSheetToWorld): (WebCore::PageGroup::removeUserScriptFromWorld): (WebCore::PageGroup::removeUserStyleSheetFromWorld): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): * page/Settings.cpp: (WebCore::setGenericFontFamilyMap): (WebCore::getGenericFontFamilyForScript): * page/SpeechInput.cpp: (WebCore::SpeechInput::registerListener): * page/TouchDisambiguation.cpp: (WebCore::findGoodTouchTargets): * page/WindowFeatures.cpp: (WebCore::WindowFeatures::boolFeature): (WebCore::WindowFeatures::floatFeature): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::updateAnimations): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::numberOfActiveAnimations): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): (WebCore::CompositeAnimation::animate): (WebCore::CompositeAnimation::getAnimatedStyle): (WebCore::CompositeAnimation::setAnimating): (WebCore::CompositeAnimation::timeToNextService): (WebCore::CompositeAnimation::getAnimationForProperty): (WebCore::CompositeAnimation::suspendAnimations): (WebCore::CompositeAnimation::resumeAnimations): (WebCore::CompositeAnimation::overrideImplicitAnimations): (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations): (WebCore::CompositeAnimation::isAnimatingProperty): (WebCore::CompositeAnimation::numberOfActiveAnimations): * platform/Language.cpp: (WebCore::languageDidChange): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getNormalizedMIMEType): * platform/audio/HRTFElevation.cpp: (WebCore::getConcatenatedImpulseResponsesForSubject): * platform/blackberry/CookieManager.cpp: (WebCore::CookieManager::generateHtmlFragmentForCookies): (WebCore::CookieManager::removeAllCookies): * platform/blackberry/CookieMap.cpp: (WebCore::CookieMap::removeOldestCookie): (WebCore::CookieMap::getAllChildCookies): * platform/cf/BinaryPropertyList.cpp: (WebCore::BinaryPropertyListPlan::writeIntegerArray): * platform/chromium/support/WebHTTPLoadInfo.cpp: (WebKit::addHeader): * platform/chromium/support/WebURLRequest.cpp: (WebKit::WebURLRequest::visitHTTPHeaderFields): * platform/chromium/support/WebURLResponse.cpp: (WebKit::WebURLResponse::addHTTPHeaderField): (WebKit::WebURLResponse::visitHTTPHeaderFields): * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient): (WebCore::DisplayRefreshMonitorManager::unregisterClient): * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::getVerticalData): (WebCore::FontCache::getCachedFontData): (WebCore::FontCache::releaseFontData): (WebCore::FontCache::purgeInactiveFontData): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): (WebCore::GlyphPageTreeNode::pageCount): (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData): (WebCore::GlyphPageTreeNode::pruneTreeFontData): (WebCore::GlyphPageTreeNode::pruneCustomFontData): (WebCore::GlyphPageTreeNode::pruneFontData): (WebCore::GlyphPageTreeNode::showSubtree): (showGlyphPageTrees): * platform/graphics/TiledBackingStore.cpp: (WebCore::TiledBackingStore::updateTileBuffers): (WebCore::TiledBackingStore::resizeEdgeTiles): (WebCore::TiledBackingStore::setKeepRect): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::avfWrapperForCallbackContext): * platform/graphics/blackberry/LayerTiler.cpp: (WebCore::LayerTiler::layerVisibilityChanged): (WebCore::LayerTiler::uploadTexturesIfNeeded): (WebCore::LayerTiler::addTileJob): (WebCore::LayerTiler::deleteTextures): (WebCore::LayerTiler::pruneTextures): (WebCore::LayerTiler::bindContentsTexture): * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: (WebCore::TextureCacheCompositingThread::textureForTiledContents): (WebCore::TextureCacheCompositingThread::textureForColor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::layerDidDisplay): (WebCore::GraphicsLayerCA::updateGeometry): (WebCore::GraphicsLayerCA::updateTransform): (WebCore::GraphicsLayerCA::updateChildrenTransform): (WebCore::GraphicsLayerCA::updateMasksToBounds): (WebCore::GraphicsLayerCA::updateContentsVisibility): (WebCore::GraphicsLayerCA::updateContentsOpaque): (WebCore::GraphicsLayerCA::updateBackfaceVisibility): (WebCore::GraphicsLayerCA::updateFilters): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::updateLayerDrawsContent): (WebCore::GraphicsLayerCA::updateContentsImage): (WebCore::GraphicsLayerCA::updateContentsRect): (WebCore::GraphicsLayerCA::updateMaskLayer): (WebCore::GraphicsLayerCA::updateLayerAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::suspendAnimations): (WebCore::GraphicsLayerCA::resumeAnimations): (WebCore::GraphicsLayerCA::findOrMakeClone): (WebCore::GraphicsLayerCA::setOpacityInternal): (WebCore::GraphicsLayerCA::updateOpacityOnLayer): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::~TileCache): (WebCore::TileCache::setNeedsDisplay): (WebCore::TileCache::setScale): (WebCore::TileCache::setAcceleratesDrawing): (WebCore::TileCache::setTileDebugBorderWidth): (WebCore::TileCache::setTileDebugBorderColor): (WebCore::TileCache::revalidateTiles): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::animationStarted): (resubmitAllAnimations): (PlatformCALayer::animationForKey): * platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::LookupAltName): (WebCore::fontContainsCharacter): * platform/graphics/chromium/FontUtilsChromiumWin.cpp: (WebCore::getDerivedFontData): * platform/graphics/filters/CustomFilterGlobalContext.cpp: (WebCore::CustomFilterGlobalContext::~CustomFilterGlobalContext): (WebCore::CustomFilterGlobalContext::getValidatedProgram): (WebCore::CustomFilterGlobalContext::removeValidatedProgram): * platform/graphics/filters/CustomFilterProgram.cpp: (WebCore::CustomFilterProgram::notifyClients): * platform/graphics/harfbuzz/HarfBuzzSkia.cpp: (WebCore::getCachedHarfbuzzFace): (WebCore::releaseCachedHarfbuzzFace): * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.cpp: (WebCore::HarfBuzzNGFace::HarfBuzzNGFace): (WebCore::HarfBuzzNGFace::~HarfBuzzNGFace): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::SimpleFontData::getCFStringAttributes): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::canRenderCombiningCharacterSequence): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::mappedSymbolName): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): * platform/graphics/openvg/EGLDisplayOpenVG.cpp: (WebCore::EGLDisplayOpenVG::~EGLDisplayOpenVG): (WebCore::EGLDisplayOpenVG::destroySurface): (WebCore::EGLDisplayOpenVG::contextForSurface): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderManager::getShaderForFilter): * platform/graphics/wince/FontPlatformData.cpp: (WebCore::FixedSizeFontData::create): * platform/gtk/DataObjectGtk.cpp: (WebCore::DataObjectGtk::forClipboard): * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleGetDragData): (WebCore::GtkDragAndDropHelper::handleDragLeave): (WebCore::GtkDragAndDropHelper::handleDragMotion): (WebCore::GtkDragAndDropHelper::handleDragDataReceived): (WebCore::GtkDragAndDropHelper::handleDragDrop): * platform/gtk/RedirectedXCompositeWindow.cpp: (WebCore::filterXDamageEvent): * platform/gtk/RenderThemeGtk3.cpp: (WebCore::gtkStyleChangedCallback): (WebCore::getStyleContext): * platform/mac/ScrollbarThemeMac.mm: (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): (WebCore::CredentialStorage::get): * platform/network/HTTPHeaderMap.cpp: (WebCore::HTTPHeaderMap::copyData): (WebCore::HTTPHeaderMap::get): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::addHTTPHeaderField): (WebCore::ResourceRequestBase::addHTTPHeaderFields): * platform/network/blackberry/ResourceRequestBlackBerry.cpp: (WebCore::ResourceRequest::targetTypeFromMimeType): (WebCore::ResourceRequest::initializePlatformRequest): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::makeFinalRequest): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/qt/ResourceRequestQt.cpp: (WebCore::ResourceRequest::toNetworkRequest): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback): (WebCore::ResourceHandle::setClientCertificate): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessage): (WebCore::ResourceRequest::toSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::toSoupMessage): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/RunLoopQt.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/text/LocaleToScriptMappingDefault.cpp: (WebCore::scriptNameToCode): (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlacklistedCodecs): (WebCore::dumpTextEncodingNameMap): * platform/text/transcoder/FontTranscoder.cpp: (WebCore::FontTranscoder::converterType): * platform/text/win/TextCodecWin.cpp: (WebCore::LanguageManager::LanguageManager): (WebCore::getCodePage): (WebCore::TextCodecWin::registerExtendedEncodingNames): (WebCore::TextCodecWin::registerExtendedCodecs): (WebCore::TextCodecWin::enumerateSupportedEncodings): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::getDataMapItem): (WebCore::getClipboardData): (WebCore::setClipboardData): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::types): * platform/win/FileSystemWin.cpp: (WebCore::cachedStorageDirectory): * platform/win/RunLoopWin.cpp: (WebCore::RunLoop::TimerBase::timerFired): * platform/win/WCDataObject.cpp: (WebCore::WCDataObject::createInstance): * platform/wince/MIMETypeRegistryWinCE.cpp: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/wx/ContextMenuWx.cpp: (WebCore::ContextMenu::appendItem): * plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): (WebCore::PluginDatabase::MIMETypeForExtension): (WebCore::PluginDatabase::remove): * plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::dispatchCalls): * plugins/PluginStream.cpp: (WebCore::PluginStream::startStream): * plugins/blackberry/PluginDataBlackBerry.cpp: (WebCore::PluginData::initPlugins): * plugins/wx/PluginDataWx.cpp: (WebCore::PluginData::initPlugins): * rendering/ExclusionShapeInsideInfo.cpp: (WebCore::ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::unregisterNamedFlowContentNode): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::addTextBoxVisualOverflow): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::clearFloats): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderBoxModelObject.cpp: (WebCore::ImageQualityController::highQualityRepaintTimerFired): (WebCore::ImageQualityController::shouldPaintAtLowQuality): * rendering/RenderCounter.cpp: (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (WebCore::RenderCounter::rendererStyleChanged): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::setRegionRangeForBox): (WebCore::RenderFlowThread::getRegionRangeForBox): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::performOverlapTests): * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayerFilterInfo::filterInfoForRenderLayer): (WebCore::RenderLayerFilterInfo::createFilterInfoForRenderLayerIfNeeded): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dependsOn): (WebCore::RenderNamedFlowThread::pushDependencies): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::setRegionObjectsRegionStyle): (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle): (WebCore::RenderRegion::computeChildrenStyleInRegion): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::cachedCollapsedBorder): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor): * rendering/RenderView.cpp: (WebCore::RenderView::selectionBounds): (WebCore::RenderView::setSelection): * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): * rendering/VerticalPositionCache.h: (WebCore::VerticalPositionCache::get): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::resourceDestroyed): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::swapItemsInLayoutAttributes): * rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::dump): * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap): (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::syncTimerFired): (WebCore::StorageAreaSync::performImport): (WebCore::StorageAreaSync::sync): * storage/StorageMap.cpp: (WebCore::StorageMap::key): (WebCore::StorageMap::setItem): * storage/StorageNamespaceImpl.cpp: (WebCore::StorageNamespaceImpl::localStorageNamespace): (WebCore::StorageNamespaceImpl::copy): (WebCore::StorageNamespaceImpl::close): (WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion): (WebCore::StorageNamespaceImpl::sync): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAnimationElementFromTarget): (WebCore::SVGDocumentExtensions::removeAllAnimationElementsFromTarget): (WebCore::SVGDocumentExtensions::addPendingResource): (WebCore::SVGDocumentExtensions::isElementPendingResources): (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::updateAnimations): * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::~SVGImageCache): (WebCore::SVGImageCache::removeClientFromCache): (WebCore::SVGImageCache::requestedSizeAndScales): (WebCore::SVGImageCache::imageContentChanged): (WebCore::SVGImageCache::redraw): (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer): * svg/graphics/filters/SVGFilterBuilder.h: (WebCore::SVGFilterBuilder::effectReferences): (WebCore::SVGFilterBuilder::addBuiltinEffects): * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): * svg/properties/SVGAttributeToPropertyMap.cpp: (WebCore::SVGAttributeToPropertyMap::addProperties): (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): * workers/WorkerContext.cpp: (WebCore::WorkerContext::hasPendingActivity): * workers/WorkerEventQueue.cpp: (WebCore::WorkerEventQueue::close): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeaderInternal): (WebCore::XMLHttpRequest::getAllResponseHeaders): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunction): * xml/XPathParser.cpp: (isAxisName): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/XSLTProcessorQt.cpp: (WebCore::XSLTProcessor::transformToString): Source/WebKit/blackberry: * Api/BackingStore.cpp: (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect): (BlackBerry::WebKit::BackingStorePrivate::visibleTilesRect): (BlackBerry::WebKit::BackingStorePrivate::resetTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTiles): (BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion): (BlackBerry::WebKit::BackingStorePrivate::mapFromTransformedContentsToTiles): * WebCoreSupport/NotificationPresenterImpl.cpp: (WebCore::NotificationPresenterImpl::cancel): (WebCore::NotificationPresenterImpl::onPermission): (WebCore::NotificationPresenterImpl::notificationClicked): * WebCoreSupport/UserMediaClientImpl.cpp: (WebCore::UserMediaClientImpl::cancelUserMediaRequest): * WebKitSupport/AboutData.cpp: (BlackBerry::WebKit::dumpJSCTypeCountSetToTableHTML): * WebKitSupport/FrameLayers.cpp: (BlackBerry::WebKit::FrameLayers::removeLayerByFrame): (BlackBerry::WebKit::FrameLayers::commitOnWebKitThread): (BlackBerry::WebKit::FrameLayers::calculateRootLayer): Source/WebKit/chromium: * src/WebGeolocationPermissionRequestManager.cpp: (WebGeolocationPermissionRequestManager::remove): * src/WebIDBMetadata.cpp: (WebKit::WebIDBMetadata::WebIDBMetadata): * src/WebIntent.cpp: (WebKit::WebIntent::extrasValue): * tests/MemoryInstrumentationTest.cpp: * tests/WebSocketExtensionDispatcherTest.cpp: (WebCore::TEST_F): Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld): * WebCoreSupport/PlatformStrategiesEfl.cpp: (PlatformStrategiesEfl::getPluginInfo): * ewk/ewk_intent.cpp: (ewk_intent_extra_get): Source/WebKit/gtk: * WebCoreSupport/PlatformStrategiesGtk.cpp: (PlatformStrategiesGtk::getPluginInfo): * webkit/webkitfavicondatabase.cpp: (webkitFaviconDatabaseImportFinished): * webkit/webkitwebplugin.cpp: (webkit_web_plugin_get_mimetypes): Source/WebKit/mac: * History/WebHistory.mm: (-[WebHistoryPrivate removeItemFromDateCaches:]): (-[WebHistoryPrivate orderedLastVisitedDays]): (WebHistoryWriter::WebHistoryWriter): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPlugin): (WebKit::NetscapePluginHostManager::pluginHostDied): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release): (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::webFrameDidFinishLoadWithReason): (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): * WebCoreSupport/WebNotificationClient.mm: (WebNotificationClient::show): (WebNotificationClient::clearNotifications): (WebNotificationClient::notificationObjectDestroyed): * WebView/WebHTMLView.mm: (commandNameForSelector): Source/WebKit/qt: * Api/qwebpage.cpp: (extractContentTypeFromPluginVector): * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): * WebCoreSupport/PlatformStrategiesQt.cpp: (PlatformStrategiesQt::getPluginInfo): Source/WebKit/win: * COMPropertyBag.h: (::Read): (::GetPropertyInfo): * WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): * WebCoreSupport/WebPlatformStrategies.cpp: (WebPlatformStrategies::getPluginInfo): * WebHistory.cpp: (WebHistory::removeItemFromDateCaches): * WebKitCOMAPI.cpp: (classFactory): * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): * WebNotificationCenter.cpp: (WebNotificationCenter::postNotificationInternal): (WebNotificationCenter::addObserver): (WebNotificationCenter::removeObserver): Source/WebKit/wince: * WebCoreSupport/PlatformStrategiesWinCE.cpp: (PlatformStrategiesWinCE::getPluginInfo): Source/WebKit2: * Platform/CoreIPC/ArgumentCoders.h: * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::SyncMessageState::getOrCreate): (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::processIncomingMessage): * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerEventSourceHandler): (WorkQueue::unregisterEventSourceHandler): * Platform/mac/WorkQueueMac.cpp: (WorkQueue::unregisterMachPortEventHandler): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::pluginDestroyed): * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): * Shared/WebPreferencesStore.cpp: (WebKit::valueForKey): (WebKit::WebPreferencesStore::getBoolValueForKey): * Shared/mac/WebCoreArgumentCodersMac.mm: (CoreIPC::::decode): * Shared/qt/ArgumentCodersQt.cpp: (CoreIPC::::decode): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (CoreIPC::::decode): * UIProcess/API/efl/ewk_back_forward_list.cpp: (_Ewk_Back_Forward_List::~_Ewk_Back_Forward_List): * UIProcess/API/efl/ewk_context.cpp: (_Ewk_Context::~_Ewk_Context): * UIProcess/API/efl/ewk_view.cpp: (_ewk_view_priv_loading_resources_clear): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_subresources): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _expectedPreviewCallbackForRect:]): (pageDidDrawToPDF): (-[WKPrintingView _drawPreview:]): * UIProcess/API/mac/WKView.mm: (commandNameForSelector): (-[WKView validateUserInterfaceItem:]): * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStore::updateTile): (WebKit::CoordinatedBackingStore::texture): (WebKit::CoordinatedBackingStore::paintToTextureMapper): (WebKit::CoordinatedBackingStore::commitTileOperations): * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp: (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: (WebKit::LayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::LayerTreeRenderer::syncCanvas): (WebKit::LayerTreeRenderer::setLayerChildren): (WebKit::LayerTreeRenderer::setLayerFilters): (WebKit::LayerTreeRenderer::setLayerState): (WebKit::LayerTreeRenderer::assignImageToLayer): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::~WebInspectorServer): (WebKit::WebInspectorServer::registerPage): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::sendHTTPResponseHeader): * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp: (WebKit::WebInspectorServer::buildPageList): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): * UIProcess/WebContext.cpp: (WebKit::createDictionaryFromHashMap): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didFinishURLImport): * UIProcess/WebIntentData.cpp: (WebKit::WebIntentData::extras): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::addBackForwardItem): (WebKit::WebProcessProxy::frameCountInPage): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: (WebKit::InjectedBundleIntent::extras): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::removeNotificationFromContextMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::destroyStream): (WebKit::NetscapePlugin::frameDidFinishLoading): (WebKit::NetscapePlugin::frameDidFail): * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): (WebKit::PluginView::~PluginView): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::layerByID): * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp: (WebKit::LayerTreeCoordinator::adoptImageBackingStore): (WebKit::LayerTreeCoordinator::releaseImageBackingStore): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::commandNameForSelectorName): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::visitedLinkStateChanged): (WebKit::WebProcess::allVisitedLinkStateChanged): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::fromCountedSetToHashMap): (WebKit::WebProcess::setTextCheckerState): Source/WTF: Currently HashMap iterators follow the same interface in std::map: given an iterator it, we use it->first to access the key and it->second to access the value. This patch changes these accesses to it->key and it->value, improving the readability at call sites. One potential downside of this change would be the confusion between std::map and HashMap interfaces. However, they are already different in other aspects and the usage of std::map is more an exception than a rule in WebKit code, so we consider the confusion will be less likely to happen. * wtf/HashCountedSet.h: (WTF::::add): (WTF::::remove): (WTF::copyToVector): * wtf/HashIterators.h: (WTF::HashTableConstKeysIterator::get): (WTF::HashTableConstValuesIterator::get): (WTF::HashTableKeysIterator::get): (WTF::HashTableValuesIterator::get): * wtf/HashMap.h: (WTF::KeyValuePairKeyExtractor::extract): (WTF::HashMapValueTraits::isEmptyValue): (WTF::HashMapTranslator::translate): (WTF::HashMapTranslatorAdapter::translate): (WTF::::set): (WTF::::get): (WTF::::take): (WTF::operator==): (WTF::deleteAllValues): (WTF::deleteAllKeys): Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused. * wtf/HashTable.h: (WTF::hashTableSwap): (WTF::::checkTableConsistencyExceptSize): * wtf/HashTraits.h: (WTF): (WTF::KeyValuePair::KeyValuePair): (KeyValuePair): (WTF::KeyValuePairHashTraits::constructDeletedValue): (WTF::KeyValuePairHashTraits::isDeletedValue): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/RefCountedLeakCounter.cpp: (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): * wtf/RefPtrHashMap.h: (WTF::::set): (WTF::::get): (WTF::::inlineGet): (WTF::::take): * wtf/Spectrum.h: (WTF::Spectrum::add): (WTF::Spectrum::get): (WTF::Spectrum::buildList): * wtf/ThreadingPthreads.cpp: (WTF::identifierByPthreadHandle): Tools: * DumpRenderTree/chromium/MockWebSpeechInputController.cpp: (MockWebSpeechInputController::addMockRecognitionResult): * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::simulateClick): (NotificationPresenter::show): * DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp: (CppBoundClass::~CppBoundClass): (CppBoundClass::invoke): (CppBoundClass::getProperty): (CppBoundClass::setProperty): (CppBoundClass::bindCallback): (CppBoundClass::bindProperty): * DumpRenderTree/chromium/WebPreferences.cpp: (applyFontMap): * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printResourceDescription): * DumpRenderTree/mac/TestRunnerMac.mm: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * DumpRenderTree/win/AccessibilityControllerWin.cpp: (AccessibilityController::~AccessibilityController): (AccessibilityController::winNotificationReceived): * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::descriptionSuitableForTestResult): * DumpRenderTree/win/TestRunnerWin.cpp: (worldIDForWorld): (TestRunner::evaluateScriptInIsolatedWorld): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::worldIDForWorld): (WTR::TestRunner::evaluateScriptInIsolatedWorld): Canonical link: https://commits.webkit.org/116599@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-07 23:12:07 +00:00
if (!--(iter->value)) {
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
m_pageOccupancyMap.remove(iter);
m_bytesCommitted -= m_pageSize;
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
if (!currentPageStart)
currentPageStart = page;
++count;
} else
flushFreePages();
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
[JSC] Less contended MetaAllocator https://bugs.webkit.org/show_bug.cgi?id=200278 Reviewed by Mark Lam. Source/JavaScriptCore: The profiler result of JetStream2/bomb-workers shows that we are having contention under MetaAllocator::currentStatistics. This function is called in ExecutableAllocator::memoryPressureMultiplier, and it is called from ExecutableCounter's threshold calculation. But MetaAllocator::currentStatistics takes a global lock inside MetaAllocator and causes contention. However, we do not need to have a lock actually: clients of MetaAllocator::currentStatistics typically use bytesReserved and bytesAllocated information. However, since our executable allocator is fixed-sized, bytesReserved is always the fixed size. So just reading bytesAllocated racily is enough. This patch attempts to reduce the contention by the following two things. 1. Read bytesAllocated racily instead of calling MetaAllocator::currentStatistics. Then ExecutableCounter does not need to take a lock. 2. page lifetime management APIs of MetaAllocator should take a second `count` parameter to batch the system calls. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryStart): Deleted. (JSC::FixedVMPoolExecutableAllocator::memoryEnd): Deleted. (JSC::FixedVMPoolExecutableAllocator::isJITPC): Deleted. (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): Deleted. (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator): Deleted. (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion): Deleted. Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): * wtf/MetaAllocator.h: Tools: Update the interface. * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Canonical link: https://commits.webkit.org/214473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-14 20:33:14 +00:00
flushFreePages();
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
Make the VM Traps mechanism non-polling for the DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=168920 <rdar://problem/30738588> Reviewed by Filip Pizlo. Source/JavaScriptCore: 1. Added a ENABLE(SIGNAL_BASED_VM_TRAPS) configuration in Platform.h. This is currently only enabled for OS(DARWIN) and ENABLE(JIT). 2. Added assembler functions for overwriting an instruction with a breakpoint. 3. Added a new JettisonDueToVMTraps jettison reason. 4. Added CodeBlock and DFG::CommonData utility functions for over-writing invalidation points with breakpoint instructions. 5. The BytecodeGenerator now emits the op_check_traps bytecode unconditionally. 6. Remove the JSC_alwaysCheckTraps option because of (4) above. For ports that don't ENABLE(SIGNAL_BASED_VM_TRAPS), we'll force Options::usePollingTraps() to always be true. This makes the VMTraps implementation fall back to using polling based traps only. 7. Make VMTraps support signal based traps. Some design and implementation details of signal based VM traps: - The implementation makes use of 2 signal handlers for SIGUSR1 and SIGTRAP. - VMTraps::fireTrap() will set the flag for the requested trap and instantiate a SignalSender. The SignalSender will send SIGUSR1 to the mutator thread that we want to trap, and check for the occurence of one of the following events: a. VMTraps::handleTraps() has been called for the requested trap, or b. the VM is inactive and is no longer executing any JS code. We determine this to be the case if the thread no longer owns the JSLock and the VM's entryScope is null. Note: the thread can relinquish the JSLock while the VM's entryScope is not null. This happens when the thread calls JSLock::dropAllLocks() before calling a host function that may block on IO (or whatever). For our purpose, this counts as the VM still running JS code, and VM::fireTrap() will still be waiting. If the SignalSender does not see either of these events, it will sleep for a while and then re-send SIGUSR1 and check for the events again. When it sees one of these events, it will consider the mutator to have received the trap request. - The SIGUSR1 handler will try to insert breakpoints at the invalidation points in the DFG/FTL codeBlock at the top of the stack. This allows the mutator thread to break (with a SIGTRAP) exactly at an invalidation point, where it's safe to jettison the codeBlock. Note: we cannot have the requester thread (that called VMTraps::fireTrap()) insert the breakpoint instructions itself. This is because we need the register state of the the mutator thread (that we want to trap in) in order to find the codeBlocks that we wish to insert the breakpoints in. Currently, we don't have a generic way for the requester thread to get the register state of another thread. - The SIGTRAP handler will check to see if it is trapping on a breakpoint at an invalidation point. If so, it will jettison the codeBlock and adjust the PC to re-execute the invalidation OSR exit off-ramp. After the OSR exit, the baseline JIT code will eventually reach an op_check_traps and call VMTraps::handleTraps(). If the handler is not trapping at an invalidation point, then it must be observing an assertion failure (which also uses the breakpoint instruction). In this case, the handler will defer to the default SIGTRAP handler and crash. - The reason we need the SignalSender is because SignalSender::send() is called from another thread in a loop, so that VMTraps::fireTrap() can return sooner. send() needs to make use of the VM pointer, and it is not guaranteed that the VM will outlive the thread. SignalSender provides the mechanism by which we can nullify the VM pointer when the VM dies so that the thread does not continue to use it. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithBrk): * assembler/ARMAssembler.h: (JSC::ARMAssembler::replaceWithBrk): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::replaceWithBkpt): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::replaceWithBkpt): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::replaceWithJump): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::replaceWithBreakpoint): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::replaceWithBreakpoint): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::replaceWithJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::replaceWithBreakpoint): * assembler/X86Assembler.h: (JSC::X86Assembler::replaceWithInt3): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): (JSC::CodeBlock::hasInstalledVMTrapBreakpoints): (JSC::CodeBlock::installVMTrapBreakpoints): * bytecode/CodeBlock.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCheckTraps): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::hasInstalledVMTrapsBreakpoints): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::installVMTrapBreakpoint): * dfg/DFGJumpReplacement.h: (JSC::DFG::JumpReplacement::dataLocation): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::contains): * heap/CodeBlockSet.h: * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterate): * heap/Heap.cpp: (JSC::Heap::forEachCodeBlockIgnoringJITPlansImpl): * heap/Heap.h: * heap/HeapInlines.h: (JSC::Heap::forEachCodeBlockIgnoringJITPlans): * heap/MachineStackMarker.h: (JSC::MachineThreads::threadsListHead): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * profiler/ProfilerJettisonReason.cpp: (WTF::printInternal): * profiler/ProfilerJettisonReason.h: * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/Options.h: * runtime/PlatformThread.h: (JSC::platformThreadSignal): * runtime/VM.cpp: (JSC::VM::~VM): (JSC::VM::ensureWatchdog): (JSC::VM::handleTraps): Deleted. (JSC::VM::setNeedAsynchronousTerminationSupport): Deleted. * runtime/VM.h: (JSC::VM::ownerThread): (JSC::VM::traps): (JSC::VM::handleTraps): (JSC::VM::needTrapHandling): (JSC::VM::needAsynchronousTerminationSupport): Deleted. * runtime/VMTraps.cpp: (JSC::VMTraps::vm): (JSC::SignalContext::SignalContext): (JSC::SignalContext::adjustPCToPointToTrappingInstruction): (JSC::vmIsInactive): (JSC::findActiveVMAndStackBounds): (JSC::handleSigusr1): (JSC::handleSigtrap): (JSC::installSignalHandlers): (JSC::sanitizedTopCallFrame): (JSC::isSaneFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::addSignalSender): (JSC::VMTraps::removeSignalSender): (JSC::VMTraps::SignalSender::willDestroyVM): (JSC::VMTraps::SignalSender::send): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): (JSC::VMTraps::needTrapHandling): (JSC::VMTraps::notifyGrabAllLocks): (JSC::VMTraps::SignalSender::SignalSender): (JSC::VMTraps::invalidateCodeBlocksOnStack): * tools/VMInspector.cpp: * tools/VMInspector.h: (JSC::VMInspector::getLock): (JSC::VMInspector::iterate): Source/WebCore: No new tests needed. This is covered by existing tests. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::scheduleExecutionTermination): Source/WTF: Make StackBounds more useful for checking if a pointer is within stack bounds. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::isInAllocatedMemory): * wtf/MetaAllocator.h: * wtf/Platform.h: * wtf/StackBounds.h: (WTF::StackBounds::emptyBounds): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isEmpty): (WTF::StackBounds::contains): Canonical link: https://commits.webkit.org/186409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 19:08:46 +00:00
bool MetaAllocator::isInAllocatedMemory(const AbstractLocker&, void* address)
Implement a sampling profiler https://bugs.webkit.org/show_bug.cgi?id=151713 Reviewed by Filip Pizlo. Source/JavaScriptCore: This patch implements a sampling profiler for JavaScriptCore that will be used in the Inspector UI. The implementation works as follows: We queue the sampling profiler to run a task on a background thread every 1ms. When the queued task executes, the sampling profiler will pause the JSC execution thread and attempt to take a stack trace. The sampling profiler does everything it can to be very careful while taking this stack trace. Because it's reading arbitrary memory, the sampling profiler must validate every pointer it reads from. The sampling profiler tries to get an ExecutableBase for every call frame it reads. It first tries to read the CodeBlock slot. It does this because it can be 100% certain that a pointer is a CodeBlock while it's taking a stack trace. But, not every call frame will have a CodeBlock. So we must read the call frame's callee. For these stack traces where we read the callee, we must verify the callee pointer, and the pointer traversal to an ExecutableBase, on the main JSC execution thread, and not on the thread taking the stack trace. We do this verification either before we run the marking phase in GC, or when somebody asks the SamplingProfiler to materialize its data. The SamplingProfiler must also be careful to not grab any locks while the JSC execution thread is paused (this means it can't do anything that mallocs) because that could cause a deadlock. Therefore, the sampling profiler grabs locks for all data structures it consults before it pauses the JSC execution thread. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: (JSC::CodeBlock::clearVisitWeaklyHasBeenCalled): (JSC::CodeBlockSet::mark): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::add): (JSC::CodeBlockSet::promoteYoungCodeBlocks): (JSC::CodeBlockSet::clearMarksForFullCollection): (JSC::CodeBlockSet::lastChanceToFinalize): (JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced): (JSC::CodeBlockSet::contains): (JSC::CodeBlockSet::writeBarrierCurrentlyExecutingCodeBlocks): (JSC::CodeBlockSet::remove): Deleted. * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): (JSC::CodeBlockSet::iterate): The sampling pofiler uses the heap's CodeBlockSet to validate CodeBlock pointers. This data structure must now be under a lock because we must be certain we're not pausing the JSC execution thread while it's manipulating this data structure. * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::grow): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): (JSC::CompositeMarkHook::CompositeMarkHook): (JSC::CompositeMarkHook::mark): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::markRoots): (JSC::Heap::visitHandleStack): (JSC::Heap::visitSamplingProfiler): (JSC::Heap::traceCodeBlocksAndJITStubRoutines): (JSC::Heap::snapshotMarkedSpace): * heap/Heap.h: (JSC::Heap::structureIDTable): (JSC::Heap::codeBlockSet): * heap/MachineStackMarker.cpp: (pthreadSignalHandlerSuspendResume): (JSC::getCurrentPlatformThread): (JSC::MachineThreads::MachineThreads): (JSC::MachineThreads::~MachineThreads): (JSC::MachineThreads::Thread::createForCurrentThread): (JSC::MachineThreads::Thread::operator==): (JSC::isThreadInList): (JSC::MachineThreads::addCurrentThread): (JSC::MachineThreads::machineThreadForCurrentThread): (JSC::MachineThreads::removeThread): (JSC::MachineThreads::gatherFromCurrentThread): (JSC::MachineThreads::Thread::Thread): (JSC::MachineThreads::Thread::~Thread): (JSC::MachineThreads::Thread::suspend): (JSC::MachineThreads::Thread::resume): (JSC::MachineThreads::Thread::getRegisters): (JSC::MachineThreads::Thread::Registers::stackPointer): (JSC::MachineThreads::Thread::Registers::framePointer): (JSC::MachineThreads::Thread::Registers::instructionPointer): (JSC::MachineThreads::Thread::freeRegisters): (JSC::MachineThreads::tryCopyOtherThreadStacks): (JSC::pthreadSignalHandlerSuspendResume): Deleted. (JSC::MachineThreads::Thread::operator!=): Deleted. * heap/MachineStackMarker.h: (JSC::MachineThreads::Thread::operator!=): (JSC::MachineThreads::getLock): (JSC::MachineThreads::threadsListHead): We can now ask a MachineThreads::Thread for its frame pointer and program counter on darwin and windows platforms. efl and gtk implementations will happen in another patch. * heap/MarkedBlockSet.h: (JSC::MarkedBlockSet::getLock): (JSC::MarkedBlockSet::add): (JSC::MarkedBlockSet::remove): (JSC::MarkedBlockSet::recomputeFilter): (JSC::MarkedBlockSet::filter): (JSC::MarkedBlockSet::set): * heap/MarkedSpace.cpp: (JSC::Free::Free): (JSC::Free::operator()): (JSC::FreeOrShrink::FreeOrShrink): (JSC::FreeOrShrink::operator()): (JSC::MarkedSpace::~MarkedSpace): (JSC::MarkedSpace::isPagedOut): (JSC::MarkedSpace::freeBlock): (JSC::MarkedSpace::freeOrShrinkBlock): (JSC::MarkedSpace::shrink): * heap/MarkedSpace.h: (JSC::MarkedSpace::forEachLiveCell): (JSC::MarkedSpace::forEachDeadCell): * interpreter/CallFrame.h: (JSC::ExecState::calleeAsValue): (JSC::ExecState::callee): (JSC::ExecState::unsafeCallee): (JSC::ExecState::codeBlock): (JSC::ExecState::scope): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::dumpProfile): (JSC::ExecutableAllocator::getLock): (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::isValidExecutableMemory): (JSC::ExecutableAllocator::getLock): (JSC::ExecutableAllocator::committedByteCount): The sampling profiler consults the ExecutableAllocator to check if the frame pointer it reads is in executable allocated memory. * jsc.cpp: (GlobalObject::finishCreation): (functionCheckModuleSyntax): (functionStartSamplingProfiler): (functionSamplingProfilerStackTraces): * llint/LLIntPCRanges.h: Added. (JSC::LLInt::isLLIntPC): * offlineasm/asm.rb: I added the ability to test whether the PC is executing LLInt code because this code is not part of the memory our executable allocator allocates. * runtime/Executable.h: (JSC::ExecutableBase::isModuleProgramExecutable): (JSC::ExecutableBase::isExecutableType): (JSC::ExecutableBase::isHostFunction): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::unlock): * runtime/Options.h: * runtime/SamplingProfiler.cpp: Added. (JSC::reportStats): (JSC::FrameWalker::FrameWalker): (JSC::FrameWalker::walk): (JSC::FrameWalker::wasValidWalk): (JSC::FrameWalker::advanceToParentFrame): (JSC::FrameWalker::isAtTop): (JSC::FrameWalker::resetAtMachineFrame): (JSC::FrameWalker::isValidFramePointer): (JSC::FrameWalker::isValidCodeBlock): (JSC::FrameWalker::tryToGetExecutableFromCallee): The FrameWalker class is used to walk the stack in a safe manner. It doesn't do anything that would deadlock, and it validates all pointers that it sees. (JSC::SamplingProfiler::SamplingProfiler): (JSC::SamplingProfiler::~SamplingProfiler): (JSC::SamplingProfiler::visit): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::stop): (JSC::SamplingProfiler::pause): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::dispatchIfNecessary): (JSC::SamplingProfiler::dispatchFunction): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::observeStackTrace): (JSC::SamplingProfiler::clearData): (JSC::displayName): (JSC::startLine): (JSC::startColumn): (JSC::sourceID): (JSC::url): (JSC::SamplingProfiler::stacktracesAsJSON): * runtime/SamplingProfiler.h: Added. (JSC::SamplingProfiler::getLock): (JSC::SamplingProfiler::setTimingInterval): (JSC::SamplingProfiler::stackTraces): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::~VM): (JSC::VM::setLastStackTop): (JSC::VM::createContextGroup): (JSC::VM::ensureWatchdog): (JSC::VM::ensureSamplingProfiler): (JSC::thunkGeneratorForIntrinsic): * runtime/VM.h: (JSC::VM::watchdog): (JSC::VM::isSafeToRecurse): (JSC::VM::lastStackTop): (JSC::VM::scratchBufferForSize): (JSC::VM::samplingProfiler): (JSC::VM::setShouldRewriteConstAsVar): (JSC::VM::setLastStackTop): Deleted. * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * tests/stress/sampling-profiler: Added. * tests/stress/sampling-profiler-anonymous-function.js: Added. (foo): (baz): * tests/stress/sampling-profiler-basic.js: Added. (bar): (foo): (nothing): (top): (jaz): (kaz): (checkInlining): * tests/stress/sampling-profiler-deep-stack.js: Added. (foo): (hellaDeep): (start): * tests/stress/sampling-profiler-microtasks.js: Added. (testResults): (loop.jaz): (loop): * tests/stress/sampling-profiler/samplingProfiler.js: Added. (assert): (let.nodePrototype.makeChildIfNeeded): (makeNode): (updateCallingContextTree): (doesTreeHaveStackTrace): (makeTree): (runTest): (dumpTree): * tools/JSDollarVMPrototype.cpp: (JSC::JSDollarVMPrototype::isInObjectSpace): (JSC::JSDollarVMPrototype::isInStorageSpace): * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::generateEnter): (JSC::Yarr::YarrGenerator::generateReturn): (JSC::Yarr::YarrGenerator::YarrGenerator): (JSC::Yarr::YarrGenerator::compile): (JSC::Yarr::jitCompile): We now have a boolean that's set to true when we're executing a RegExp, and to false otherwise. The boolean lives off of VM. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: (JSC::CodeBlock::clearVisitWeaklyHasBeenCalled): (JSC::CodeBlockSet::mark): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::add): (JSC::CodeBlockSet::promoteYoungCodeBlocks): (JSC::CodeBlockSet::clearMarksForFullCollection): (JSC::CodeBlockSet::lastChanceToFinalize): (JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced): (JSC::CodeBlockSet::contains): (JSC::CodeBlockSet::writeBarrierCurrentlyExecutingCodeBlocks): (JSC::CodeBlockSet::remove): Deleted. * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): (JSC::CodeBlockSet::iterate): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::add): (JSC::CompositeMarkHook::CompositeMarkHook): (JSC::CompositeMarkHook::mark): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::markRoots): (JSC::Heap::visitHandleStack): (JSC::Heap::visitSamplingProfiler): (JSC::Heap::traceCodeBlocksAndJITStubRoutines): * heap/Heap.h: (JSC::Heap::structureIDTable): (JSC::Heap::codeBlockSet): * heap/HeapInlines.h: (JSC::Heap::didFreeBlock): (JSC::Heap::isPointerGCObject): (JSC::Heap::isValueGCObject): * heap/MachineStackMarker.cpp: (pthreadSignalHandlerSuspendResume): (JSC::getCurrentPlatformThread): (JSC::MachineThreads::MachineThreads): (JSC::MachineThreads::~MachineThreads): (JSC::MachineThreads::Thread::createForCurrentThread): (JSC::MachineThreads::Thread::operator==): (JSC::isThreadInList): (JSC::MachineThreads::addCurrentThread): (JSC::MachineThreads::machineThreadForCurrentThread): (JSC::MachineThreads::removeThread): (JSC::MachineThreads::gatherFromCurrentThread): (JSC::MachineThreads::Thread::Thread): (JSC::MachineThreads::Thread::~Thread): (JSC::MachineThreads::Thread::suspend): (JSC::MachineThreads::Thread::resume): (JSC::MachineThreads::Thread::getRegisters): (JSC::MachineThreads::Thread::Registers::stackPointer): (JSC::MachineThreads::Thread::Registers::framePointer): (JSC::MachineThreads::Thread::Registers::instructionPointer): (JSC::MachineThreads::Thread::freeRegisters): (JSC::pthreadSignalHandlerSuspendResume): Deleted. (JSC::MachineThreads::Thread::operator!=): Deleted. * heap/MachineStackMarker.h: (JSC::MachineThreads::Thread::operator!=): (JSC::MachineThreads::getLock): (JSC::MachineThreads::threadsListHead): * heap/MarkedBlockSet.h: * heap/MarkedSpace.cpp: (JSC::Free::Free): (JSC::Free::operator()): (JSC::FreeOrShrink::FreeOrShrink): (JSC::FreeOrShrink::operator()): * interpreter/CallFrame.h: (JSC::ExecState::calleeAsValue): (JSC::ExecState::callee): (JSC::ExecState::unsafeCallee): (JSC::ExecState::codeBlock): (JSC::ExecState::scope): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::dumpProfile): (JSC::ExecutableAllocator::getLock): (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::isValidExecutableMemory): (JSC::ExecutableAllocator::getLock): (JSC::ExecutableAllocator::committedByteCount): * jsc.cpp: (GlobalObject::finishCreation): (functionCheckModuleSyntax): (functionPlatformSupportsSamplingProfiler): (functionStartSamplingProfiler): (functionSamplingProfilerStackTraces): * llint/LLIntPCRanges.h: Added. (JSC::LLInt::isLLIntPC): * offlineasm/asm.rb: * runtime/Executable.h: (JSC::ExecutableBase::isModuleProgramExecutable): (JSC::ExecutableBase::isExecutableType): (JSC::ExecutableBase::isHostFunction): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::unlock): * runtime/Options.h: * runtime/SamplingProfiler.cpp: Added. (JSC::reportStats): (JSC::FrameWalker::FrameWalker): (JSC::FrameWalker::walk): (JSC::FrameWalker::wasValidWalk): (JSC::FrameWalker::advanceToParentFrame): (JSC::FrameWalker::isAtTop): (JSC::FrameWalker::resetAtMachineFrame): (JSC::FrameWalker::isValidFramePointer): (JSC::FrameWalker::isValidCodeBlock): (JSC::SamplingProfiler::SamplingProfiler): (JSC::SamplingProfiler::~SamplingProfiler): (JSC::SamplingProfiler::processUnverifiedStackTraces): (JSC::SamplingProfiler::visit): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::stop): (JSC::SamplingProfiler::pause): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::dispatchIfNecessary): (JSC::SamplingProfiler::dispatchFunction): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::clearData): (JSC::displayName): (JSC::SamplingProfiler::stacktracesAsJSON): (WTF::printInternal): * runtime/SamplingProfiler.h: Added. (JSC::SamplingProfiler::StackFrame::StackFrame): (JSC::SamplingProfiler::getLock): (JSC::SamplingProfiler::setTimingInterval): (JSC::SamplingProfiler::stackTraces): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::~VM): (JSC::VM::setLastStackTop): (JSC::VM::createContextGroup): (JSC::VM::ensureWatchdog): (JSC::VM::ensureSamplingProfiler): (JSC::thunkGeneratorForIntrinsic): * runtime/VM.h: (JSC::VM::watchdog): (JSC::VM::samplingProfiler): (JSC::VM::isSafeToRecurse): (JSC::VM::lastStackTop): (JSC::VM::scratchBufferForSize): (JSC::VM::setLastStackTop): Deleted. * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * tests/stress/sampling-profiler: Added. * tests/stress/sampling-profiler-anonymous-function.js: Added. (platformSupportsSamplingProfiler.foo): (platformSupportsSamplingProfiler.baz): (platformSupportsSamplingProfiler): * tests/stress/sampling-profiler-basic.js: Added. (platformSupportsSamplingProfiler.bar): (platformSupportsSamplingProfiler.foo): (platformSupportsSamplingProfiler.nothing): (platformSupportsSamplingProfiler.top): (platformSupportsSamplingProfiler.jaz): (platformSupportsSamplingProfiler.kaz): (platformSupportsSamplingProfiler.checkInlining): (platformSupportsSamplingProfiler): * tests/stress/sampling-profiler-deep-stack.js: Added. (platformSupportsSamplingProfiler.foo): (platformSupportsSamplingProfiler.let.hellaDeep): (platformSupportsSamplingProfiler.let.start): (platformSupportsSamplingProfiler): * tests/stress/sampling-profiler-microtasks.js: Added. (platformSupportsSamplingProfiler.testResults): (platformSupportsSamplingProfiler): (platformSupportsSamplingProfiler.loop.jaz): (platformSupportsSamplingProfiler.loop): * tests/stress/sampling-profiler/samplingProfiler.js: Added. (assert): (let.nodePrototype.makeChildIfNeeded): (makeNode): (updateCallingContextTree): (doesTreeHaveStackTrace): (makeTree): (runTest): (dumpTree): * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::generateEnter): (JSC::Yarr::YarrGenerator::generateReturn): (JSC::Yarr::YarrGenerator::YarrGenerator): (JSC::Yarr::YarrGenerator::compile): (JSC::Yarr::jitCompile): Source/WTF: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::isInAllocatedMemory): (WTF::MetaAllocator::roundUp): * wtf/MetaAllocator.h: (WTF::MetaAllocator::getLock): * wtf/Platform.h: Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/171049@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 06:49:49 +00:00
{
ASSERT(m_lock.isLocked());
uintptr_t page = reinterpret_cast<uintptr_t>(address) >> m_logPageSize;
return m_pageOccupancyMap.contains(page);
}
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
size_t MetaAllocator::roundUp(size_t sizeInBytes)
{
if (std::numeric_limits<size_t>::max() - m_allocationGranule <= sizeInBytes)
CRASH();
return (sizeInBytes + m_allocationGranule - 1) & ~(m_allocationGranule - 1);
}
MetaAllocator::FreeSpaceNode* MetaAllocator::allocFreeSpaceNode()
{
#ifndef NDEBUG
m_mallocBalance++;
#endif
Experiment: create lots of different malloc zones for easier accounting of memory use https://bugs.webkit.org/show_bug.cgi?id=186422 Patch by Yusuke Suzuki <ysuzuki@apple.com> and Simon Fraser <simon.fraser@apple.com> on 2020-01-02 Reviewed by Saam Barati. Source/bmalloc: * bmalloc/BPlatform.h: * bmalloc/Environment.cpp: (bmalloc::Environment::computeIsDebugHeapEnabled): * bmalloc/IsoHeap.h: (bmalloc::api::IsoHeap::IsoHeap): * bmalloc/IsoHeapInlines.h: (bmalloc::api::IsoHeap<Type>::IsoHeap): * bmalloc/IsoTLSInlines.h: (bmalloc::IsoTLS::allocateSlow): (bmalloc::IsoTLS::deallocateSlow): Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/AssemblerBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * assembler/AssemblerBuffer.h: (JSC::AssemblerData::AssemblerData): (JSC::AssemblerData::operator=): (JSC::AssemblerData::~AssemblerData): (JSC::AssemblerData::grow): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/BytecodeBasicBlock.cpp: * bytecode/BytecodeBasicBlock.h: * bytecode/CodeBlock.cpp: * bytecode/CodeBlock.h: * bytecode/InstructionStream.cpp: * bytecode/InstructionStream.h: * bytecode/PolymorphicAccess.cpp: * bytecode/PolymorphicAccess.h: * bytecode/UnlinkedMetadataTable.cpp: (JSC::UnlinkedMetadataTable::finalize): * bytecode/UnlinkedMetadataTable.h: * bytecode/UnlinkedMetadataTableInlines.h: (JSC::UnlinkedMetadataTable::UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::~UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::link): (JSC::UnlinkedMetadataTable::unlink): * bytecode/ValueProfile.h: (JSC::ValueProfileAndVirtualRegisterBuffer::ValueProfileAndVirtualRegisterBuffer): * bytecode/Watchpoint.cpp: * bytecode/Watchpoint.h: * dfg/DFGBasicBlock.cpp: * dfg/DFGBasicBlock.h: * dfg/DFGNode.cpp: * dfg/DFGNode.h: * dfg/DFGSpeculativeJIT.cpp: * dfg/DFGSpeculativeJIT.h: * heap/BlockDirectory.cpp: * heap/BlockDirectory.h: * heap/FastMallocAlignedMemoryAllocator.cpp: (JSC::FastMallocAlignedMemoryAllocator::FastMallocAlignedMemoryAllocator): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::freeAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateMemory): (JSC::FastMallocAlignedMemoryAllocator::freeMemory): (JSC::FastMallocAlignedMemoryAllocator::tryReallocateMemory): * heap/FastMallocAlignedMemoryAllocator.h: * heap/GCSegmentedArray.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * heap/GCSegmentedArray.h: * heap/GCSegmentedArrayInlines.h: (JSC::GCArraySegment<T>::create): (JSC::GCArraySegment<T>::destroy): * heap/GigacageAlignedMemoryAllocator.cpp: (JSC::GigacageAlignedMemoryAllocator::GigacageAlignedMemoryAllocator): (JSC::GigacageAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::freeAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::tryAllocateMemory): (JSC::GigacageAlignedMemoryAllocator::freeMemory): (JSC::GigacageAlignedMemoryAllocator::tryReallocateMemory): * heap/GigacageAlignedMemoryAllocator.h: * heap/IsoAlignedMemoryAllocator.cpp: (JSC::IsoAlignedMemoryAllocator::IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::~IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::IsoAlignedMemoryAllocator::freeAlignedMemory): (JSC::IsoAlignedMemoryAllocator::tryAllocateMemory): (JSC::IsoAlignedMemoryAllocator::freeMemory): * heap/IsoAlignedMemoryAllocator.h: * heap/IsoSubspace.cpp: (JSC::IsoSubspace::IsoSubspace): * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: * heap/WeakBlock.cpp: (JSC::WeakBlock::create): (JSC::WeakBlock::destroy): * heap/WeakBlock.h: * jit/JITCode.cpp: * jit/JITCode.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * parser/Nodes.cpp: * parser/Nodes.h: * parser/ParserArena.cpp: (JSC::ParserArena::deallocateObjects): (JSC::ParserArena::allocateFreeablePool): * parser/ParserArena.h: * parser/SourceProvider.cpp: * parser/SourceProvider.h: * parser/SourceProviderCache.cpp: * parser/SourceProviderCache.h: * parser/SourceProviderCacheItem.h: (JSC::SourceProviderCacheItem::create): * runtime/CachePayload.cpp: (JSC::CachePayload::makeMallocPayload): * runtime/CachePayload.h: * runtime/CachedBytecode.h: (JSC::CachedBytecode::create): * runtime/CachedTypes.cpp: (JSC::Encoder::release): (JSC::Encoder::Page::Page): (JSC::CachedVector::encode): (JSC::CachedVector::decode const): (JSC::CachedInstructionStream::decode const): * runtime/PropertyMapHashTable.h: (JSC::PropertyTable::rehash): * runtime/PropertyTable.cpp: (JSC::PropertyTable::PropertyTable): (JSC::PropertyTable::~PropertyTable): * runtime/SymbolTable.cpp: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::~VM): * runtime/VM.h: (JSC::ScratchBuffer::create): (JSC::VM::exceptionFuzzingBuffer): * wasm/WasmInstance.cpp: (JSC::Wasm::Instance::Instance): * wasm/WasmInstance.h: * wasm/WasmTable.cpp: (JSC::Wasm::Table::Table): (JSC::Wasm::FuncRefTable::FuncRefTable): * wasm/WasmTable.h: Source/WebCore: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * css/CSSFontFace.cpp: * css/CSSFontFace.h: * css/CSSSelector.cpp: * css/CSSSelector.h: * css/CSSValue.cpp: * css/CSSValue.h: * css/StyleProperties.cpp: (WebCore::ImmutableStyleProperties::create): * css/StyleProperties.h: * css/StyleRule.cpp: * css/StyleRule.h: * dom/ElementData.cpp: (WebCore::ShareableElementData::createWithAttributes): (WebCore::UniqueElementData::makeShareableCopy const): * dom/ElementData.h: * dom/NodeRareData.cpp: * dom/NodeRareData.h: * dom/QualifiedName.cpp: * dom/QualifiedName.h: * html/parser/HTMLDocumentParser.cpp: * html/parser/HTMLDocumentParser.h: * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/cache/CachedResource.cpp: * loader/cache/CachedResource.h: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontCascadeFonts.cpp: * platform/graphics/FontCascadeFonts.h: * platform/graphics/Region.cpp: * platform/graphics/Region.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::releaseUint8Vector): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::Buffer): * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandleInternal.h: * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::closeCurrentStream): (WebCore::advanceCurrentStream): * rendering/RenderLayer.cpp: * rendering/RenderLayer.h: * rendering/TableLayout.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * rendering/TableLayout.h: * rendering/style/RenderStyle.cpp: * rendering/style/RenderStyle.h: * rendering/style/SVGRenderStyle.cpp: * rendering/style/SVGRenderStyle.h: * rendering/style/SVGRenderStyleDefs.cpp: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleBoxData.cpp: * rendering/style/StyleBoxData.h: * rendering/style/StyleInheritedData.cpp: * rendering/style/StyleInheritedData.h: * rendering/style/StyleRareInheritedData.cpp: * rendering/style/StyleRareInheritedData.h: * rendering/style/StyleRareNonInheritedData.cpp: * rendering/style/StyleRareNonInheritedData.h: * rendering/style/StyleSurroundData.cpp: * rendering/style/StyleSurroundData.h: * rendering/style/StyleTransformData.cpp: * rendering/style/StyleTransformData.h: * style/StyleTreeResolver.cpp: * style/StyleTreeResolver.h: * svg/animation/SMILTimeContainer.cpp: * svg/animation/SMILTimeContainer.h: Source/WebKit: * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::~ShareableBitmap): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionState): Source/WTF: This patch introduces ENABLE(MALLOC_HEAP_BREAKDOWN). If this is enabled, we allocate malloc_zone per malloc kind. This offers the way to investigate the usage of memory per kind by using vmmap, like the following. VIRTUAL RESIDENT DIRTY SWAPPED ALLOCATION BYTES DIRTY+SWAP REGION MALLOC ZONE SIZE SIZE SIZE SIZE COUNT ALLOCATED FRAG SIZE % FRAG COUNT =========== ======= ========= ========= ========= ========= ========= ========= ====== ====== StringImpl_0x116efd000 188.0M 69.3M 30.9M 0K 139456 18.0M 12.9M 42% 34 DefaultMallocZone_0x10f487000 176.0M 53.9M 14.1M 0K 115956 9955K 4497K 32% 22 Vector_0x116eff000 162.0M 56.3M 55.3M 0K 140715 17.3M 37.9M 69% 36 MetadataTable_0x11843b000 152.0M 17.5M 17.5M 0K 14200 2353K 15.2M 87% 26 WebKit Using System Malloc_0x114cbe000 150.0M 31.6M 21.8M 0K 87422 16.7M 5278K 24% 23 InstructionStream_0x118469000 150.0M 5764K 5764K 0K 14470 4688K 1076K 19% 24 AssemblerData_0x117ee6000 150.0M 1928K 1928K 0K 1 16 1928K 100% 24 To achieve this goal without making very large change, we put a template type in various containers. For example, Vector will take Malloc parameter (the default one is FastMalloc allocator). If ENABLE(MALLOC_HEAP_BREAKDOWN) is enabled, we change this to specific VectorMalloc allocator, and vmmap can show memory usage of this allocator. This patch also supports malloc_zone per IsoHeap. So we can see memory allocation per IsoHeap in vmmap. To use this feature, we need to flip two compile time flags, ENABLE(MALLOC_HEAP_BREAKDOWN) in WTF and BENABLE_MALLOC_HEAP_BREAKDOWN in bmalloc. And use `vmmap $PID` to dump malloc zones. To allocate objects of a class with a specific malloc-zone, use WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(HeapIdentifier) for the class, and define allocator by DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a header and DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a cpp file. This patch also introduce callstack collector for malloc. Vector, HashMap etc. are used to allocate various things, but the above malloc_zone feature only tells thing like "Vector takes XXX MB memory". But what we want to know in this case is what Vector is consuming memory. We collect StackShot for each malloc call, and combine these information to tell which callsite is consuming much memory, which tell us that what Vector is consuming memory. * WTF.xcodeproj/project.pbxproj: * wtf/Bag.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/Bag.h: (WTF::Private::BagNode::BagNode): Deleted. * wtf/BitVector.cpp: (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): * wtf/CMakeLists.txt: * wtf/ConcurrentBuffer.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/ConcurrentBuffer.h: * wtf/DebugHeap.cpp: Copied from Source/JavaScriptCore/runtime/CachePayload.cpp. (WTF::DebugHeap::DebugHeap): (WTF::DebugHeap::malloc): (WTF::DebugHeap::calloc): (WTF::DebugHeap::memalign): (WTF::DebugHeap::realloc): (WTF::DebugHeap::free): * wtf/DebugHeap.h: Added. * wtf/FastBitVector.cpp: (WTF::FastBitVectorWordOwner::setEqualsSlow): (WTF::FastBitVectorWordOwner::resizeSlow): * wtf/FastBitVector.h: (WTF::FastBitVectorWordOwner::~FastBitVectorWordOwner): * wtf/FastMalloc.cpp: (WTF::fastMallocDumpMallocStats): (WTF::AvoidRecordingScope::AvoidRecordingScope): (WTF::AvoidRecordingScope::~AvoidRecordingScope): (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): (WTF::MallocCallTracker::singleton): (WTF::MallocCallTracker::MallocCallTracker): (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): (WTF::fastMalloc): (WTF::fastRealloc): (WTF::fastFree): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): (WTF::fastAlignedFree): * wtf/FastMalloc.h: (WTF::FastMalloc::zeroedMalloc): (WTF::FastMalloc::tryZeroedMalloc): * wtf/Forward.h: * wtf/HashTable.cpp: * wtf/HashTable.h: (WTF::KeyTraits>::allocateTable): (WTF::KeyTraits>::deallocateTable): (WTF::KeyTraits>::rehash): * wtf/MallocPtr.h: (WTF::MallocPtr::MallocPtr): (WTF::MallocPtr::malloc): (WTF::MallocPtr::zeroedMalloc): (WTF::MallocPtr::tryMalloc): (WTF::MallocPtr::tryZeroedMalloc): (WTF::adoptMallocPtr): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): * wtf/MetaAllocatorHandle.h: * wtf/Platform.h: * wtf/RefCountedArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::~RefCountedArray): (WTF::RefCountedArray::assign): * wtf/SegmentedVector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SegmentedVector.h: * wtf/SmallPtrSet.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SmallPtrSet.h: (WTF::SmallPtrSet::~SmallPtrSet): (WTF::SmallPtrSet::grow): * wtf/UniqueArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/UniqueArray.h: (WTF::UniqueArrayFree::operator() const): (WTF::UniqueArrayFree<T::operator() const): * wtf/Vector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/Vector.h: (WTF::VectorBufferBase::allocateBuffer): (WTF::VectorBufferBase::tryAllocateBuffer): (WTF::VectorBufferBase::reallocateBuffer): (WTF::VectorBufferBase::deallocateBuffer): (WTF::VectorBufferBase::releaseBuffer): (WTF::VectorBuffer::releaseBuffer): (WTF::Vector::swap): (WTF::Malloc>::Vector): (WTF::=): (WTF::Malloc>::contains const): (WTF::Malloc>::findMatching const): (WTF::Malloc>::find const): (WTF::Malloc>::reverseFind const): (WTF::Malloc>::appendIfNotContains): (WTF::Malloc>::fill): (WTF::Malloc>::appendRange): (WTF::Malloc>::expandCapacity): (WTF::Malloc>::tryExpandCapacity): (WTF::Malloc>::resize): (WTF::Malloc>::resizeToFit): (WTF::Malloc>::shrink): (WTF::Malloc>::grow): (WTF::Malloc>::asanSetInitialBufferSizeTo): (WTF::Malloc>::asanSetBufferSizeToFullCapacity): (WTF::Malloc>::asanBufferSizeWillChangeTo): (WTF::Malloc>::reserveCapacity): (WTF::Malloc>::tryReserveCapacity): (WTF::Malloc>::reserveInitialCapacity): (WTF::Malloc>::shrinkCapacity): (WTF::Malloc>::append): (WTF::Malloc>::tryAppend): (WTF::Malloc>::constructAndAppend): (WTF::Malloc>::tryConstructAndAppend): (WTF::Malloc>::appendSlowCase): (WTF::Malloc>::constructAndAppendSlowCase): (WTF::Malloc>::tryConstructAndAppendSlowCase): (WTF::Malloc>::uncheckedAppend): (WTF::Malloc>::uncheckedConstructAndAppend): (WTF::Malloc>::appendVector): (WTF::Malloc>::insert): (WTF::Malloc>::insertVector): (WTF::Malloc>::remove): (WTF::Malloc>::removeFirst): (WTF::Malloc>::removeFirstMatching): (WTF::Malloc>::removeAll): (WTF::Malloc>::removeAllMatching): (WTF::Malloc>::reverse): (WTF::Malloc>::map const): (WTF::Malloc>::releaseBuffer): (WTF::Malloc>::checkConsistency): (WTF::swap): (WTF::operator==): (WTF::operator!=): (WTF::Malloc>::isolatedCopy const): (WTF::removeRepeatedElements): (WTF::minCapacity>::Vector): Deleted. (WTF::minCapacity>::contains const): Deleted. (WTF::minCapacity>::findMatching const): Deleted. (WTF::minCapacity>::find const): Deleted. (WTF::minCapacity>::reverseFind const): Deleted. (WTF::minCapacity>::appendIfNotContains): Deleted. (WTF::minCapacity>::fill): Deleted. (WTF::minCapacity>::appendRange): Deleted. (WTF::minCapacity>::expandCapacity): Deleted. (WTF::minCapacity>::tryExpandCapacity): Deleted. (WTF::minCapacity>::resize): Deleted. (WTF::minCapacity>::resizeToFit): Deleted. (WTF::minCapacity>::shrink): Deleted. (WTF::minCapacity>::grow): Deleted. (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted. (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted. (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted. (WTF::minCapacity>::reserveCapacity): Deleted. (WTF::minCapacity>::tryReserveCapacity): Deleted. (WTF::minCapacity>::reserveInitialCapacity): Deleted. (WTF::minCapacity>::shrinkCapacity): Deleted. (WTF::minCapacity>::append): Deleted. (WTF::minCapacity>::tryAppend): Deleted. (WTF::minCapacity>::constructAndAppend): Deleted. (WTF::minCapacity>::tryConstructAndAppend): Deleted. (WTF::minCapacity>::appendSlowCase): Deleted. (WTF::minCapacity>::constructAndAppendSlowCase): Deleted. (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted. (WTF::minCapacity>::uncheckedAppend): Deleted. (WTF::minCapacity>::uncheckedConstructAndAppend): Deleted. (WTF::minCapacity>::appendVector): Deleted. (WTF::minCapacity>::insert): Deleted. (WTF::minCapacity>::insertVector): Deleted. (WTF::minCapacity>::remove): Deleted. (WTF::minCapacity>::removeFirst): Deleted. (WTF::minCapacity>::removeFirstMatching): Deleted. (WTF::minCapacity>::removeAll): Deleted. (WTF::minCapacity>::removeAllMatching): Deleted. (WTF::minCapacity>::reverse): Deleted. (WTF::minCapacity>::map const): Deleted. (WTF::minCapacity>::releaseBuffer): Deleted. (WTF::minCapacity>::checkConsistency): Deleted. (WTF::minCapacity>::isolatedCopy const): Deleted. * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: * wtf/text/StringBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): (WTF::StringBuffer::~StringBuffer): (WTF::StringBuffer::resize): (WTF::StringBuffer::release): * wtf/text/StringImpl.cpp: (WTF::StringImpl::~StringImpl): (WTF::StringImpl::destroy): (WTF::StringImpl::createUninitializedInternalNonEmpty): (WTF::StringImpl::reallocateInternal): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::adopt): * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocate): (WTF::StringWrapperCFAllocator::reallocate): (WTF::StringWrapperCFAllocator::deallocate): Canonical link: https://commits.webkit.org/218863@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-03 02:36:43 +00:00
return new (NotNull, MetaAllocatorFreeSpaceMalloc::malloc(sizeof(FreeSpaceNode))) FreeSpaceNode();
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
void MetaAllocator::freeFreeSpaceNode(FreeSpaceNode* node)
{
#ifndef NDEBUG
m_mallocBalance--;
#endif
Experiment: create lots of different malloc zones for easier accounting of memory use https://bugs.webkit.org/show_bug.cgi?id=186422 Patch by Yusuke Suzuki <ysuzuki@apple.com> and Simon Fraser <simon.fraser@apple.com> on 2020-01-02 Reviewed by Saam Barati. Source/bmalloc: * bmalloc/BPlatform.h: * bmalloc/Environment.cpp: (bmalloc::Environment::computeIsDebugHeapEnabled): * bmalloc/IsoHeap.h: (bmalloc::api::IsoHeap::IsoHeap): * bmalloc/IsoHeapInlines.h: (bmalloc::api::IsoHeap<Type>::IsoHeap): * bmalloc/IsoTLSInlines.h: (bmalloc::IsoTLS::allocateSlow): (bmalloc::IsoTLS::deallocateSlow): Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/AssemblerBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * assembler/AssemblerBuffer.h: (JSC::AssemblerData::AssemblerData): (JSC::AssemblerData::operator=): (JSC::AssemblerData::~AssemblerData): (JSC::AssemblerData::grow): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/BytecodeBasicBlock.cpp: * bytecode/BytecodeBasicBlock.h: * bytecode/CodeBlock.cpp: * bytecode/CodeBlock.h: * bytecode/InstructionStream.cpp: * bytecode/InstructionStream.h: * bytecode/PolymorphicAccess.cpp: * bytecode/PolymorphicAccess.h: * bytecode/UnlinkedMetadataTable.cpp: (JSC::UnlinkedMetadataTable::finalize): * bytecode/UnlinkedMetadataTable.h: * bytecode/UnlinkedMetadataTableInlines.h: (JSC::UnlinkedMetadataTable::UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::~UnlinkedMetadataTable): (JSC::UnlinkedMetadataTable::link): (JSC::UnlinkedMetadataTable::unlink): * bytecode/ValueProfile.h: (JSC::ValueProfileAndVirtualRegisterBuffer::ValueProfileAndVirtualRegisterBuffer): * bytecode/Watchpoint.cpp: * bytecode/Watchpoint.h: * dfg/DFGBasicBlock.cpp: * dfg/DFGBasicBlock.h: * dfg/DFGNode.cpp: * dfg/DFGNode.h: * dfg/DFGSpeculativeJIT.cpp: * dfg/DFGSpeculativeJIT.h: * heap/BlockDirectory.cpp: * heap/BlockDirectory.h: * heap/FastMallocAlignedMemoryAllocator.cpp: (JSC::FastMallocAlignedMemoryAllocator::FastMallocAlignedMemoryAllocator): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::freeAlignedMemory): (JSC::FastMallocAlignedMemoryAllocator::tryAllocateMemory): (JSC::FastMallocAlignedMemoryAllocator::freeMemory): (JSC::FastMallocAlignedMemoryAllocator::tryReallocateMemory): * heap/FastMallocAlignedMemoryAllocator.h: * heap/GCSegmentedArray.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * heap/GCSegmentedArray.h: * heap/GCSegmentedArrayInlines.h: (JSC::GCArraySegment<T>::create): (JSC::GCArraySegment<T>::destroy): * heap/GigacageAlignedMemoryAllocator.cpp: (JSC::GigacageAlignedMemoryAllocator::GigacageAlignedMemoryAllocator): (JSC::GigacageAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::freeAlignedMemory): (JSC::GigacageAlignedMemoryAllocator::tryAllocateMemory): (JSC::GigacageAlignedMemoryAllocator::freeMemory): (JSC::GigacageAlignedMemoryAllocator::tryReallocateMemory): * heap/GigacageAlignedMemoryAllocator.h: * heap/IsoAlignedMemoryAllocator.cpp: (JSC::IsoAlignedMemoryAllocator::IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::~IsoAlignedMemoryAllocator): (JSC::IsoAlignedMemoryAllocator::tryAllocateAlignedMemory): (JSC::IsoAlignedMemoryAllocator::freeAlignedMemory): (JSC::IsoAlignedMemoryAllocator::tryAllocateMemory): (JSC::IsoAlignedMemoryAllocator::freeMemory): * heap/IsoAlignedMemoryAllocator.h: * heap/IsoSubspace.cpp: (JSC::IsoSubspace::IsoSubspace): * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: * heap/WeakBlock.cpp: (JSC::WeakBlock::create): (JSC::WeakBlock::destroy): * heap/WeakBlock.h: * jit/JITCode.cpp: * jit/JITCode.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * parser/Nodes.cpp: * parser/Nodes.h: * parser/ParserArena.cpp: (JSC::ParserArena::deallocateObjects): (JSC::ParserArena::allocateFreeablePool): * parser/ParserArena.h: * parser/SourceProvider.cpp: * parser/SourceProvider.h: * parser/SourceProviderCache.cpp: * parser/SourceProviderCache.h: * parser/SourceProviderCacheItem.h: (JSC::SourceProviderCacheItem::create): * runtime/CachePayload.cpp: (JSC::CachePayload::makeMallocPayload): * runtime/CachePayload.h: * runtime/CachedBytecode.h: (JSC::CachedBytecode::create): * runtime/CachedTypes.cpp: (JSC::Encoder::release): (JSC::Encoder::Page::Page): (JSC::CachedVector::encode): (JSC::CachedVector::decode const): (JSC::CachedInstructionStream::decode const): * runtime/PropertyMapHashTable.h: (JSC::PropertyTable::rehash): * runtime/PropertyTable.cpp: (JSC::PropertyTable::PropertyTable): (JSC::PropertyTable::~PropertyTable): * runtime/SymbolTable.cpp: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::~VM): * runtime/VM.h: (JSC::ScratchBuffer::create): (JSC::VM::exceptionFuzzingBuffer): * wasm/WasmInstance.cpp: (JSC::Wasm::Instance::Instance): * wasm/WasmInstance.h: * wasm/WasmTable.cpp: (JSC::Wasm::Table::Table): (JSC::Wasm::FuncRefTable::FuncRefTable): * wasm/WasmTable.h: Source/WebCore: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * css/CSSFontFace.cpp: * css/CSSFontFace.h: * css/CSSSelector.cpp: * css/CSSSelector.h: * css/CSSValue.cpp: * css/CSSValue.h: * css/StyleProperties.cpp: (WebCore::ImmutableStyleProperties::create): * css/StyleProperties.h: * css/StyleRule.cpp: * css/StyleRule.h: * dom/ElementData.cpp: (WebCore::ShareableElementData::createWithAttributes): (WebCore::UniqueElementData::makeShareableCopy const): * dom/ElementData.h: * dom/NodeRareData.cpp: * dom/NodeRareData.h: * dom/QualifiedName.cpp: * dom/QualifiedName.h: * html/parser/HTMLDocumentParser.cpp: * html/parser/HTMLDocumentParser.h: * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/cache/CachedResource.cpp: * loader/cache/CachedResource.h: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontCascadeFonts.cpp: * platform/graphics/FontCascadeFonts.h: * platform/graphics/Region.cpp: * platform/graphics/Region.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::releaseUint8Vector): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::Buffer): * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandleInternal.h: * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::closeCurrentStream): (WebCore::advanceCurrentStream): * rendering/RenderLayer.cpp: * rendering/RenderLayer.h: * rendering/TableLayout.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * rendering/TableLayout.h: * rendering/style/RenderStyle.cpp: * rendering/style/RenderStyle.h: * rendering/style/SVGRenderStyle.cpp: * rendering/style/SVGRenderStyle.h: * rendering/style/SVGRenderStyleDefs.cpp: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleBoxData.cpp: * rendering/style/StyleBoxData.h: * rendering/style/StyleInheritedData.cpp: * rendering/style/StyleInheritedData.h: * rendering/style/StyleRareInheritedData.cpp: * rendering/style/StyleRareInheritedData.h: * rendering/style/StyleRareNonInheritedData.cpp: * rendering/style/StyleRareNonInheritedData.h: * rendering/style/StyleSurroundData.cpp: * rendering/style/StyleSurroundData.h: * rendering/style/StyleTransformData.cpp: * rendering/style/StyleTransformData.h: * style/StyleTreeResolver.cpp: * style/StyleTreeResolver.h: * svg/animation/SMILTimeContainer.cpp: * svg/animation/SMILTimeContainer.h: Source/WebKit: * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::~ShareableBitmap): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionState): Source/WTF: This patch introduces ENABLE(MALLOC_HEAP_BREAKDOWN). If this is enabled, we allocate malloc_zone per malloc kind. This offers the way to investigate the usage of memory per kind by using vmmap, like the following. VIRTUAL RESIDENT DIRTY SWAPPED ALLOCATION BYTES DIRTY+SWAP REGION MALLOC ZONE SIZE SIZE SIZE SIZE COUNT ALLOCATED FRAG SIZE % FRAG COUNT =========== ======= ========= ========= ========= ========= ========= ========= ====== ====== StringImpl_0x116efd000 188.0M 69.3M 30.9M 0K 139456 18.0M 12.9M 42% 34 DefaultMallocZone_0x10f487000 176.0M 53.9M 14.1M 0K 115956 9955K 4497K 32% 22 Vector_0x116eff000 162.0M 56.3M 55.3M 0K 140715 17.3M 37.9M 69% 36 MetadataTable_0x11843b000 152.0M 17.5M 17.5M 0K 14200 2353K 15.2M 87% 26 WebKit Using System Malloc_0x114cbe000 150.0M 31.6M 21.8M 0K 87422 16.7M 5278K 24% 23 InstructionStream_0x118469000 150.0M 5764K 5764K 0K 14470 4688K 1076K 19% 24 AssemblerData_0x117ee6000 150.0M 1928K 1928K 0K 1 16 1928K 100% 24 To achieve this goal without making very large change, we put a template type in various containers. For example, Vector will take Malloc parameter (the default one is FastMalloc allocator). If ENABLE(MALLOC_HEAP_BREAKDOWN) is enabled, we change this to specific VectorMalloc allocator, and vmmap can show memory usage of this allocator. This patch also supports malloc_zone per IsoHeap. So we can see memory allocation per IsoHeap in vmmap. To use this feature, we need to flip two compile time flags, ENABLE(MALLOC_HEAP_BREAKDOWN) in WTF and BENABLE_MALLOC_HEAP_BREAKDOWN in bmalloc. And use `vmmap $PID` to dump malloc zones. To allocate objects of a class with a specific malloc-zone, use WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(HeapIdentifier) for the class, and define allocator by DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a header and DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a cpp file. This patch also introduce callstack collector for malloc. Vector, HashMap etc. are used to allocate various things, but the above malloc_zone feature only tells thing like "Vector takes XXX MB memory". But what we want to know in this case is what Vector is consuming memory. We collect StackShot for each malloc call, and combine these information to tell which callsite is consuming much memory, which tell us that what Vector is consuming memory. * WTF.xcodeproj/project.pbxproj: * wtf/Bag.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/Bag.h: (WTF::Private::BagNode::BagNode): Deleted. * wtf/BitVector.cpp: (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): * wtf/CMakeLists.txt: * wtf/ConcurrentBuffer.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp. * wtf/ConcurrentBuffer.h: * wtf/DebugHeap.cpp: Copied from Source/JavaScriptCore/runtime/CachePayload.cpp. (WTF::DebugHeap::DebugHeap): (WTF::DebugHeap::malloc): (WTF::DebugHeap::calloc): (WTF::DebugHeap::memalign): (WTF::DebugHeap::realloc): (WTF::DebugHeap::free): * wtf/DebugHeap.h: Added. * wtf/FastBitVector.cpp: (WTF::FastBitVectorWordOwner::setEqualsSlow): (WTF::FastBitVectorWordOwner::resizeSlow): * wtf/FastBitVector.h: (WTF::FastBitVectorWordOwner::~FastBitVectorWordOwner): * wtf/FastMalloc.cpp: (WTF::fastMallocDumpMallocStats): (WTF::AvoidRecordingScope::AvoidRecordingScope): (WTF::AvoidRecordingScope::~AvoidRecordingScope): (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): (WTF::MallocCallTracker::singleton): (WTF::MallocCallTracker::MallocCallTracker): (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): (WTF::fastMalloc): (WTF::fastRealloc): (WTF::fastFree): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): (WTF::fastAlignedFree): * wtf/FastMalloc.h: (WTF::FastMalloc::zeroedMalloc): (WTF::FastMalloc::tryZeroedMalloc): * wtf/Forward.h: * wtf/HashTable.cpp: * wtf/HashTable.h: (WTF::KeyTraits>::allocateTable): (WTF::KeyTraits>::deallocateTable): (WTF::KeyTraits>::rehash): * wtf/MallocPtr.h: (WTF::MallocPtr::MallocPtr): (WTF::MallocPtr::malloc): (WTF::MallocPtr::zeroedMalloc): (WTF::MallocPtr::tryMalloc): (WTF::MallocPtr::tryZeroedMalloc): (WTF::adoptMallocPtr): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): * wtf/MetaAllocatorHandle.h: * wtf/Platform.h: * wtf/RefCountedArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::~RefCountedArray): (WTF::RefCountedArray::assign): * wtf/SegmentedVector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SegmentedVector.h: * wtf/SmallPtrSet.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/SmallPtrSet.h: (WTF::SmallPtrSet::~SmallPtrSet): (WTF::SmallPtrSet::grow): * wtf/UniqueArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/UniqueArray.h: (WTF::UniqueArrayFree::operator() const): (WTF::UniqueArrayFree<T::operator() const): * wtf/Vector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/Vector.h: (WTF::VectorBufferBase::allocateBuffer): (WTF::VectorBufferBase::tryAllocateBuffer): (WTF::VectorBufferBase::reallocateBuffer): (WTF::VectorBufferBase::deallocateBuffer): (WTF::VectorBufferBase::releaseBuffer): (WTF::VectorBuffer::releaseBuffer): (WTF::Vector::swap): (WTF::Malloc>::Vector): (WTF::=): (WTF::Malloc>::contains const): (WTF::Malloc>::findMatching const): (WTF::Malloc>::find const): (WTF::Malloc>::reverseFind const): (WTF::Malloc>::appendIfNotContains): (WTF::Malloc>::fill): (WTF::Malloc>::appendRange): (WTF::Malloc>::expandCapacity): (WTF::Malloc>::tryExpandCapacity): (WTF::Malloc>::resize): (WTF::Malloc>::resizeToFit): (WTF::Malloc>::shrink): (WTF::Malloc>::grow): (WTF::Malloc>::asanSetInitialBufferSizeTo): (WTF::Malloc>::asanSetBufferSizeToFullCapacity): (WTF::Malloc>::asanBufferSizeWillChangeTo): (WTF::Malloc>::reserveCapacity): (WTF::Malloc>::tryReserveCapacity): (WTF::Malloc>::reserveInitialCapacity): (WTF::Malloc>::shrinkCapacity): (WTF::Malloc>::append): (WTF::Malloc>::tryAppend): (WTF::Malloc>::constructAndAppend): (WTF::Malloc>::tryConstructAndAppend): (WTF::Malloc>::appendSlowCase): (WTF::Malloc>::constructAndAppendSlowCase): (WTF::Malloc>::tryConstructAndAppendSlowCase): (WTF::Malloc>::uncheckedAppend): (WTF::Malloc>::uncheckedConstructAndAppend): (WTF::Malloc>::appendVector): (WTF::Malloc>::insert): (WTF::Malloc>::insertVector): (WTF::Malloc>::remove): (WTF::Malloc>::removeFirst): (WTF::Malloc>::removeFirstMatching): (WTF::Malloc>::removeAll): (WTF::Malloc>::removeAllMatching): (WTF::Malloc>::reverse): (WTF::Malloc>::map const): (WTF::Malloc>::releaseBuffer): (WTF::Malloc>::checkConsistency): (WTF::swap): (WTF::operator==): (WTF::operator!=): (WTF::Malloc>::isolatedCopy const): (WTF::removeRepeatedElements): (WTF::minCapacity>::Vector): Deleted. (WTF::minCapacity>::contains const): Deleted. (WTF::minCapacity>::findMatching const): Deleted. (WTF::minCapacity>::find const): Deleted. (WTF::minCapacity>::reverseFind const): Deleted. (WTF::minCapacity>::appendIfNotContains): Deleted. (WTF::minCapacity>::fill): Deleted. (WTF::minCapacity>::appendRange): Deleted. (WTF::minCapacity>::expandCapacity): Deleted. (WTF::minCapacity>::tryExpandCapacity): Deleted. (WTF::minCapacity>::resize): Deleted. (WTF::minCapacity>::resizeToFit): Deleted. (WTF::minCapacity>::shrink): Deleted. (WTF::minCapacity>::grow): Deleted. (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted. (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted. (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted. (WTF::minCapacity>::reserveCapacity): Deleted. (WTF::minCapacity>::tryReserveCapacity): Deleted. (WTF::minCapacity>::reserveInitialCapacity): Deleted. (WTF::minCapacity>::shrinkCapacity): Deleted. (WTF::minCapacity>::append): Deleted. (WTF::minCapacity>::tryAppend): Deleted. (WTF::minCapacity>::constructAndAppend): Deleted. (WTF::minCapacity>::tryConstructAndAppend): Deleted. (WTF::minCapacity>::appendSlowCase): Deleted. (WTF::minCapacity>::constructAndAppendSlowCase): Deleted. (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted. (WTF::minCapacity>::uncheckedAppend): Deleted. (WTF::minCapacity>::uncheckedConstructAndAppend): Deleted. (WTF::minCapacity>::appendVector): Deleted. (WTF::minCapacity>::insert): Deleted. (WTF::minCapacity>::insertVector): Deleted. (WTF::minCapacity>::remove): Deleted. (WTF::minCapacity>::removeFirst): Deleted. (WTF::minCapacity>::removeFirstMatching): Deleted. (WTF::minCapacity>::removeAll): Deleted. (WTF::minCapacity>::removeAllMatching): Deleted. (WTF::minCapacity>::reverse): Deleted. (WTF::minCapacity>::map const): Deleted. (WTF::minCapacity>::releaseBuffer): Deleted. (WTF::minCapacity>::checkConsistency): Deleted. (WTF::minCapacity>::isolatedCopy const): Deleted. * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: * wtf/text/StringBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp. * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): (WTF::StringBuffer::~StringBuffer): (WTF::StringBuffer::resize): (WTF::StringBuffer::release): * wtf/text/StringImpl.cpp: (WTF::StringImpl::~StringImpl): (WTF::StringImpl::destroy): (WTF::StringImpl::createUninitializedInternalNonEmpty): (WTF::StringImpl::reallocateInternal): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::adopt): * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocate): (WTF::StringWrapperCFAllocator::reallocate): (WTF::StringWrapperCFAllocator::deallocate): Canonical link: https://commits.webkit.org/218863@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-03 02:36:43 +00:00
MetaAllocatorFreeSpaceMalloc::free(node);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
#if ENABLE(META_ALLOCATOR_PROFILE)
void MetaAllocator::dumpProfile()
{
JSC_enableProfiler=true should also cause JSGlobalData to save the profiler output somewhere https://bugs.webkit.org/show_bug.cgi?id=113144 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Added the ability to save profiler output with JSC_enableProfiler=true. It will save it to the current directory, or JSC_PROFILER_PATH if the latter was specified. This works by saving the Profiler::Database either when it is destroyed or atexit(), whichever happens first. This allows use of the profiler from any WebKit client. * jsc.cpp: (jscmain): * profiler/ProfilerDatabase.cpp: (Profiler): (JSC::Profiler::Database::Database): (JSC::Profiler::Database::~Database): (JSC::Profiler::Database::registerToSaveAtExit): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::performAtExitSave): (JSC::Profiler::Database::removeFirstAtExitDatabase): (JSC::Profiler::Database::atExitCallback): * profiler/ProfilerDatabase.h: (JSC::Profiler::Database::databaseID): (Database): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): Source/WTF: Reviewed by Geoffrey Garen. I got tired of the fact that getpid(2) is not a syscall on Windows (unless you do _getpid() I believe), so I wrote a header that abstracts it. I also changed existing code that uses getpid() to use WTF::getCurrentProcessID(). * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/ProcessID.h: Added. (WTF): (WTF::getCurrentProcessID): * wtf/text/StringImpl.cpp: (WTF::StringStats::printStats): Canonical link: https://commits.webkit.org/131678@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-03-26 21:43:27 +00:00
dataLogF(
"%d: MetaAllocator(%p): num allocations = %u, num frees = %u, allocated = %lu, reserved = %lu, committed = %lu\n",
getCurrentProcessID(), this, m_numAllocations, m_numFrees, m_bytesAllocated, m_bytesReserved, m_bytesCommitted);
The executable allocator makes it difficult to free individual chunks of executable memory https://bugs.webkit.org/show_bug.cgi?id=66363 Reviewed by Oliver Hunt. Introduced a best-fit, balanced-tree based allocator. The allocator required a balanced tree that does not allocate memory and that permits the removal of individual nodes directly (as opposed to by key); neither AVLTree nor WebCore's PODRedBlackTree supported this. Changed all references to executable code to use a reference counted handle. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.exp: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::finalizeCode): (JSC::LinkBuffer::linkCode): * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef): (JSC::MacroAssemblerCodeRef::createSelfManagedCodeRef): (JSC::MacroAssemblerCodeRef::executableMemory): (JSC::MacroAssemblerCodeRef::code): (JSC::MacroAssemblerCodeRef::size): (JSC::MacroAssemblerCodeRef::operator!): * assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy): * bytecode/CodeBlock.h: * bytecode/Instruction.h: * bytecode/StructureStubInfo.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGRepatch.cpp: (JSC::DFG::generateProtoChainAccessStub): (JSC::DFG::tryCacheGetByID): (JSC::DFG::tryBuildGetByIDList): (JSC::DFG::tryBuildGetByIDProtoList): (JSC::DFG::tryCachePutByID): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::dumpProfile): * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutableAllocator::initializeAllocator): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::isValid): (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableAllocator::dumpProfile): * jit/JIT.cpp: (JSC::JIT::privateCompile): * jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines): (JSC::JIT::compileCTINativeCall): * jit/JITCode.h: (JSC::JITCode::operator !): (JSC::JITCode::addressForCall): (JSC::JITCode::offsetOf): (JSC::JITCode::execute): (JSC::JITCode::start): (JSC::JITCode::size): (JSC::JITCode::getExecutableMemory): (JSC::JITCode::HostFunction): (JSC::JITCode::JITCode): * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::emitSlow_op_get_by_val): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::DEFINE_STUB_FUNCTION): (JSC::getPolymorphicAccessStructureListSlot): (JSC::JITThunks::ctiStub): (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): (JSC::SpecializedThunkJIT::finalize): * jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): (JSC::roundThunkGenerator): (JSC::expThunkGenerator): (JSC::logThunkGenerator): (JSC::absThunkGenerator): (JSC::powThunkGenerator): * jit/ThunkGenerators.h: * runtime/Executable.h: (JSC::NativeExecutable::create): * runtime/InitializeThreading.cpp: (JSC::initializeThreadingOnce): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::dumpSampleData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::getCTIStub): * wtf/CMakeLists.txt: * wtf/MetaAllocator.cpp: Added. (WTF::MetaAllocatorHandle::MetaAllocatorHandle): (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): (WTF::MetaAllocator::findAndRemoveFreeSpace): (WTF::MetaAllocator::addFreeSpaceFromReleasedHandle): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): (WTF::MetaAllocator::addFreeSpace): (WTF::MetaAllocator::incrementPageOccupancy): (WTF::MetaAllocator::decrementPageOccupancy): (WTF::MetaAllocator::roundUp): (WTF::MetaAllocator::allocFreeSpaceNode): (WTF::MetaAllocator::freeFreeSpaceNode): (WTF::MetaAllocator::dumpProfile): * wtf/MetaAllocator.h: Added. (WTF::MetaAllocator::bytesAllocated): (WTF::MetaAllocator::bytesReserved): (WTF::MetaAllocator::bytesCommitted): (WTF::MetaAllocator::dumpProfile): (WTF::MetaAllocator::~MetaAllocator): * wtf/MetaAllocatorHandle.h: Added. * wtf/RedBlackTree.h: Added. (WTF::RedBlackTree::Node::Node): (WTF::RedBlackTree::Node::successor): (WTF::RedBlackTree::Node::predecessor): (WTF::RedBlackTree::Node::reset): (WTF::RedBlackTree::Node::parent): (WTF::RedBlackTree::Node::setParent): (WTF::RedBlackTree::Node::left): (WTF::RedBlackTree::Node::setLeft): (WTF::RedBlackTree::Node::right): (WTF::RedBlackTree::Node::setRight): (WTF::RedBlackTree::Node::color): (WTF::RedBlackTree::Node::setColor): (WTF::RedBlackTree::RedBlackTree): (WTF::RedBlackTree::insert): (WTF::RedBlackTree::remove): (WTF::RedBlackTree::findExact): (WTF::RedBlackTree::findLeastGreaterThanOrEqual): (WTF::RedBlackTree::findGreatestLessThanOrEqual): (WTF::RedBlackTree::first): (WTF::RedBlackTree::last): (WTF::RedBlackTree::size): (WTF::RedBlackTree::isEmpty): (WTF::RedBlackTree::treeMinimum): (WTF::RedBlackTree::treeMaximum): (WTF::RedBlackTree::treeInsert): (WTF::RedBlackTree::leftRotate): (WTF::RedBlackTree::rightRotate): (WTF::RedBlackTree::removeFixup): * wtf/wtf.pri: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile): * yarr/YarrJIT.h: (JSC::Yarr::YarrCodeBlock::execute): (JSC::Yarr::YarrCodeBlock::getAddr): Source/JavaScriptGlue: * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Source/WebCore: No new layout tests because behavior is not changed. New API unit tests: Tests/WTF/RedBlackTree.cpp Tests/WTF/MetaAllocator.cpp * ForwardingHeaders/wtf/MetaAllocatorHandle.h: Added. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: Added. (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WTF/RedBlackTree.cpp: Added. (TestWebKitAPI::Pair::findExact): (TestWebKitAPI::Pair::remove): (TestWebKitAPI::Pair::findLeastGreaterThanOrEqual): (TestWebKitAPI::Pair::assertFoundAndRemove): (TestWebKitAPI::Pair::assertEqual): (TestWebKitAPI::Pair::assertSameValuesForKey): (TestWebKitAPI::Pair::testDriver): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/83806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-11 05:49:36 +00:00
}
#endif
} // namespace WTF