Diff
Modified: trunk/Source/WTF/ChangeLog (195303 => 195304)
--- trunk/Source/WTF/ChangeLog 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/ChangeLog 2016-01-19 20:16:01 UTC (rev 195304)
@@ -1,3 +1,16 @@
+2016-01-19 Chris Dumez <[email protected]>
+
+ Unreviewed, rolling out r195141.
+
+ Seems to cause crashes on iOS9 64bit
+
+ Reverted changeset:
+
+ "Fragmentation-free allocator for timeless and/or coupled
+ allocations."
+ https://bugs.webkit.org/show_bug.cgi?id=152696
+ http://trac.webkit.org/changeset/195141
+
2016-01-19 Enrica Casucci <[email protected]>
Add support for DataDetectors in WK (iOS).
Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (195303 => 195304)
--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj 2016-01-19 20:16:01 UTC (rev 195304)
@@ -53,7 +53,6 @@
<ItemGroup>
<ClCompile Include="..\wtf\Assertions.cpp" />
<ClCompile Include="..\wtf\BitVector.cpp" />
- <ClCompile Include="..\wtf\BumpArena.cpp" />
<ClCompile Include="..\wtf\CompilationThread.cpp" />
<ClCompile Include="..\wtf\CryptographicUtilities.cpp" />
<ClCompile Include="..\wtf\CryptographicallyRandomNumber.cpp" />
Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (195303 => 195304)
--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters 2016-01-19 20:16:01 UTC (rev 195304)
@@ -120,9 +120,6 @@
<ClCompile Include="..\wtf\BitVector.cpp">
<Filter>wtf</Filter>
</ClCompile>
- <ClCompile Include="..\wtf\BumpArena.cpp">
- <Filter>wtf</Filter>
- </ClCompile>
<ClCompile Include="..\wtf\CryptographicUtilities.cpp">
<Filter>wtf</Filter>
</ClCompile>
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (195303 => 195304)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2016-01-19 20:16:01 UTC (rev 195304)
@@ -288,8 +288,6 @@
A8A47486151A825B004123FF /* WTFThreadData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4737A151A825B004123FF /* WTFThreadData.cpp */; };
A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; };
A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; };
- AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */; };
- AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */; settings = {ATTRIBUTES = (Private, ); }; };
B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; };
CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
@@ -604,8 +602,6 @@
A8A4737A151A825B004123FF /* WTFThreadData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WTFThreadData.cpp; sourceTree = "<group>"; };
A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
- AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BumpArena.cpp; sourceTree = "<group>"; };
- AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpArena.h; sourceTree = "<group>"; };
B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
@@ -763,8 +759,6 @@
A8A47265151A825A004123FF /* BloomFilter.h */,
0F93274A1C17F4B700CF6564 /* Box.h */,
0F4570441BE834410062A629 /* BubbleSort.h */,
- AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */,
- AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */,
A8A47267151A825A004123FF /* BumpPointerAllocator.h */,
EB95E1EF161A72410089A2F5 /* ByteOrder.h */,
A8A4726A151A825A004123FF /* CheckedArithmetic.h */,
@@ -1271,7 +1265,6 @@
A8A4742C151A825B004123FF /* StringExtras.h in Headers */,
A8A4743F151A825B004123FF /* StringHash.h in Headers */,
A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */,
- AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */,
A8A47441151A825B004123FF /* StringImpl.h in Headers */,
A8A47442151A825B004123FF /* StringOperators.h in Headers */,
0FDDBFA81666DFA300C55FEF /* StringPrintStream.h in Headers */,
@@ -1415,7 +1408,6 @@
A5BA15FA182435A600A82E69 /* AtomicStringImplCF.cpp in Sources */,
9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */,
1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */,
- AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */,
8134013815B092FD001FF0B8 /* Base64.cpp in Sources */,
A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */,
A8A473AA151A825B004123FF /* bignum.cc in Sources */,
Deleted: trunk/Source/WTF/wtf/BumpArena.cpp (195303 => 195304)
--- trunk/Source/WTF/wtf/BumpArena.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/wtf/BumpArena.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -1,368 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "BumpArena.h"
-
-#include <wtf/HashSet.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/Vector.h>
-
-#if OS(UNIX)
-#define USE_BUMPARENA 1
-#include <sys/mman.h>
-#else
-#define USE_BUMPARENA 0
-#endif
-
-#if OS(DARWIN)
-#include <mach/vm_statistics.h>
-// FIXME: Figure out which VM tag to use.
-#define BUMPARENA_VM_TAG VM_MAKE_TAG(VM_MEMORY_APPLICATION_SPECIFIC_1)
-#else
-#define BUMPARENA_VM_TAG -1
-#endif
-
-#if DEBUG_BUMPARENA
-#include <notify.h>
-#endif
-
-namespace WTF {
-
-#if USE(BUMPARENA)
-
-static const size_t blockSize = 4096;
-static const size_t blockMask = ~(blockSize - 1);
-
-class BumpArena::Block {
-public:
- static constexpr size_t capacity() { return blockSize - sizeof(Block); }
-
- static RefPtr<Block> create(BumpArena&);
- ~Block();
-
- void ref();
- void deref();
-
- BumpArena& arena() { return m_arena.get(); }
-
- static Block& blockFor(const void*);
-
- char* payloadStart() { return reinterpret_cast<char*>(&m_data); }
-
-#if DEBUG_BUMPARENA
- void dump();
-#endif
-
-private:
- friend class BumpArena;
- explicit Block(BumpArena&);
-
- Ref<BumpArena> m_arena;
-
- unsigned m_refCount { 1 };
-
-#if DEBUG_BUMPARENA
- size_t m_bytesAvailable { 0 };
-#endif
-
-#if COMPILER(MSVC)
-#pragma warning(push)
-#pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning
-#endif
- char* m_data[0];
-#if COMPILER(MSVC)
-#pragma warning(pop)
-#endif
-};
-
-#if DEBUG_BUMPARENA
-static HashSet<BumpArena*>& arenas()
-{
- static NeverDestroyed<HashSet<BumpArena*>> set;
- return set;
-}
-#endif
-
-BumpArena::Block::Block(BumpArena& arena)
- : m_arena(arena)
-{
-#if DEBUG_BUMPARENA
- m_arena->m_liveBlocks.add(this);
-#endif
-}
-
-BumpArena::Block::~Block()
-{
-#if DEBUG_BUMPARENA
- m_arena->m_liveBlocks.remove(this);
-#endif
-}
-
-void BumpArena::Block::ref()
-{
- ++m_refCount;
-}
-
-struct BlockAllocator {
- static const size_t vmSize = 128 * MB;
-
- BlockAllocator();
-
- void* allocateBlock();
- void deallocateBlock(void*);
-
- bool isAllocation(const void* p) const;
-
- char* vmBase;
- char* vmEnd;
- char* nextBlock;
- Vector<void*> freeList;
-};
-
-BlockAllocator::BlockAllocator()
-{
- vmBase = reinterpret_cast<char*>(mmap(0, vmSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, BUMPARENA_VM_TAG, 0));
- RELEASE_ASSERT(vmBase != MAP_FAILED);
- vmEnd = vmBase + vmSize;
- nextBlock = reinterpret_cast<char*>(roundUpToMultipleOf<blockSize>(reinterpret_cast<uintptr_t>(vmBase)));
-}
-
-bool BlockAllocator::isAllocation(const void* p) const
-{
- return p >= vmBase && p <= vmEnd;
-}
-
-static BlockAllocator& blockAllocator()
-{
- static NeverDestroyed<BlockAllocator> allocator;
- return allocator;
-}
-
-void* BlockAllocator::allocateBlock()
-{
- if (!freeList.isEmpty()) {
- void* block = freeList.takeLast();
-#if OS(DARWIN)
- while (madvise(block, blockSize, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
-#else
- while (madvise(block, blockSize, MADV_NORMAL) == -1 && errno == EAGAIN) { }
-#endif
- return block;
- }
- char* newNextBlock = nextBlock + blockSize;
- if (newNextBlock >= vmEnd)
- return nullptr;
- void* block = nextBlock;
- nextBlock += blockSize;
- return block;
-}
-
-void BlockAllocator::deallocateBlock(void* block)
-{
-#if OS(DARWIN)
- while (madvise(block, blockSize, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
-#else
- while (madvise(block, blockSize, MADV_DONTNEED) == -1 && errno == EAGAIN) { }
-#endif
- freeList.append(block);
-}
-
-void BumpArena::Block::deref()
-{
- --m_refCount;
-
- if (!m_refCount) {
- this->~Block();
- blockAllocator().deallocateBlock(this);
- } else if (m_refCount == 1 && m_arena->m_currentBlock == this) {
- m_arena->m_currentPayloadEnd = nullptr;
- m_arena->m_currentRemaining = 0;
- // Break the ref-cycle between BumpArena and this Block.
- m_arena->m_currentBlock = nullptr;
- }
-}
-
-RefPtr<BumpArena::Block> BumpArena::Block::create(BumpArena& arena)
-{
- void* allocation = blockAllocator().allocateBlock();
- if (!allocation)
- return nullptr;
- return adoptRef(*new (NotNull, allocation) Block(arena));
-}
-
-#if DEBUG_BUMPARENA
-void BumpArena::Block::dump()
-{
- WTFLogAlways(" %10s %p - %3u, %8lu bytes available\n", m_arena->m_currentBlock == this ? "[current]" : "", this, m_refCount, m_bytesAvailable);
-}
-
-void BumpArena::dump()
-{
- WTFLogAlways("BumpArena{%p}", this);
- WTFLogAlways(" refCount: %u\n", refCount());
- WTFLogAlways(" Blocks (%d)\n", m_liveBlocks.size());
- for (Block* block : m_liveBlocks) {
- if (block == m_currentBlock)
- continue;
- block->dump();
- }
- if (m_currentBlock)
- m_currentBlock->dump();
-}
-#endif
-
-Ref<BumpArena> BumpArena::create()
-{
- return adoptRef(*new BumpArena);
-}
-
-BumpArena::BumpArena()
-{
-#if DEBUG_BUMPARENA
- arenas().add(this);
- static std::once_flag once;
- std::call_once(once, [] {
- int d;
- notify_register_dispatch("com.apple.WebKit.BumpArena.Dump", &d, dispatch_get_main_queue(), ^(int) {
- for (BumpArena* arena : arenas())
- arena->dump();
- });
- });
-#endif
-}
-
-BumpArena::~BumpArena()
-{
-#if DEBUG_BUMPARENA
- arenas().remove(this);
-#endif
-}
-
-void* BumpArena::allocateSlow(size_t size)
-{
- if (size > Block::capacity())
- return fastMalloc(size);
-
- m_currentBlock = Block::create(*this);
- if (!m_currentBlock) {
- m_currentPayloadEnd = nullptr;
- m_currentRemaining = 0;
- return fastMalloc(size);
- }
-
- m_currentPayloadEnd = m_currentBlock->payloadStart() + Block::capacity();
- m_currentRemaining = Block::capacity() - size;
-#if DEBUG_BUMPARENA
- m_currentBlock->m_bytesAvailable = m_currentRemaining;
-#endif
- m_currentBlock->ref();
- return m_currentPayloadEnd - m_currentRemaining - size;
-}
-
-void* BumpArena::allocate(size_t size)
-{
- size = roundUpToMultipleOf<8>(size);
- size_t currentRemaining = m_currentRemaining;
- if (size > currentRemaining)
- return allocateSlow(size);
- currentRemaining -= size;
- m_currentRemaining = currentRemaining;
-#if DEBUG_BUMPARENA
- m_currentBlock->m_bytesAvailable = m_currentRemaining;
-#endif
- m_currentBlock->ref();
- return m_currentPayloadEnd - currentRemaining - size;
-}
-
-void BumpArena::deallocate(void* p)
-{
- if (!p)
- return;
- if (blockAllocator().isAllocation(p))
- Block::blockFor(p).deref();
- else
- fastFree(p);
-}
-
-BumpArena::Block& BumpArena::Block::blockFor(const void* p)
-{
- return *reinterpret_cast<Block*>(reinterpret_cast<uintptr_t>(p) & blockMask);
-}
-
-BumpArena* BumpArena::arenaFor(const void* p)
-{
- ASSERT(p);
- if (!blockAllocator().isAllocation(p))
- return nullptr;
- return &Block::blockFor(p).arena();
-}
-
-void* BumpArena::allocate(BumpArena* arena, size_t size)
-{
- if (arena)
- return arena->allocate(size);
- return fastMalloc(size);
-}
-
-#else // !USE(BUMPARENA) below
-
-class BumpArena::Block {
-public:
- void ref() { }
- void deref() { }
-};
-
-Ref<BumpArena> BumpArena::create()
-{
- return adoptRef(*new BumpArena);
-}
-
-BumpArena::BumpArena()
-{
-}
-
-BumpArena::~BumpArena()
-{
-}
-
-BumpArena* BumpArena::arenaFor(const void*)
-{
- return nullptr;
-}
-
-void* BumpArena::allocate(BumpArena*, size_t size)
-{
- return fastMalloc(size);
-}
-
-void BumpArena::deallocate(void* p)
-{
- fastFree(p);
-}
-
-#endif
-
-} // namespace WTF
Deleted: trunk/Source/WTF/wtf/BumpArena.h (195303 => 195304)
--- trunk/Source/WTF/wtf/BumpArena.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/wtf/BumpArena.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef BumpArena_h
-#define BumpArena_h
-
-#include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-#define DEBUG_BUMPARENA 0
-
-namespace WTF {
-
-class BumpArena : public RefCounted<BumpArena> {
-public:
- WTF_EXPORT_PRIVATE static Ref<BumpArena> create();
- WTF_EXPORT_PRIVATE ~BumpArena();
-
- WTF_EXPORT_PRIVATE static void* allocate(BumpArena*, size_t);
- WTF_EXPORT_PRIVATE static void deallocate(void*);
-
- WTF_EXPORT_PRIVATE static BumpArena* arenaFor(const void*);
-
-private:
- BumpArena();
- void* allocate(size_t);
- void* allocateSlow(size_t);
-
- class Block;
- friend class Block;
- RefPtr<Block> m_currentBlock;
-
- char* m_currentPayloadEnd { nullptr };
- size_t m_currentRemaining { 0 };
-
-#if DEBUG_BUMPARENA
- void dump();
- HashSet<Block*> m_liveBlocks;
-#endif
-};
-
-#define WTF_MAKE_BUMPARENA_ALLOCATED \
-public: \
- void* operator new(size_t, void* p) { return p; } \
- void* operator new[](size_t, void* p) { return p; } \
- \
- void* operator new(size_t size) \
- { \
- return ::WTF::BumpArena::allocate(nullptr, size); \
- } \
- void* operator new(size_t size, BumpArena* arena) \
- { \
- return ::WTF::BumpArena::allocate(arena, size); \
- } \
- void operator delete(void* p) \
- { \
- ::WTF::BumpArena::deallocate(p); \
- } \
- \
- void* operator new[](size_t size) \
- { \
- return ::WTF::BumpArena::allocate(nullptr, size); \
- } \
- \
- void operator delete[](void* p) \
- { \
- ::WTF::BumpArena::deallocate(p); \
- } \
- void* operator new(size_t, NotNullTag, void* location) \
- { \
- ASSERT(location); \
- return location; \
- } \
-private: \
-typedef int __thisIsHereToForceASemicolonAfterThisMacro
-
-} // namespace WTF
-
-using WTF::BumpArena;
-
-#endif
Modified: trunk/Source/WTF/wtf/CMakeLists.txt (195303 => 195304)
--- trunk/Source/WTF/wtf/CMakeLists.txt 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WTF/wtf/CMakeLists.txt 2016-01-19 20:16:01 UTC (rev 195304)
@@ -7,7 +7,6 @@
BitVector.h
Bitmap.h
BubbleSort.h
- BumpArena.h
BumpPointerAllocator.h
ByteOrder.h
CompilationThread.h
@@ -155,7 +154,6 @@
Assertions.cpp
Atomics.cpp
BitVector.cpp
- BumpArena.cpp
CompilationThread.cpp
CryptographicUtilities.cpp
CryptographicallyRandomNumber.cpp
Modified: trunk/Source/WebCore/ChangeLog (195303 => 195304)
--- trunk/Source/WebCore/ChangeLog 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/ChangeLog 2016-01-19 20:16:01 UTC (rev 195304)
@@ -1,3 +1,16 @@
+2016-01-19 Chris Dumez <[email protected]>
+
+ Unreviewed, rolling out r195141.
+
+ Seems to cause crashes on iOS9 64bit
+
+ Reverted changeset:
+
+ "Fragmentation-free allocator for timeless and/or coupled
+ allocations."
+ https://bugs.webkit.org/show_bug.cgi?id=152696
+ http://trac.webkit.org/changeset/195141
+
2015-12-07 Jer Noble <[email protected]>
[EME] Correctly report errors when generating key requests from AVContentKeySession.
Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (195303 => 195304)
--- trunk/Source/WebCore/css/CSSGrammar.y.in 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2016-01-19 20:16:01 UTC (rev 195304)
@@ -403,7 +403,7 @@
WEBKIT_SELECTOR_SYM '{' maybe_space selector_list '}' {
if ($4) {
if (parser->m_selectorListForParseSelector)
- parser->m_selectorListForParseSelector->adoptSelectorVector(parser->arena(), *$4);
+ parser->m_selectorListForParseSelector->adoptSelectorVector(*$4);
parser->recycleSelectorVector(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
}
}
@@ -1353,7 +1353,7 @@
#if ENABLE_VIDEO_TRACK
// used by ::cue(:past/:future)
| ':' ':' CUEFUNCTION maybe_space simple_selector_list maybe_space ')' {
- $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector(parser->arena(), $3, $5);
+ $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector($3, $5);
}
#endif
// use by :-webkit-any.
@@ -1366,7 +1366,7 @@
if ($4) {
auto selector = std::make_unique<CSSParserSelector>();
selector->setMatch(CSSSelector::PseudoClass);
- selector->adoptSelectorVector(parser->arena(), *std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
+ selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
selector->setPseudoClassValue($2);
if (selector->pseudoClassType() == CSSSelector::PseudoClassAny)
$$ = selector.release();
@@ -1377,7 +1377,7 @@
if ($4) {
auto selector = std::make_unique<CSSParserSelector>();
selector->setMatch(CSSSelector::PseudoClass);
- selector->adoptSelectorVector(parser->arena(), *std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
+ selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
selector->setPseudoClassValue($2);
if (selector->pseudoClassType() == CSSSelector::PseudoClassMatches)
$$ = selector.release();
@@ -1427,7 +1427,7 @@
selector->setArgument($4);
selector->setPseudoClassValue($2);
if (ending)
- selector->adoptSelectorVector(parser->arena(), *ending);
+ selector->adoptSelectorVector(*ending);
CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
$$ = selector.release();
@@ -1442,7 +1442,7 @@
selector->setArgument(AtomicString::number($4 * $5));
selector->setPseudoClassValue($2);
if (ending)
- selector->adoptSelectorVector(parser->arena(), *ending);
+ selector->adoptSelectorVector(*ending);
CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
$$ = selector.release();
@@ -1457,7 +1457,7 @@
selector->setArgument($4);
selector->setPseudoClassValue($2);
if (ending)
- selector->adoptSelectorVector(parser->arena(), *ending);
+ selector->adoptSelectorVector(*ending);
CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
$$ = selector.release();
@@ -1511,7 +1511,7 @@
auto selector = std::make_unique<CSSParserSelector>();
selector->setMatch(CSSSelector::PseudoClass);
selector->setPseudoClassValue($2);
- selector->adoptSelectorVector(parser->arena(), *list);
+ selector->adoptSelectorVector(*list);
if (selector->pseudoClassType() == CSSSelector::PseudoClassNot)
$$ = selector.release();
}
Modified: trunk/Source/WebCore/css/CSSKeyframesRule.h (195303 => 195304)
--- trunk/Source/WebCore/css/CSSKeyframesRule.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -40,7 +40,7 @@
class StyleRuleKeyframes : public StyleRuleBase {
public:
- static Ref<StyleRuleKeyframes> create(BumpArena* arena) { return adoptRef(*new (arena) StyleRuleKeyframes); }
+ static Ref<StyleRuleKeyframes> create() { return adoptRef(*new StyleRuleKeyframes()); }
~StyleRuleKeyframes();
Modified: trunk/Source/WebCore/css/CSSParser.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/CSSParser.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -1644,7 +1644,7 @@
if (unusedEntries)
results.remove(0, unusedEntries);
- return ImmutableStyleProperties::create(arena(), results.data(), results.size(), m_context.mode);
+ return ImmutableStyleProperties::create(results.data(), results.size(), m_context.mode);
}
void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
@@ -12701,9 +12701,9 @@
if (!media) {
// To comply with w3c test suite expectation, create an empty media query
// even when it is syntactically incorrect.
- rule = StyleRuleMedia::create(arena(), MediaQuerySet::create(), emptyRules);
+ rule = StyleRuleMedia::create(MediaQuerySet::create(), emptyRules);
} else
- rule = StyleRuleMedia::create(arena(), media, rules ? *rules : emptyRules);
+ rule = StyleRuleMedia::create(media, rules ? *rules : emptyRules);
processAndAddNewRuleToSourceTreeIfNeeded();
return rule;
}
@@ -12729,10 +12729,10 @@
conditionText = String(m_dataStart16.get() + conditionOffset, conditionLength).stripWhiteSpace();
if (rules)
- rule = StyleRuleSupports::create(arena(), conditionText, conditionIsSupported, *rules);
+ rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *rules);
else {
RuleList emptyRules;
- rule = StyleRuleSupports::create(arena(), conditionText, conditionIsSupported, emptyRules);
+ rule = StyleRuleSupports::create(conditionText, conditionIsSupported, emptyRules);
}
processAndAddNewRuleToSourceTreeIfNeeded();
@@ -12841,7 +12841,7 @@
{
std::unique_ptr<Vector<RefPtr<StyleKeyframe>>> keyframes = WTFMove(popKeyframes);
m_allowImportRules = m_allowNamespaceDeclarations = false;
- RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(arena());
+ RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create();
for (size_t i = 0; i < keyframes->size(); ++i)
rule->parserAppendKeyframe(keyframes->at(i));
rule->setName(name);
@@ -12849,24 +12849,14 @@
return rule;
}
-void CSSParser::setArena(BumpArena& arena)
-{
- m_arena = &arena;
-}
-
-BumpArena* CSSParser::arena()
-{
- return m_arena.get();
-}
-
RefPtr<StyleRuleBase> CSSParser::createStyleRule(Vector<std::unique_ptr<CSSParserSelector>>* selectors)
{
RefPtr<StyleRule> rule;
if (selectors) {
m_allowImportRules = false;
m_allowNamespaceDeclarations = false;
- rule = StyleRule::create(arena(), m_lastSelectorLineNumber, createStyleProperties());
- rule->parserAdoptSelectorVector(arena(), *selectors);
+ rule = StyleRule::create(m_lastSelectorLineNumber, createStyleProperties());
+ rule->parserAdoptSelectorVector(*selectors);
processAndAddNewRuleToSourceTreeIfNeeded();
} else
popRuleData();
@@ -12889,7 +12879,7 @@
return nullptr;
}
}
- RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(arena(), createStyleProperties());
+ RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(createStyleProperties());
clearProperties();
processAndAddNewRuleToSourceTreeIfNeeded();
return rule;
@@ -12973,10 +12963,10 @@
m_allowImportRules = m_allowNamespaceDeclarations = false;
RefPtr<StyleRulePage> rule;
if (pageSelector) {
- rule = StyleRulePage::create(arena(), createStyleProperties());
+ rule = StyleRulePage::create(createStyleProperties());
Vector<std::unique_ptr<CSSParserSelector>> selectorVector;
selectorVector.append(WTFMove(pageSelector));
- rule->parserAdoptSelectorVector(arena(), selectorVector);
+ rule->parserAdoptSelectorVector(selectorVector);
processAndAddNewRuleToSourceTreeIfNeeded();
} else
popRuleData();
@@ -13008,7 +12998,7 @@
m_allowImportRules = m_allowNamespaceDeclarations = false;
- RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(arena(), regionSelector, *rules);
+ RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector, *rules);
if (isExtractingSourceData())
addNewRuleToSourceTree(CSSRuleSourceData::createUnknown());
@@ -13282,7 +13272,7 @@
{
m_allowImportRules = m_allowNamespaceDeclarations = false;
- RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(arena(), createStyleProperties());
+ RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(createStyleProperties());
clearProperties();
processAndAddNewRuleToSourceTreeIfNeeded();
Modified: trunk/Source/WebCore/css/CSSParser.h (195303 => 195304)
--- trunk/Source/WebCore/css/CSSParser.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSParser.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -36,7 +36,6 @@
#include "SourceSizeList.h"
#include "WebKitCSSFilterValue.h"
#include <memory>
-#include <wtf/BumpArena.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
@@ -115,8 +114,6 @@
WEBCORE_EXPORT CSSParser(const CSSParserContext&);
WEBCORE_EXPORT ~CSSParser();
- void setArena(BumpArena&);
-
void parseSheet(StyleSheetContents*, const String&, const TextPosition&, RuleSourceDataList*, bool logErrors);
RefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&);
RefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const String&);
@@ -400,8 +397,6 @@
CSSParserContext m_context;
- BumpArena* arena();
- RefPtr<BumpArena> m_arena;
bool m_important;
CSSPropertyID m_id;
AtomicString m_customPropertyName;
Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/CSSParserValues.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -214,7 +214,7 @@
}
#if ENABLE(VIDEO_TRACK)
-CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(BumpArena* arena, const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)
+CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)
{
ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "cue(");
@@ -226,7 +226,7 @@
auto selector = std::make_unique<CSSParserSelector>();
selector->m_selector->setMatch(CSSSelector::PseudoElement);
selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementCue);
- selector->adoptSelectorVector(arena, *selectorVector);
+ selector->adoptSelectorVector(*selectorVector);
return selector.release();
}
#endif
@@ -279,10 +279,10 @@
}
}
-void CSSParserSelector::adoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
+void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
{
auto selectorList = std::make_unique<CSSSelectorList>();
- selectorList->adoptSelectorVector(arena, selectorVector);
+ selectorList->adoptSelectorVector(selectorVector);
m_selector->setSelectorList(WTFMove(selectorList));
}
Modified: trunk/Source/WebCore/css/CSSParserValues.h (195303 => 195304)
--- trunk/Source/WebCore/css/CSSParserValues.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSParserValues.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -24,7 +24,6 @@
#include "CSSSelector.h"
#include "CSSValueKeywords.h"
#include "CSSValueList.h"
-#include <wtf/BumpArena.h>
#include <wtf/text/AtomicString.h>
#include <wtf/text/AtomicStringHash.h>
#include <wtf/text/WTFString.h>
@@ -212,7 +211,7 @@
public:
static CSSParserSelector* parsePagePseudoSelector(const CSSParserString& pseudoTypeString);
static CSSParserSelector* parsePseudoElementSelector(CSSParserString& pseudoTypeString);
- static CSSParserSelector* parsePseudoElementCueFunctionSelector(BumpArena*, const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
+ static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString);
CSSParserSelector();
@@ -229,7 +228,7 @@
void setRelation(CSSSelector::Relation value) { m_selector->setRelation(value); }
void setForPage() { m_selector->setForPage(); }
- void adoptSelectorVector(BumpArena*, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
+ void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
void setLangArgumentList(const Vector<CSSParserString>& stringVector);
void setPseudoClassValue(const CSSParserString& pseudoClassString);
Modified: trunk/Source/WebCore/css/CSSSelectorList.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/CSSSelectorList.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSSelectorList.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -37,7 +37,7 @@
unsigned otherComponentCount = other.componentCount();
ASSERT_WITH_SECURITY_IMPLICATION(otherComponentCount);
- m_selectorArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(BumpArena::arenaFor(other.m_selectorArray), sizeof(CSSSelector) * otherComponentCount));
+ m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * otherComponentCount));
for (unsigned i = 0; i < otherComponentCount; ++i)
new (NotNull, &m_selectorArray[i]) CSSSelector(other.m_selectorArray[i]);
}
@@ -49,7 +49,7 @@
other.m_selectorArray = nullptr;
}
-void CSSSelectorList::adoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
+void CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
{
ASSERT_WITH_SECURITY_IMPLICATION(!selectorVector.isEmpty());
@@ -60,7 +60,7 @@
++flattenedSize;
}
ASSERT(flattenedSize);
- m_selectorArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(arena, sizeof(CSSSelector) * flattenedSize));
+ m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * flattenedSize));
size_t arrayIndex = 0;
for (size_t i = 0; i < selectorVector.size(); ++i) {
CSSParserSelector* current = selectorVector[i].get();
@@ -119,7 +119,7 @@
isLastSelector = s->isLastInSelectorList();
s->~CSSSelector();
}
- BumpArena::deallocate(selectorArray);
+ fastFree(selectorArray);
}
String CSSSelectorList::selectorsText() const
Modified: trunk/Source/WebCore/css/CSSSelectorList.h (195303 => 195304)
--- trunk/Source/WebCore/css/CSSSelectorList.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/CSSSelectorList.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -28,7 +28,6 @@
#include "CSSSelector.h"
#include <memory>
-#include <wtf/BumpArena.h>
namespace WebCore {
@@ -43,7 +42,7 @@
~CSSSelectorList() { deleteSelectors(); }
- void adoptSelectorVector(BumpArena*, Vector<std::unique_ptr<CSSParserSelector>>&);
+ void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
void adoptSelectorArray(CSSSelector* selectors) { ASSERT(!m_selectorArray); m_selectorArray = selectors; }
bool isValid() const { return !!m_selectorArray; }
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -55,9 +55,9 @@
return value.length() == 7 && (value == "initial" || value == "inherit");
}
-Ref<ImmutableStyleProperties> ImmutableStyleProperties::create(BumpArena* arena, const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
+Ref<ImmutableStyleProperties> ImmutableStyleProperties::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
{
- void* slot = BumpArena::allocate(arena, sizeForImmutableStylePropertiesWithPropertyCount(count));
+ void* slot = WTF::fastMalloc(sizeForImmutableStylePropertiesWithPropertyCount(count));
return adoptRef(*new (NotNull, slot) ImmutableStyleProperties(properties, count, cssParserMode));
}
@@ -66,7 +66,7 @@
if (is<ImmutableStyleProperties>(*this))
return downcast<ImmutableStyleProperties>(const_cast<StyleProperties&>(*this));
const MutableStyleProperties& mutableThis = downcast<MutableStyleProperties>(*this);
- return ImmutableStyleProperties::create(BumpArena::arenaFor(this), mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());
+ return ImmutableStyleProperties::create(mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());
}
MutableStyleProperties::MutableStyleProperties(CSSParserMode cssParserMode)
Modified: trunk/Source/WebCore/css/StyleProperties.h (195303 => 195304)
--- trunk/Source/WebCore/css/StyleProperties.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleProperties.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -29,7 +29,6 @@
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include <memory>
-#include <wtf/BumpArena.h>
#include <wtf/ListHashSet.h>
#include <wtf/TypeCasts.h>
#include <wtf/Vector.h>
@@ -47,8 +46,7 @@
class StylePropertyShorthand;
class StyleSheetContents;
-class StyleProperties : public WTF::RefCountedBase {
- WTF_MAKE_BUMPARENA_ALLOCATED;
+class StyleProperties : public RefCounted<StyleProperties> {
friend class PropertyReference;
public:
// Override RefCounted's deref() to ensure operator delete is called on
@@ -163,7 +161,7 @@
class ImmutableStyleProperties : public StyleProperties {
public:
WEBCORE_EXPORT ~ImmutableStyleProperties();
- static Ref<ImmutableStyleProperties> create(BumpArena*, const CSSProperty* properties, unsigned count, CSSParserMode);
+ static Ref<ImmutableStyleProperties> create(const CSSProperty* properties, unsigned count, CSSParserMode);
unsigned propertyCount() const { return m_arraySize; }
bool isEmpty() const { return !propertyCount(); }
Modified: trunk/Source/WebCore/css/StyleRule.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/StyleRule.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleRule.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -219,14 +219,14 @@
return downcast<MutableStyleProperties>(m_properties.get());
}
-Ref<StyleRule> StyleRule::create(BumpArena* arena, int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties)
+Ref<StyleRule> StyleRule::create(int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties)
{
ASSERT_WITH_SECURITY_IMPLICATION(!selectors.isEmpty());
- CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(arena, sizeof(CSSSelector) * selectors.size()));
+ CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * selectors.size()));
for (unsigned i = 0; i < selectors.size(); ++i)
new (NotNull, &selectorListArray[i]) CSSSelector(*selectors.at(i));
selectorListArray[selectors.size() - 1].setLastInSelectorList();
- auto rule = StyleRule::create(arena, sourceLine, WTFMove(properties));
+ auto rule = StyleRule::create(sourceLine, WTFMove(properties));
rule.get().parserAdoptSelectorArray(selectorListArray);
return rule;
}
@@ -244,7 +244,7 @@
componentsInThisSelector.append(component);
if (componentsInThisSelector.size() + componentsSinceLastSplit.size() > maxCount && !componentsSinceLastSplit.isEmpty()) {
- rules.append(create(BumpArena::arenaFor(this), sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
+ rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
componentsSinceLastSplit.clear();
}
@@ -252,7 +252,7 @@
}
if (!componentsSinceLastSplit.isEmpty())
- rules.append(create(BumpArena::arenaFor(this), sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
+ rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
return rules;
}
@@ -360,7 +360,7 @@
StyleRuleRegion::StyleRuleRegion(Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)
: StyleRuleGroup(Region, adoptRules)
{
- m_selectorList.adoptSelectorVector(BumpArena::arenaFor(this), *selectors);
+ m_selectorList.adoptSelectorVector(*selectors);
}
StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
Modified: trunk/Source/WebCore/css/StyleRule.h (195303 => 195304)
--- trunk/Source/WebCore/css/StyleRule.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleRule.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -25,7 +25,6 @@
#include "CSSSelectorList.h"
#include "MediaList.h"
#include "StyleProperties.h"
-#include <wtf/BumpArena.h>
#include <wtf/RefPtr.h>
#include <wtf/TypeCasts.h>
@@ -38,7 +37,7 @@
class StyleProperties;
class StyleRuleBase : public WTF::RefCountedBase {
- WTF_MAKE_BUMPARENA_ALLOCATED;
+ WTF_MAKE_FAST_ALLOCATED;
public:
enum Type {
Unknown, // Not used.
@@ -102,10 +101,11 @@
};
class StyleRule : public StyleRuleBase {
+ WTF_MAKE_FAST_ALLOCATED;
public:
- static Ref<StyleRule> create(BumpArena* arena, int sourceLine, Ref<StyleProperties>&& properties)
+ static Ref<StyleRule> create(int sourceLine, Ref<StyleProperties>&& properties)
{
- return adoptRef(*new (arena) StyleRule(sourceLine, WTFMove(properties)));
+ return adoptRef(*new StyleRule(sourceLine, WTFMove(properties)));
}
~StyleRule();
@@ -114,7 +114,7 @@
const StyleProperties& properties() const { return m_properties; }
MutableStyleProperties& mutableProperties();
- void parserAdoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena, selectors); }
+ void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); }
void parserAdoptSelectorArray(CSSSelector* selectors) { m_selectorList.adoptSelectorArray(selectors); }
@@ -128,7 +128,7 @@
StyleRule(int sourceLine, Ref<StyleProperties>&&);
StyleRule(const StyleRule&);
- static Ref<StyleRule> create(BumpArena*, int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);
+ static Ref<StyleRule> create(int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);
Ref<StyleProperties> m_properties;
CSSSelectorList m_selectorList;
@@ -136,7 +136,7 @@
class StyleRuleFontFace : public StyleRuleBase {
public:
- static Ref<StyleRuleFontFace> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRuleFontFace(WTFMove(properties))); }
+ static Ref<StyleRuleFontFace> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleFontFace(WTFMove(properties))); }
~StyleRuleFontFace();
@@ -155,7 +155,7 @@
class StyleRulePage : public StyleRuleBase {
public:
- static Ref<StyleRulePage> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRulePage(WTFMove(properties))); }
+ static Ref<StyleRulePage> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRulePage(WTFMove(properties))); }
~StyleRulePage();
@@ -163,7 +163,7 @@
const StyleProperties& properties() const { return m_properties; }
MutableStyleProperties& mutableProperties();
- void parserAdoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena, selectors); }
+ void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); }
Ref<StyleRulePage> copy() const { return adoptRef(*new StyleRulePage(*this)); }
@@ -193,9 +193,9 @@
class StyleRuleMedia : public StyleRuleGroup {
public:
- static Ref<StyleRuleMedia> create(BumpArena* arena, PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
+ static Ref<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
{
- return adoptRef(*new (arena) StyleRuleMedia(media, adoptRules));
+ return adoptRef(*new StyleRuleMedia(media, adoptRules));
}
MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); }
@@ -211,9 +211,9 @@
class StyleRuleSupports : public StyleRuleGroup {
public:
- static Ref<StyleRuleSupports> create(BumpArena* arena, const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules)
+ static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules)
{
- return adoptRef(*new (arena) StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));
+ return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));
}
String conditionText() const { return m_conditionText; }
@@ -230,9 +230,9 @@
class StyleRuleRegion : public StyleRuleGroup {
public:
- static Ref<StyleRuleRegion> create(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)
+ static Ref<StyleRuleRegion> create(Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)
{
- return adoptRef(*new (arena) StyleRuleRegion(selectors, adoptRules));
+ return adoptRef(*new StyleRuleRegion(selectors, adoptRules));
}
const CSSSelectorList& selectorList() const { return m_selectorList; }
@@ -249,7 +249,7 @@
#if ENABLE(CSS_DEVICE_ADAPTATION)
class StyleRuleViewport : public StyleRuleBase {
public:
- static Ref<StyleRuleViewport> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRuleViewport(WTFMove(properties))); }
+ static Ref<StyleRuleViewport> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleViewport(WTFMove(properties))); }
~StyleRuleViewport();
Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (195303 => 195304)
--- trunk/Source/WebCore/css/StyleSheetContents.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -71,7 +71,6 @@
, m_isMutable(false)
, m_isInMemoryCache(false)
, m_parserContext(context)
- , m_arena(BumpArena::create())
{
}
@@ -92,7 +91,6 @@
, m_isMutable(false)
, m_isInMemoryCache(false)
, m_parserContext(o.m_parserContext)
- , m_arena(BumpArena::create())
{
ASSERT(o.isCacheable());
@@ -315,7 +313,6 @@
}
CSSParser p(parserContext());
- p.setArena(m_arena.get());
p.parseSheet(this, sheetText, TextPosition(), nullptr, true);
if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
@@ -337,7 +334,6 @@
bool StyleSheetContents::parseStringAtPosition(const String& sheetText, const TextPosition& textPosition, bool createdByParser)
{
CSSParser p(parserContext());
- p.setArena(m_arena.get());
p.parseSheet(this, sheetText, textPosition, nullptr, createdByParser);
return true;
}
Modified: trunk/Source/WebCore/css/StyleSheetContents.h (195303 => 195304)
--- trunk/Source/WebCore/css/StyleSheetContents.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/css/StyleSheetContents.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -24,7 +24,6 @@
#include "CSSParserMode.h"
#include "CachePolicy.h"
#include "URL.h"
-#include <wtf/BumpArena.h>
#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/RefCounted.h>
@@ -174,8 +173,6 @@
CSSParserContext m_parserContext;
Vector<CSSStyleSheet*> m_clients;
-
- Ref<BumpArena> m_arena;
};
} // namespace
Modified: trunk/Source/WebCore/dom/SelectorQuery.cpp (195303 => 195304)
--- trunk/Source/WebCore/dom/SelectorQuery.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/dom/SelectorQuery.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -608,11 +608,6 @@
{
}
-SelectorQueryCache::SelectorQueryCache()
- : m_arena(BumpArena::create())
-{
-}
-
SelectorQuery* SelectorQueryCache::add(const String& selectors, Document& document, ExceptionCode& ec)
{
auto it = m_entries.find(selectors);
@@ -620,7 +615,6 @@
return it->value.get();
CSSParser parser(document);
- parser.setArena(m_arena.get());
CSSSelectorList selectorList;
parser.parseSelector(selectors, selectorList);
Modified: trunk/Source/WebCore/dom/SelectorQuery.h (195303 => 195304)
--- trunk/Source/WebCore/dom/SelectorQuery.h 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/dom/SelectorQuery.h 2016-01-19 20:16:01 UTC (rev 195304)
@@ -29,7 +29,6 @@
#include "CSSSelectorList.h"
#include "NodeList.h"
#include "SelectorCompiler.h"
-#include <wtf/BumpArena.h>
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
#include <wtf/text/AtomicStringHash.h>
@@ -133,12 +132,10 @@
WTF_MAKE_FAST_ALLOCATED;
public:
- SelectorQueryCache();
SelectorQuery* add(const String&, Document&, ExceptionCode&);
private:
HashMap<String, std::unique_ptr<SelectorQuery>> m_entries;
- Ref<BumpArena> m_arena;
};
inline bool SelectorQuery::matches(Element& element) const
Modified: trunk/Source/WebCore/svg/SVGFontFaceElement.cpp (195303 => 195304)
--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp 2016-01-19 19:53:16 UTC (rev 195303)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp 2016-01-19 20:16:01 UTC (rev 195304)
@@ -49,7 +49,7 @@
inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document)
- , m_fontFaceRule(StyleRuleFontFace::create(nullptr, MutableStyleProperties::create(CSSStrictMode)))
+ , m_fontFaceRule(StyleRuleFontFace::create(MutableStyleProperties::create(CSSStrictMode)))
, m_fontElement(nullptr)
{
ASSERT(hasTagName(font_faceTag));