diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-23 10:25:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-23 10:25:11 +0200 |
commit | 5ea819f80c6840c492386bfafbffb059c7e2091f (patch) | |
tree | 42ad0b1d82eff090d14278a088ea0f4840a0f938 /Source/JavaScriptCore/interpreter/JSStack.h | |
parent | 43a42f108af6bcbd91f2672731c3047c26213af1 (diff) | |
download | qtwebkit-5ea819f80c6840c492386bfafbffb059c7e2091f.tar.gz |
Imported WebKit commit 20434eb8eb95065803473139d8794e98a7672f75 (http://svn.webkit.org/repository/webkit/trunk@132191)
New snapshot that should fix build with latest qtbase and the QPlastiqueStyle removal
Diffstat (limited to 'Source/JavaScriptCore/interpreter/JSStack.h')
-rw-r--r-- | Source/JavaScriptCore/interpreter/JSStack.h | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/Source/JavaScriptCore/interpreter/JSStack.h b/Source/JavaScriptCore/interpreter/JSStack.h index 86fa40be7..3beb59ebf 100644 --- a/Source/JavaScriptCore/interpreter/JSStack.h +++ b/Source/JavaScriptCore/interpreter/JSStack.h @@ -35,11 +35,17 @@ #include <wtf/PageReservation.h> #include <wtf/VMTags.h> +#if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK) +#define ENABLE_DEBUG_JSSTACK 1 +#endif + namespace JSC { class ConservativeRoots; class DFGCodeBlocks; + class ExecState; class JITStubRoutineSet; + class JSGlobalData; class LLIntOffsetsExtractor; class JSStack { @@ -61,7 +67,7 @@ namespace JSC { // Allow 8k of excess registers before we start trying to reap the stack static const ptrdiff_t maxExcessCapacity = 8 * 1024; - JSStack(size_t capacity = defaultCapacity); + JSStack(JSGlobalData&, size_t capacity = defaultCapacity); ~JSStack(); void gatherConservativeRoots(ConservativeRoots&); @@ -72,7 +78,6 @@ namespace JSC { size_t size() const { return end() - begin(); } bool grow(Register*); - void shrink(Register*); static size_t committedByteCount(); static void initializeThreading(); @@ -82,26 +87,55 @@ namespace JSC { return &m_end; } + Register* getTopOfFrame(CallFrame*); + Register* getStartOfFrame(CallFrame*); + Register* getTopOfStack(); + + CallFrame* pushFrame(CallFrame* callerFrame, class CodeBlock*, + JSScope*, int argsCount, JSObject* callee); + + void popFrame(CallFrame*); + + void enableErrorStackReserve(); + void disableErrorStackReserve(); + +#if ENABLE(DEBUG_JSSTACK) + void installFence(CallFrame*, const char *function = "", int lineNo = 0); + void validateFence(CallFrame*, const char *function = "", int lineNo = 0); + static const int FenceSize = 4; +#else // !ENABLE(DEBUG_JSSTACK) + void installFence(CallFrame*, const char* = "", int = 0) { } + void validateFence(CallFrame*, const char* = "", int = 0) { } +#endif // !ENABLE(DEBUG_JSSTACK) + private: - friend class LLIntOffsetsExtractor; + Register* reservationEnd() const + { + char* base = static_cast<char*>(m_reservation.base()); + char* reservationEnd = base + m_reservation.size(); + return reinterpret_cast<Register*>(reservationEnd); + } + +#if ENABLE(DEBUG_JSSTACK) + static JSValue generateFenceValue(size_t argIndex); + void installTrapsAfterFrame(CallFrame*); +#else + void installTrapsAfterFrame(CallFrame*) { } +#endif bool growSlowCase(Register*); + void shrink(Register*); void releaseExcessCapacity(); void addToCommittedByteCount(long); + Register* m_end; Register* m_commitEnd; + Register* m_useableEnd; PageReservation m_reservation; - }; + CallFrame*& m_topCallFrame; - inline JSStack::JSStack(size_t capacity) - : m_end(0) - { - ASSERT(capacity && isPageAligned(capacity)); - - m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages); - m_end = static_cast<Register*>(m_reservation.base()); - m_commitEnd = static_cast<Register*>(m_reservation.base()); - } + friend class LLIntOffsetsExtractor; + }; inline void JSStack::shrink(Register* newEnd) { |