⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 161169 in webkit


Ignore:
Timestamp:
Dec 30, 2013, 9:18:42 PM (13 years ago)
Author:
mark.lam@apple.com
Message:

CStack: Introducing Options::maxStackSize().
https://bugs.webkit.org/show_bug.cgi?id=126321.

Not yet reviewed.

We need an option to limit the JS stack size. Currently, we just change
the JSStack class to use this limit.

  • interpreter/JSStack.cpp:

(JSC::JSStack::JSStack):

  • interpreter/JSStack.h:
  • runtime/Options.h:
Location:
branches/jsCStack/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/jsCStack/Source/JavaScriptCore/ChangeLog

    r161125 r161169  
     12013-12-30  Mark Lam  <mark.lam@apple.com>
     2
     3        CStack: Introducing Options::maxStackSize().
     4        https://bugs.webkit.org/show_bug.cgi?id=126321.
     5
     6        Not yet reviewed.
     7
     8        We need an option to limit the JS stack size. Currently, we just change
     9        the JSStack class to use this limit.
     10
     11        * interpreter/JSStack.cpp:
     12        (JSC::JSStack::JSStack):
     13        * interpreter/JSStack.h:
     14        * runtime/Options.h:
     15
    1162013-12-29  Filip Pizlo  <fpizlo@apple.com>
    217
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp

    r161104 r161169  
    5454{
    5555#if ENABLE(LLINT_C_LOOP)
    56     size_t capacity = defaultCapacity;
     56    size_t capacity = Options::maxStackSize();
    5757    ASSERT(capacity && isPageAligned(capacity));
    5858
    59     m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
     59    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity, commitSize), OSAllocator::JSVMStackPages);
    6060    setStackLimit(highAddress());
    6161    m_commitTop = highAddress();
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h

    r161036 r161169  
    7676        };
    7777
    78         static const size_t defaultCapacity = 512 * 1024;
    7978        static const size_t commitSize = 16 * 1024;
    8079        // Allow 8k of excess registers before we start trying to reap the stack
  • branches/jsCStack/Source/JavaScriptCore/runtime/Options.h

    r160821 r161169  
    3030#include <stdint.h>
    3131#include <stdio.h>
     32#include <wtf/StdLibExtras.h>
    3233
    3334namespace JSC {
     
    9495    v(bool, useDFGJIT, true) \
    9596    v(bool, useRegExpJIT, true) \
     97    \
     98    v(unsigned, maxStackSize, 4 * MB) \
    9699    \
    97100    v(bool, crashIfCantAllocateJITMemory, false) \
Note: See TracChangeset for help on using the changeset viewer.