Changeset 70174 in webkit


Ignore:
Timestamp:
Oct 20, 2010 1:54:07 PM (14 years ago)
Author:
ggaren@apple.com
Message:

JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=41948
REGRESSION(r60392): Registerfile can be unwound too far following an exception

Reviewed by Darin Adler.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::throwException): Walk the stack to calculate the high
water mark currently in use. It's not safe to assume that the current
CallFrame's high water mark is the highest high water mark because
calls do not always set up at the end of a CallFrame. A large caller
CallFrame can encompass a small callee CallFrame.

LayoutTests: Added a test for:

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=41948
REGRESSION(r60392): Registerfile can be unwound too far following an exception

  • fast/js/exception-registerfile-shrink-expected.txt: Added.
  • fast/js/exception-registerfile-shrink.html: Added.
  • fast/js/script-tests/exception-registerfile-shrink.js: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r70165 r70174  
     12010-10-20  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Darin Adler.
     4       
     5        https://bugs.webkit.org/show_bug.cgi?id=41948
     6        REGRESSION(r60392): Registerfile can be unwound too far following an exception
     7
     8        * interpreter/Interpreter.cpp:
     9        (JSC::Interpreter::throwException): Walk the stack to calculate the high
     10        water mark currently in use. It's not safe to assume that the current
     11        CallFrame's high water mark is the highest high water mark because
     12        calls do not always set up at the end of a CallFrame. A large caller
     13        CallFrame can encompass a small callee CallFrame.
     14
    1152010-10-20  Peter Rybin  <peter.rybin@gmail.com>
    216
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r69944 r70174  
    677677
    678678    // Shrink the JS stack, in case stack overflow made it huge.
    679     m_registerFile.shrink(callFrame->registers() + callFrame->codeBlock()->m_numCalleeRegisters);
     679    Register* highWaterMark = callFrame->registers() + callFrame->codeBlock()->m_numCalleeRegisters;
     680    for (CallFrame* callerFrame = callFrame->callerFrame()->removeHostCallFrameFlag(); callerFrame; callerFrame = callerFrame->callerFrame()->removeHostCallFrameFlag()) {
     681        CodeBlock* codeBlock = callerFrame->codeBlock();
     682        if (!codeBlock)
     683            continue;
     684        Register* callerHighWaterMark = callerFrame->registers() + codeBlock->m_numCalleeRegisters;
     685        highWaterMark = max(highWaterMark, callerHighWaterMark);
     686    }
     687    m_registerFile.shrink(highWaterMark);
    680688
    681689    // Unwind the scope chain within the exception handler's call frame.
  • trunk/LayoutTests/ChangeLog

    r70172 r70174  
     12010-10-20  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Darin Adler.
     4       
     5        Added a test for:
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=41948
     8        REGRESSION(r60392): Registerfile can be unwound too far following an exception
     9
     10        * fast/js/exception-registerfile-shrink-expected.txt: Added.
     11        * fast/js/exception-registerfile-shrink.html: Added.
     12        * fast/js/script-tests/exception-registerfile-shrink.js: Added.
     13
    1142010-10-20  David Hyatt  <hyatt@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.