Changeset 87198 in webkit
- Timestamp:
- May 24, 2011 1:51:52 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeListsEfl.txt
r87061 r87198 2 2 jit/ExecutableAllocatorFixedVMPool.cpp 3 3 jit/ExecutableAllocator.cpp 4 heap/MarkStackPosix.cpp5 4 ) 6 5 -
trunk/Source/JavaScriptCore/CMakeListsWinCE.txt
r83520 r87198 1 1 LIST(APPEND JavaScriptCore_SOURCES 2 2 jit/ExecutableAllocator.cpp 3 4 heap/MarkStackWin.cpp5 3 ) 6 4 -
trunk/Source/JavaScriptCore/ChangeLog
r87190 r87198 1 2011-05-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Let's just have one way to get the system page size, bokay? 6 https://bugs.webkit.org/show_bug.cgi?id=61384 7 8 * CMakeListsEfl.txt: 9 * CMakeListsWinCE.txt: 10 * GNUmakefile.list.am: 11 * JavaScriptCore.exp: 12 * JavaScriptCore.gypi: 13 * JavaScriptCore.pro: 14 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: MarkStack[Platform].cpp 15 is gone completely now, since it only existed to provide a duplicate way 16 to access the system page size. 17 18 * heap/MarkStack.cpp: 19 (JSC::MarkStack::reset): 20 * heap/MarkStack.h: 21 (JSC::::MarkStackArray): 22 (JSC::::shrinkAllocation): Use WTF::pageSize. 23 24 * heap/MarkStackPosix.cpp: 25 * heap/MarkStackSymbian.cpp: 26 * heap/MarkStackWin.cpp: Removed now-empty files. 27 28 * jit/ExecutableAllocator.cpp: 29 (JSC::ExecutableAllocator::reprotectRegion): 30 * jit/ExecutableAllocator.h: 31 (JSC::ExecutableAllocator::ExecutableAllocator): 32 (JSC::ExecutablePool::ExecutablePool): 33 (JSC::ExecutablePool::poolAllocate): 34 * jit/ExecutableAllocatorFixedVMPool.cpp: Use WTF::pageSize. 35 36 * wscript: Removed now-empty files. 37 38 * wtf/PageBlock.cpp: 39 (WTF::systemPageSize): Integrated questionable Symbian page size rule 40 from ExecutableAllocator, because that seems like what the original 41 author should have done. 42 1 43 2011-05-24 Oliver Hunt <oliver@apple.com> 2 44 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r86727 r87198 577 577 if TARGET_WIN32 578 578 javascriptcore_sources += \ 579 Source/JavaScriptCore/heap/MarkStackWin.cpp \580 579 Source/JavaScriptCore/wtf/OSAllocatorWin.cpp 581 580 else 582 581 javascriptcore_sources += \ 583 582 Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp \ 584 Source/JavaScriptCore/heap/MarkStackPosix.cpp \585 583 Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp 586 584 endif -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r86906 r87198 324 324 __ZN3JSC9CodeBlockD1Ev 325 325 __ZN3JSC9CodeBlockD2Ev 326 __ZN3JSC9MarkStack10s_pageSizeE327 __ZN3JSC9MarkStack18initializePagesizeEv328 326 __ZN3JSC9Structure21addPropertyTransitionERNS_12JSGlobalDataEPS0_RKNS_10IdentifierEjPNS_6JSCellERm 329 327 __ZN3JSC9Structure22materializePropertyMapERNS_12JSGlobalDataE -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r86727 r87198 320 320 'heap/MarkStack.cpp', 321 321 'heap/MarkStack.h', 322 'heap/MarkStackPosix.cpp',323 'heap/MarkStackSymbian.cpp',324 'heap/MarkStackWin.cpp',325 322 'heap/MarkedBlock.cpp', 326 323 'heap/MarkedBlock.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.pro
r86974 r87198 77 77 heap/MachineStackMarker.cpp \ 78 78 heap/MarkStack.cpp \ 79 heap/MarkStackPosix.cpp \80 heap/MarkStackSymbian.cpp \81 heap/MarkStackWin.cpp \82 79 heap/MarkedBlock.cpp \ 83 80 heap/MarkedSpace.cpp \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r83506 r87198 1915 1915 </File> 1916 1916 <File 1917 RelativePath="..\..\heap\MarkStackWin.cpp"1918 >1919 </File>1920 <File1921 1917 RelativePath="..\..\heap\Heap.cpp" 1922 1918 > -
trunk/Source/JavaScriptCore/heap/MarkStack.cpp
r86294 r87198 37 37 namespace JSC { 38 38 39 size_t MarkStack::s_pageSize = 0;40 41 39 void MarkStack::reset() 42 40 { 43 ASSERT(s_pageSize); 44 m_values.shrinkAllocation(s_pageSize); 45 m_markSets.shrinkAllocation(s_pageSize); 41 m_values.shrinkAllocation(pageSize()); 42 m_markSets.shrinkAllocation(pageSize()); 46 43 m_opaqueRoots.clear(); 47 44 } -
trunk/Source/JavaScriptCore/heap/MarkStack.h
r87183 r87198 34 34 #include <wtf/Noncopyable.h> 35 35 #include <wtf/OSAllocator.h> 36 #include <wtf/PageBlock.h> 36 37 37 38 namespace JSC { … … 83 84 84 85 public: 85 static size_t pageSize();86 87 86 static void* allocateStack(size_t); 88 87 static void releaseStack(void*, size_t); … … 109 108 #endif 110 109 111 static void initializePagesize();112 113 110 void append(JSValue*); 114 111 void append(JSValue*, size_t count); … … 118 115 void internalAppend(JSValue); 119 116 void visitChildren(JSCell*); 120 121 static size_t s_pageSize;122 117 123 118 void* m_jsArrayVPtr; … … 181 176 } 182 177 183 inline size_t MarkStack::pageSize()184 {185 if (!s_pageSize)186 initializePagesize();187 return s_pageSize;188 }189 190 178 template <typename T> inline MarkStackArray<T>::MarkStackArray() 191 179 : m_top(0) 192 , m_allocated( MarkStack::pageSize())180 , m_allocated(pageSize()) 193 181 , m_capacity(m_allocated / sizeof(T)) 194 182 { … … 244 232 { 245 233 ASSERT(size <= m_allocated); 246 ASSERT( 0 == (size % MarkStack::pageSize()));234 ASSERT(isPageAligned(size)); 247 235 if (size == m_allocated) 248 236 return; -
trunk/Source/JavaScriptCore/heap/MarkStackPosix.cpp
r83506 r87198 1 /*2 * Copyright (C) 2009 Apple Inc. All rights reserved.3 *4 * Redistribution and use in source and binary forms, with or without5 * modification, are permitted provided that the following conditions6 * are met:7 * 1. Redistributions of source code must retain the above copyright8 * notice, this list of conditions and the following disclaimer.9 * 2. Redistributions in binary form must reproduce the above copyright10 * notice, this list of conditions and the following disclaimer in the11 * documentation and/or other materials provided with the distribution.12 *13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.24 */25 26 #include "config.h"27 #include "MarkStack.h"28 29 #if OS(UNIX) && !OS(SYMBIAN)30 31 #include <unistd.h>32 #include <sys/mman.h>33 34 namespace JSC {35 36 void MarkStack::initializePagesize()37 {38 MarkStack::s_pageSize = getpagesize();39 }40 41 }42 43 #endif -
trunk/Source/JavaScriptCore/heap/MarkStackSymbian.cpp
r83506 r87198 1 /*2 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)3 4 This library is free software; you can redistribute it and/or5 modify it under the terms of the GNU Library General Public6 License as published by the Free Software Foundation; either7 version 2 of the License, or (at your option) any later version.8 9 This library is distributed in the hope that it will be useful,10 but WITHOUT ANY WARRANTY; without even the implied warranty of11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12 Library General Public License for more details.13 14 You should have received a copy of the GNU Library General Public License15 along with this library; see the file COPYING.LIB. If not, write to16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,17 Boston, MA 02110-1301, USA.18 */19 20 #include "config.h"21 #include "MarkStack.h"22 23 #if OS(SYMBIAN)24 25 #include <e32hal.h>26 27 namespace JSC {28 29 void MarkStack::initializePagesize()30 {31 TInt page_size;32 UserHal::PageSizeInBytes(page_size);33 MarkStack::s_pageSize = page_size;34 }35 36 }37 38 #endif -
trunk/Source/JavaScriptCore/heap/MarkStackWin.cpp
r83506 r87198 1 /*2 * Copyright (C) 2009 Apple Inc. All rights reserved.3 *4 * Redistribution and use in source and binary forms, with or without5 * modification, are permitted provided that the following conditions6 * are met:7 * 1. Redistributions of source code must retain the above copyright8 * notice, this list of conditions and the following disclaimer.9 * 2. Redistributions in binary form must reproduce the above copyright10 * notice, this list of conditions and the following disclaimer in the11 * documentation and/or other materials provided with the distribution.12 *13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.24 */25 26 #include "config.h"27 #include "MarkStack.h"28 29 #if OS(WINDOWS)30 31 #include "windows.h"32 33 namespace JSC {34 35 void MarkStack::initializePagesize()36 {37 SYSTEM_INFO system_info;38 GetSystemInfo(&system_info);39 MarkStack::s_pageSize = system_info.dwPageSize;40 }41 42 }43 44 #endif -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
r77972 r87198 32 32 namespace JSC { 33 33 34 size_t ExecutableAllocator::pageSize = 0;35 36 34 #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) 37 38 void ExecutableAllocator::intializePageSize()39 {40 #if OS(SYMBIAN) && CPU(ARMV5_OR_LOWER)41 // The moving memory model (as used in ARMv5 and earlier platforms)42 // on Symbian OS limits the number of chunks for each process to 16.43 // To mitigate this limitation increase the pagesize to allocate44 // fewer, larger chunks. Set the page size to 256 Kb to compensate45 // for moving memory model limitation46 ExecutableAllocator::pageSize = 256 * 1024;47 #else48 ExecutableAllocator::pageSize = WTF::pageSize();49 #endif50 }51 35 52 36 ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t size) … … 88 72 void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSetting setting) 89 73 { 90 if (!pageSize) 91 intializePageSize(); 74 size_t pageSize = WTF::pageSize(); 92 75 93 76 // Calculate the start of the page containing this region, -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h
r85253 r87198 67 67 #endif 68 68 69 #define JIT_ALLOCATOR_PAGE_SIZE (ExecutableAllocator::pageSize) 70 #define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (ExecutableAllocator::pageSize * 4) 69 #define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (pageSize() * 4) 71 70 72 71 #if ENABLE(ASSEMBLER_WX_EXCLUSIVE) … … 178 177 179 178 public: 180 static size_t pageSize;181 179 ExecutableAllocator() 182 180 { 183 if (!pageSize)184 intializePageSize();185 181 if (isValid()) 186 182 m_smallAllocationPool = ExecutablePool::create(JIT_ALLOCATOR_LARGE_ALLOC_SIZE); … … 339 335 340 336 RefPtr<ExecutablePool> m_smallAllocationPool; 341 static void intializePageSize();342 337 }; 343 338 344 339 inline ExecutablePool::ExecutablePool(size_t n) 345 340 { 346 size_t allocSize = roundUpAllocationSize(n, JIT_ALLOCATOR_PAGE_SIZE);341 size_t allocSize = roundUpAllocationSize(n, pageSize()); 347 342 Allocation mem = systemAlloc(allocSize); 348 343 m_pools.append(mem); … … 355 350 inline void* ExecutablePool::poolAllocate(size_t n) 356 351 { 357 size_t allocSize = roundUpAllocationSize(n, JIT_ALLOCATOR_PAGE_SIZE);352 size_t allocSize = roundUpAllocationSize(n, pageSize()); 358 353 359 354 Allocation result = systemAlloc(allocSize); -
trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
r86906 r87198 492 492 } 493 493 494 void ExecutableAllocator::intializePageSize()495 {496 ExecutableAllocator::pageSize = getpagesize();497 }498 499 494 bool ExecutableAllocator::isValid() const 500 495 { -
trunk/Source/JavaScriptCore/wscript
r84994 r87198 43 43 if Options.options.port == "wx": 44 44 if building_on_win32: 45 jscore_excludes += ['MarkStackPosix.cpp', 'OSAllocatorPosix.cpp', 'ThreadingPthreads.cpp'] 46 sources += ['heap/MarkStackWin.cpp'] 45 jscore_excludes += ['OSAllocatorPosix.cpp', 'ThreadingPthreads.cpp'] 47 46 else: 48 47 jscore_excludes.append('JSStringRefBSTR.cpp') -
trunk/Source/JavaScriptCore/wtf/PageBlock.cpp
r74357 r87198 67 67 inline size_t systemPageSize() 68 68 { 69 #if CPU(ARMV5_OR_LOWER) 70 // The moving memory model (as used in ARMv5 and earlier platforms) 71 // on Symbian OS limits the number of chunks for each process to 16. 72 // To mitigate this limitation increase the pagesize to allocate 73 // fewer, larger chunks. Set the page size to 256 Kb to compensate 74 // for moving memory model limitation 75 return 256 * 1024; 76 #else 69 77 static TInt page_size = 0; 70 78 UserHal::PageSizeInBytes(page_size); 71 79 return page_size; 80 #endif 72 81 } 73 82
Note: See TracChangeset
for help on using the changeset viewer.