diff options
Diffstat (limited to 'JavaScriptCore/runtime')
-rw-r--r-- | JavaScriptCore/runtime/MarkStack.h | 5 | ||||
-rw-r--r-- | JavaScriptCore/runtime/MarkStackNone.cpp | 49 | ||||
-rw-r--r-- | JavaScriptCore/runtime/MarkStackPosix.cpp | 9 | ||||
-rw-r--r-- | JavaScriptCore/runtime/MarkStackSymbian.cpp | 10 | ||||
-rw-r--r-- | JavaScriptCore/runtime/MarkStackWin.cpp | 11 | ||||
-rw-r--r-- | JavaScriptCore/runtime/Structure.cpp | 1 |
6 files changed, 81 insertions, 4 deletions
diff --git a/JavaScriptCore/runtime/MarkStack.h b/JavaScriptCore/runtime/MarkStack.h index c3efc8f..c551bac 100644 --- a/JavaScriptCore/runtime/MarkStack.h +++ b/JavaScriptCore/runtime/MarkStack.h @@ -28,7 +28,6 @@ #include "JSValue.h" #include <wtf/Noncopyable.h> -#include <wtf/OSAllocator.h> namespace JSC { @@ -86,8 +85,8 @@ namespace JSC { MarkSetProperties m_properties; }; - static void* allocateStack(size_t size) { return OSAllocator::reserveAndCommit(size); } - static void releaseStack(void* addr, size_t size) { OSAllocator::release(addr, size); } + static void* allocateStack(size_t size); + static void releaseStack(void* addr, size_t size); static void initializePagesize(); static size_t pageSize() diff --git a/JavaScriptCore/runtime/MarkStackNone.cpp b/JavaScriptCore/runtime/MarkStackNone.cpp new file mode 100644 index 0000000..b1ff48b --- /dev/null +++ b/JavaScriptCore/runtime/MarkStackNone.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2009 Company 100, 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 "MarkStack.h" + +#include "FastMalloc.h" + +namespace JSC { + +void MarkStack::initializePagesize() +{ + MarkStack::s_pageSize = 4096; +} + +void* MarkStack::allocateStack(size_t size) +{ + return fastMalloc(size); +} + +void MarkStack::releaseStack(void* addr, size_t) +{ + return fastFree(addr); +} + +} diff --git a/JavaScriptCore/runtime/MarkStackPosix.cpp b/JavaScriptCore/runtime/MarkStackPosix.cpp index 2a5b298..c28bc0d 100644 --- a/JavaScriptCore/runtime/MarkStackPosix.cpp +++ b/JavaScriptCore/runtime/MarkStackPosix.cpp @@ -38,6 +38,15 @@ void MarkStack::initializePagesize() MarkStack::s_pageSize = getpagesize(); } +void* MarkStack::allocateStack(size_t size) +{ + return mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); +} +void MarkStack::releaseStack(void* addr, size_t size) +{ + munmap(addr, size); +} + } #endif diff --git a/JavaScriptCore/runtime/MarkStackSymbian.cpp b/JavaScriptCore/runtime/MarkStackSymbian.cpp index a3893d7..bda14ac 100644 --- a/JavaScriptCore/runtime/MarkStackSymbian.cpp +++ b/JavaScriptCore/runtime/MarkStackSymbian.cpp @@ -33,6 +33,16 @@ void MarkStack::initializePagesize() MarkStack::s_pageSize = page_size; } +void* MarkStack::allocateStack(size_t size) +{ + return fastMalloc(size); +} + +void MarkStack::releaseStack(void* addr, size_t size) +{ + return fastFree(addr); +} + } #endif diff --git a/JavaScriptCore/runtime/MarkStackWin.cpp b/JavaScriptCore/runtime/MarkStackWin.cpp index 2d2a1b3..a171c78 100644 --- a/JavaScriptCore/runtime/MarkStackWin.cpp +++ b/JavaScriptCore/runtime/MarkStackWin.cpp @@ -39,6 +39,17 @@ void MarkStack::initializePagesize() MarkStack::s_pageSize = system_info.dwPageSize; } +void* MarkStack::allocateStack(size_t size) +{ + return VirtualAlloc(0, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); +} +void MarkStack::releaseStack(void* addr, size_t) +{ + // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, + // dwSize must be 0 if dwFreeType is MEM_RELEASE. + VirtualFree(addr, 0, MEM_RELEASE); +} + } #endif diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp index 0179eed..d06a239 100644 --- a/JavaScriptCore/runtime/Structure.cpp +++ b/JavaScriptCore/runtime/Structure.cpp @@ -233,7 +233,6 @@ Structure::Structure(JSValue prototype, const TypeInfo& typeInfo, unsigned anony , m_dictionaryKind(NoneDictionaryKind) , m_isPinnedPropertyTable(false) , m_hasGetterSetterProperties(false) - , m_hasNonEnumerableProperties(false) , m_attributesInPrevious(0) , m_specificFunctionThrashCount(0) , m_anonymousSlotCount(anonymousSlotCount) |