Changeset 161170 in webkit


Ignore:
Timestamp:
Dec 30, 2013 9:41:48 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

CStack: Fix JSStack::ensureCapacity() to match LLINT and JIT stack checks.
https://bugs.webkit.org/show_bug.cgi?id=126328.

Not yet reviewed.

Also removed the now unused JSSTack::topOfStackForCapacityCheck().

  • interpreter/JSStack.h:
  • interpreter/JSStackInlines.h:

(JSC::JSStack::ensureCapacityFor):

Location:
branches/jsCStack/Source/JavaScriptCore
Files:
3 edited

Legend:

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

    r161169 r161170  
     12013-12-30  Mark Lam  <mark.lam@apple.com>
     2
     3        CStack: Fix JSStack::ensureCapacity() to match LLINT and JIT stack checks.
     4        https://bugs.webkit.org/show_bug.cgi?id=126328.
     5
     6        Not yet reviewed.
     7
     8        Also removed the now unused JSSTack::topOfStackForCapacityCheck().
     9
     10        * interpreter/JSStack.h:
     11        * interpreter/JSStackInlines.h:
     12        (JSC::JSStack::ensureCapacityFor):
     13
    1142013-12-30  Mark Lam  <mark.lam@apple.com>
    215
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h

    r161169 r161170  
    128128        inline Register* topOfFrameFor(CallFrame*);
    129129        inline Register* topOfStack();
    130         inline Register* topOfStackForCapacityCheck();
    131130
    132131#if ENABLE(LLINT_C_LOOP)
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h

    r161038 r161170  
    4040#else
    4141    ASSERT(wtfThreadData().stack().isGrowingDownward());
    42     Register* topOfStack = topOfStackForCapacityCheck();
    43     if (newTopOfStack > topOfStack)
    44         return true;
    45     size_t neededCapacity = (topOfStack - newTopOfStack) * sizeof(Register);
    46     return m_vm.isSafeToRecurse(neededCapacity);
    47 #endif
    48 }
    49 
    50 inline Register* JSStack::topOfStackForCapacityCheck()
    51 {
    52 #if !ENABLE(LLINT_C_LOOP)
    53     // We're trying to get an estimate of the top of the stack for the purpose
    54     // of a capacity check. If m_topCallFrame is 0, then we can't calculate an
    55     // accurate top of stack value. Just use the current stack position as an
    56     // estimate for the top of the stack from where JS code will start executing.
    57     // This is conservative, but it will be safe.
    58     if (!m_topCallFrame) {
    59         Register* p = reinterpret_cast<Register*>(&p);
    60         return p;
    61     }
    62 #endif
    63     return topOfStack() + 1;
     42    return newTopOfStack >= m_vm.jsStackLimit();
     43#endif
    6444}
    6545
Note: See TracChangeset for help on using the changeset viewer.