From f39a71a6c44e5011a169dfa6840a33a9b5075c77 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 30 Mar 2010 15:33:13 +0200 Subject: Autotest: don't allow choosing between debug/release mode. You can't build for debug mode on Windows if Qt wasn't built in debug mode. So force the selection to be exactly what Qt was built. Reviewed-by: Trust Me --- tests/auto/qsharedpointer/externaltests.cpp | 17 +++-------------- tests/auto/qsharedpointer/externaltests.h | 3 --- tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp index eb2f27d..0b1ef19 100644 --- a/tests/auto/qsharedpointer/externaltests.cpp +++ b/tests/auto/qsharedpointer/externaltests.cpp @@ -140,7 +140,6 @@ namespace QTest { QExternalTestPrivate() : qtModules(QExternalTest::QtCore | QExternalTest::QtGui | QExternalTest::QtTest), appType(QExternalTest::AutoApplication), - debugMode(true), exitCode(-1) { } @@ -156,7 +155,6 @@ namespace QTest { QByteArray programHeader; QExternalTest::QtModules qtModules; QExternalTest::ApplicationType appType; - bool debugMode; QString temporaryDir; QByteArray sourceCode; @@ -190,16 +188,6 @@ namespace QTest { delete d; } - bool QExternalTest::isDebugMode() const - { - return d->debugMode; - } - - void QExternalTest::setDebugMode(bool enable) - { - d->debugMode = enable; - } - QList QExternalTest::qmakeSettings() const { return d->qmakeLines; @@ -524,10 +512,11 @@ namespace QTest { "INCLUDEPATH += . "); projectFile.write(QFile::encodeName(QDir::currentPath())); - if (debugMode) +#ifndef QT_NO_DEBUG projectFile.write("\nCONFIG += debug\n"); - else +#else projectFile.write("\nCONFIG += release\n"); +#endif QByteArray extraSources = QFile::encodeName(extraProgramSources.join(" ")); if (!extraSources.isEmpty()) { diff --git a/tests/auto/qsharedpointer/externaltests.h b/tests/auto/qsharedpointer/externaltests.h index 5e79a7d..1170cd5 100644 --- a/tests/auto/qsharedpointer/externaltests.h +++ b/tests/auto/qsharedpointer/externaltests.h @@ -91,9 +91,6 @@ namespace QTest { QApplicationGuiServer }; - bool isDebugMode() const; - void setDebugMode(bool enable); - QList qmakeSettings() const; void setQmakeSettings(const QList &settings); diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index 7cfa868..cb32c9a 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -1717,11 +1717,11 @@ void tst_QSharedPointer::invalidConstructs() #endif QTest::QExternalTest test; - test.setDebugMode(true); test.setQtModules(QTest::QExternalTest::QtCore); test.setExtraProgramSources(QStringList() << SRCDIR "forwarddeclared.cpp"); test.setProgramHeader( "#define QT_SHAREDPOINTER_TRACK_POINTERS\n" + "#define QT_DEBUG\n" "#include \n" "#include \n" "\n" -- cgit v0.12 From c626bf34e14ea05c986053c0f87e02f4b0bd8cdd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Mar 2010 20:37:20 +0200 Subject: no need for CONFIG += ordered here --- tools/linguist/linguist.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/linguist/linguist.pro b/tools/linguist/linguist.pro index e1c8a63..85ecd5a 100644 --- a/tools/linguist/linguist.pro +++ b/tools/linguist/linguist.pro @@ -4,5 +4,3 @@ SUBDIRS = \ lrelease \ lupdate \ lconvert -CONFIG += ordered - -- cgit v0.12 From 5f8bf77862a425c39a683358aafa4d52db1b8ac3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Mar 2010 21:04:51 +0200 Subject: speed up by removing nonsense why first determine how to make no newline just to make a newline right afterwards? --- configure | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/configure b/configure index 9a3ee32..de72c46 100755 --- a/configure +++ b/configure @@ -7780,12 +7780,7 @@ for file in .projects .projects.3; do QMAKE="$outpath/bin/qmake" QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS" if [ "$file" = ".projects.3" ]; then - if echo '\c' | grep '\c' >/dev/null; then - echo -n " (fast)" - else - echo " (fast)\c" - fi - echo + echo " (fast)" cat >"${OUTDIR}/Makefile" < Date: Mon, 29 Mar 2010 21:08:58 +0200 Subject: do not detect the echo-without-newline syntax over and over this is a) more maintainable and b) faster, as it was done in the makefile generation loop as well. --- configure | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/configure b/configure index de72c46..0cf7542 100755 --- a/configure +++ b/configure @@ -173,6 +173,12 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +# detect the "echo without newline" style. usage: echo $ECHO_N "$ECHO_C" +if echo '\c' | grep '\c' >/dev/null; then + ECHO_N=-n +else + ECHO_C='\c' +fi #------------------------------------------------------------------------------- # window system detection @@ -399,11 +405,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then else if [ -z "$LicenseKeyExt" ]; then echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Please enter your license key: " - else - echo "Please enter your license key: \c" - fi + echo $ECHO_N "Please enter your license key: $ECHO_C" read LicenseKeyExt Licensee="Unknown user" fi @@ -3966,11 +3968,7 @@ elif [ "$Edition" = "OpenSource" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of $affix license? " - else - echo "Do you accept the terms of $affix license? \c" - fi + echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C" read acceptance fi echo @@ -4001,11 +3999,7 @@ elif [ "$Edition" = "Preview" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of the license? " - else - echo "Do you accept the terms of the license? \c" - fi + echo $ECHO_N "Do you accept the terms of the license? $ECHO_C" read acceptance fi echo @@ -4091,11 +4085,7 @@ elif [ "$Edition" != "OpenSource" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of the $TheLicense? " - else - echo "Do you accept the terms of the $TheLicense? \c" - fi + echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C" read acceptance fi echo @@ -7390,11 +7380,7 @@ else fi if [ "$OPT_VERBOSE" = "yes" ]; then - if echo '\c' | grep '\c' >/dev/null; then - echo -n "qmake vars .......... " - else - echo "qmake vars .......... \c" - fi + echo $ECHO_N "qmake vars .......... $ECHO_C" cat "$QMAKE_VARS_FILE" | tr '\n' ' ' echo "qmake switches ...... $QMAKE_SWITCHES" fi @@ -7771,11 +7757,7 @@ for file in .projects .projects.3; do continue; fi QMAKE_SPEC_ARGS="-spec $SPEC" - if echo '\c' | grep '\c' >/dev/null; then - echo -n " for $a" - else - echo " for $a\c" - fi + echo $ECHO_N " for $a$ECHO_C" QMAKE="$outpath/bin/qmake" QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS" -- cgit v0.12 From dbbd84e61bf433495268c639670f9b9f82eb56f4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 30 Mar 2010 16:15:21 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( ecfa4583e573ce4dff1f0df12f6bdba3022376e5 ) Changes in WebKit/qt since the last update: * r56370 - https://bugs.webkit.org/show_bug.cgi?id=34350 -- [Symbian] More efficient aligned memory allocation for JSC Collector --- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 28 +++++ .../webkit/JavaScriptCore/JavaScriptCore.pri | 6 + .../webkit/JavaScriptCore/runtime/Collector.cpp | 47 ++------ .../webkit/JavaScriptCore/runtime/Collector.h | 9 ++ .../wtf/symbian/BlockAllocatorSymbian.cpp | 132 +++++++++++++++++++++ .../wtf/symbian/BlockAllocatorSymbian.h | 120 +++++++++++++++++++ src/3rdparty/webkit/VERSION | 2 +- 7 files changed, 305 insertions(+), 39 deletions(-) create mode 100644 src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp create mode 100644 src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 6446773..8932b3b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,31 @@ +2010-03-22 Siddharth Mathur + + Reviewed by Laszlo Gombos. + + [Symbian] More efficient aligned memory allocation for JSC Collector + https://bugs.webkit.org/show_bug.cgi?id=34350 + + * JavaScriptCore.pri: Added 2 new Symbian source files and HAL linkage + + * runtime/Collector.cpp: Reduced port-specific code and added private data member + (JSC::Heap::Heap): + (JSC::Heap::~Heap): + (JSC::Heap::destroy): + (JSC::Heap::allocateBlock): + (JSC::Heap::freeBlockPtr): + + * runtime/Collector.h: Added private data member + + * wtf/symbian: Added. + * wtf/symbian/BlockAllocatorSymbian.cpp: Added. + (WTF::AlignedBlockAllocator::AlignedBlockAllocator): Helper class to allocate + aligned blocks more efficiently as required by Collector + (WTF::AlignedBlockAllocator::alloc): + (WTF::AlignedBlockAllocator::free): + (WTF::AlignedBlockAllocator::destroy): + (WTF::AlignedBlockAllocator::~AlignedBlockAllocator): + * wtf/symbian/BlockAllocatorSymbian.h: Added. + 2010-02-09 Janne Koskinen Reviewed by Laszlo Gombos. diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri index bb531e5..a0f9f8e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri @@ -9,6 +9,10 @@ CONFIG(debug, debug|release) { OBJECTS_DIR = obj/release } +symbian { + LIBS += -lhal +} + INCLUDEPATH = \ $$PWD \ $$PWD/.. \ @@ -23,6 +27,7 @@ INCLUDEPATH = \ $$PWD/runtime \ $$PWD/wrec \ $$PWD/wtf \ + $$PWD/wtf/symbian \ $$PWD/wtf/unicode \ $$PWD/yarr \ $$PWD/API \ @@ -243,6 +248,7 @@ SOURCES += \ profiler/TreeProfile.cpp \ wtf/DateMath.cpp \ wtf/FastMalloc.cpp \ + wtf/symbian/BlockAllocatorSymbian.cpp \ wtf/Threading.cpp \ wtf/qt/MainThreadQt.cpp diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp index 8b647a0..6626182 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp @@ -52,11 +52,6 @@ #include #include -#elif PLATFORM(SYMBIAN) -#include -#include -#include - #elif PLATFORM(WIN_OS) #include @@ -124,11 +119,6 @@ const size_t ALLOCATIONS_PER_COLLECTION = 4000; // a PIC branch in Mach-O binaries, see . #define MIN_ARRAY_SIZE (static_cast(14)) -#if PLATFORM(SYMBIAN) -const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB -static RHeap* userChunk = 0; -#endif - #if ENABLE(JSC_MULTIPLE_THREADS) #if PLATFORM(DARWIN) @@ -165,29 +155,11 @@ Heap::Heap(JSGlobalData* globalData) , m_currentThreadRegistrar(0) #endif , m_globalData(globalData) +#if PLATFORM(SYMBIAN) + , m_blockallocator(JSCCOLLECTOR_VIRTUALMEM_RESERVATION, BLOCK_SIZE) +#endif { ASSERT(globalData); - -#if PLATFORM(SYMBIAN) - // Symbian OpenC supports mmap but currently not the MAP_ANON flag. - // Using fastMalloc() does not properly align blocks on 64k boundaries - // and previous implementation was flawed/incomplete. - // UserHeap::ChunkHeap allows allocation of continuous memory and specification - // of alignment value for (symbian) cells within that heap. - // - // Clarification and mapping of terminology: - // RHeap (created by UserHeap::ChunkHeap below) is continuos memory chunk, - // which can dynamically grow up to 8 MB, - // that holds all CollectorBlocks of this session (static). - // Each symbian cell within RHeap maps to a 64kb aligned CollectorBlock. - // JSCell objects are maintained as usual within CollectorBlocks. - if (!userChunk) { - userChunk = UserHeap::ChunkHeap(0, 0, MAX_NUM_BLOCKS * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE); - if (!userChunk) - CRASH(); - } -#endif // PLATFORM(SYMBIAN) - memset(&primaryHeap, 0, sizeof(CollectorHeap)); memset(&numberHeap, 0, sizeof(CollectorHeap)); } @@ -233,7 +205,9 @@ void Heap::destroy() t = next; } #endif - +#if PLATFORM(SYMBIAN) + m_blockallocator.destroy(); +#endif m_globalData = 0; } @@ -247,12 +221,9 @@ NEVER_INLINE CollectorBlock* Heap::allocateBlock() // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: . vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); #elif PLATFORM(SYMBIAN) - // Allocate a 64 kb aligned CollectorBlock - unsigned char* mask = reinterpret_cast(userChunk->Alloc(BLOCK_SIZE)); - if (!mask) + void* address = m_blockallocator.alloc(); + if (!address) CRASH(); - uintptr_t address = reinterpret_cast(mask); - memset(reinterpret_cast(address), 0, BLOCK_SIZE); #elif PLATFORM(WINCE) void* address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); @@ -339,7 +310,7 @@ NEVER_INLINE void Heap::freeBlock(CollectorBlock* block) #if PLATFORM(DARWIN) && !PLATFORM(QT) vm_deallocate(current_task(), reinterpret_cast(block), BLOCK_SIZE); #elif PLATFORM(SYMBIAN) - userChunk->Free(reinterpret_cast(block)); + m_blockallocator.free(reinterpret_cast(block)); #elif PLATFORM(WINCE) VirtualFree(block, 0, MEM_RELEASE); #elif PLATFORM(WIN_OS) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h index 9ca9d18..086e519 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h @@ -35,6 +35,10 @@ #include #endif +#if PLATFORM(SYMBIAN) +#include +#endif + #define ASSERT_CLASS_FITS_IN_CELL(class) COMPILE_ASSERT(sizeof(class) <= CELL_SIZE, class_fits_in_cell) namespace JSC { @@ -157,6 +161,11 @@ namespace JSC { pthread_key_t m_currentThreadRegistrar; #endif +#if PLATFORM(SYMBIAN) + // Allocates collector blocks with correct alignment + WTF::AlignedBlockAllocator m_blockallocator; +#endif + JSGlobalData* m_globalData; }; diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp new file mode 100644 index 0000000..cc8fd15 --- /dev/null +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 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" + +#if PLATFORM(SYMBIAN) + +#include "BlockAllocatorSymbian.h" + + +namespace WTF { + +/** Efficiently allocates blocks of size blockSize with blockSize alignment. + * Primarly designed for JSC Collector's needs. + * Not thread-safe. + */ +AlignedBlockAllocator::AlignedBlockAllocator(TUint32 reservationSize, TUint32 blockSize ) + : m_reservation(reservationSize), + m_blockSize(blockSize) +{ + + // Get system's page size value. + SYMBIAN_PAGESIZE(m_pageSize); + + // We only accept multiples of system page size for both initial reservation and the alignment/block size + m_reservation = SYMBIAN_ROUNDUPTOMULTIPLE(m_reservation, m_pageSize); + __ASSERT_ALWAYS(SYMBIAN_ROUNDUPTOMULTIPLE(m_blockSize, m_pageSize), User::Panic(_L("AlignedBlockAllocator1"), KErrArgument)); + + // Calculate max. bit flags we need to carve a reservationSize range into blockSize-sized blocks + m_map.numBits = m_reservation / m_blockSize; + const TUint32 bitsPerWord = 8*sizeof(TUint32); + const TUint32 numWords = (m_map.numBits + bitsPerWord -1) / bitsPerWord; + + m_map.bits = new TUint32[numWords]; + __ASSERT_ALWAYS(m_map.bits, User::Panic(_L("AlignedBlockAllocator2"), KErrNoMemory)); + m_map.clearAll(); + + // Open a Symbian RChunk, and reserve requested virtual address range + // Any thread in this process can operate this rchunk due to EOwnerProcess access rights. + TInt ret = m_chunk.CreateDisconnectedLocal(0 , 0, (TInt)m_reservation , EOwnerProcess); + if (ret != KErrNone) + User::Panic(_L("AlignedBlockAllocator3"), ret); + + // This is the offset to m_chunk.Base() required to make it m_blockSize-aligned + m_offset = SYMBIAN_ROUNDUPTOMULTIPLE(TUint32(m_chunk.Base()), m_blockSize) - TUint(m_chunk.Base()); + +} + +void* AlignedBlockAllocator::alloc() +{ + + TInt freeRam = 0; + void* address = 0; + + // Look up first free slot in bit map + const TInt freeIdx = m_map.findFree(); + + // Pseudo OOM: We ate up the address space we reserved.. + // ..even though the device may have free RAM left + if (freeIdx < 0) + return 0; + + TInt ret = m_chunk.Commit(m_offset + (m_blockSize * freeIdx), m_blockSize); + if (ret != KErrNone) + return 0; // True OOM: Device didn't have physical RAM to spare + + // Updated bit to mark region as in use. + m_map.set(freeIdx); + + // Calculate address of committed region (block) + address = (void*)( (m_chunk.Base() + m_offset) + (TUint)(m_blockSize * freeIdx) ); + + return address; +} + +void AlignedBlockAllocator::free(void* block) +{ + // Calculate index of block to be freed + TInt idx = TUint(static_cast(block) - m_chunk.Base() - m_offset) / m_blockSize; + + __ASSERT_DEBUG(idx >= 0 && idx < m_map.numBits, User::Panic(_L("AlignedBlockAllocator4"), KErrCorrupt)); // valid index check + __ASSERT_DEBUG(m_map.get(idx), User::Panic(_L("AlignedBlockAllocator5"), KErrCorrupt)); // in-use flag check + + // Return committed region to system RAM pool (the physical RAM becomes usable by others) + TInt ret = m_chunk.Decommit(m_offset + m_blockSize * idx, m_blockSize); + + // mark this available again + m_map.clear(idx); +} + +void AlignedBlockAllocator::destroy() +{ + // release everything! + m_chunk.Decommit(0, m_chunk.MaxSize()); + m_map.clearAll(); +} + +AlignedBlockAllocator::~AlignedBlockAllocator() +{ + destroy(); + m_chunk.Close(); + delete [] m_map.bits; +} + +} // end of namespace + +#endif // SYMBIAN diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h b/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h new file mode 100644 index 0000000..21422f6 --- /dev/null +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 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. + */ + +#ifndef BlockAllocatorSymbian_h +#define BlockAllocatorSymbian_h + +#include +#include +#include + + +#define SYMBIAN_PAGESIZE(x) (HAL::Get(HALData::EMemoryPageSize, x)); +#define SYMBIAN_FREERAM(x) (HAL::Get(HALData::EMemoryRAMFree, x)); +#define SYMBIAN_ROUNDUPTOMULTIPLE(x, multipleof) ( (x + multipleof - 1) & ~(multipleof - 1) ) + +// Set sane defaults if -D wasn't provided via compiler args +#ifndef JSCCOLLECTOR_VIRTUALMEM_RESERVATION +#if defined(__WINS__) + // Emulator has limited virtual address space + #define JSCCOLLECTOR_VIRTUALMEM_RESERVATION (4*1024*1024) +#else + // HW has plenty of virtual addresses + #define JSCCOLLECTOR_VIRTUALMEM_RESERVATION (128*1024*1024) +#endif +#endif + +namespace WTF { + +/** + * Allocates contiguous region of size blockSize with blockSize-aligned address. + * blockSize must be a multiple of system page size (typically 4K on Symbian/ARM) + * + * @param reservationSize Virtual address range to be reserved upon creation of chunk (bytes). + * @param blockSize Size of a single allocation. Returned address will also be blockSize-aligned. + */ +class AlignedBlockAllocator { + public: + AlignedBlockAllocator(TUint32 reservationSize, TUint32 blockSize); + ~AlignedBlockAllocator(); + void destroy(); + void* alloc(); + void free(void* data); + + private: + RChunk m_chunk; // Symbian chunk that lets us reserve/commit/decommit + TUint m_offset; // offset of first committed region from base + TInt m_pageSize; // cached value of system page size, typically 4K on Symbian + TUint32 m_reservation; + TUint32 m_blockSize; + + // Tracks comitted/decommitted state of a blockSize region + struct { + + TUint32 *bits; // array of bit flags + TUint32 numBits; // number of regions to keep track of + + bool get(TUint32 n) const + { + return !!(bits[n >> 5] & (1 << (n & 0x1F))); + } + + void set(TUint32 n) + { + bits[n >> 5] |= (1 << (n & 0x1F)); + } + + void clear(TUint32 n) + { + bits[n >> 5] &= ~(1 << (n & 0x1F)); + } + + void clearAll() + { + for (TUint32 i = 0; i < numBits; i++) + clear(i); + } + + TInt findFree() const + { + for (TUint32 i = 0; i < numBits; i++) { + if (!get(i)) + return i; + } + return -1; + } + + } m_map; + +}; + +} + +#endif // end of BlockAllocatorSymbian_h + + diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index a8889b3..4de7ad8 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - e9151b11e974f0aa47fd40c225f88f35ced91496 + ecfa4583e573ce4dff1f0df12f6bdba3022376e5 -- cgit v0.12