Changeset 33371

Show
Ignore:
Timestamp:
05/12/08 23:06:47 (6 months ago)
Author:
mrowe@apple.com
Message:

Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
<https://bugs.webkit.org/show_bug.cgi?id=18934>

Reviewed by Geoff

Unfortunately we cannot create new statically optimised globals if there are any
tainted RegisterFiles on the RegisterFileStack. To handle this we re-introduce
(in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.

Location:
branches/squirrelfish
Files:
3 added
5 modified

Legend:

Unmodified
Added
Removed
  • branches/squirrelfish/JavaScriptCore/ChangeLog

    r33370 r33371  
     12008-05-12  Oliver Hunt  <oliver@apple.com> 
     2 
     3        Reviewed by Geoff. 
     4 
     5        Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered 
     6        <https://bugs.webkit.org/show_bug.cgi?id=18934> 
     7 
     8        Unfortunately we cannot create new statically optimised globals if there are any 
     9        tainted RegisterFiles on the RegisterFileStack.  To handle this we re-introduce 
     10        (in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack. 
     11 
     12        * VM/Machine.cpp: 
     13        (KJS::Machine::execute): 
     14        * VM/RegisterFileStack.cpp: 
     15        (KJS::RegisterFileStack::pushFunctionRegisterFile): 
     16        * VM/RegisterFileStack.h: 
     17 
    1182008-05-12  Geoffrey Garen  <ggaren@apple.com> 
    219 
  • branches/squirrelfish/JavaScriptCore/VM/Machine.cpp

    r33370 r33371  
    580580 
    581581    RegisterFile* registerFile = registerFileStack->pushGlobalRegisterFile(); 
    582     CodeBlock* codeBlock = &programNode->code(scopeChain, registerFileStack->current()->isGlobal()); 
     582    CodeBlock* codeBlock = &programNode->code(scopeChain, !registerFileStack->inImplicitCall()); 
    583583    registerFile->addGlobalSlots(codeBlock->numVars); 
    584584 
  • branches/squirrelfish/JavaScriptCore/VM/RegisterFileStack.cpp

    r33327 r33371  
    8787RegisterFile* RegisterFileStack::pushFunctionRegisterFile() 
    8888{ 
     89    m_functionStackDepth++; 
    8990    return allocateRegisterFile(current()->maxSize() - current()->size()); 
    9091} 
     
    9293void RegisterFileStack::popFunctionRegisterFile() 
    9394{ 
     95    m_functionStackDepth--; 
    9496    delete m_stack.last(); 
    9597    m_stack.removeLast(); 
  • branches/squirrelfish/JavaScriptCore/VM/RegisterFileStack.h

    r33327 r33371  
    3939        RegisterFileStack() 
    4040            : m_globalBase(0) 
     41            , m_functionStackDepth(0) 
    4142        { 
    4243            allocateRegisterFile(RegisterFile::DefaultRegisterFileSize, this); 
     
    6970        } 
    7071 
     72        bool inImplicitCall() { return m_functionStackDepth > 0; } 
    7173    private: 
    7274        typedef Vector<RegisterFile*, 4> Stack; 
     
    8991        Stack m_stack; 
    9092        Register* m_globalBase; 
     93        int m_functionStackDepth; 
    9194    }; 
    9295 
  • branches/squirrelfish/LayoutTests/ChangeLog

    r33370 r33371  
     12008-05-12  Oliver Hunt  <oliver@apple.com> 
     2 
     3        Reviewed by Geoff. 
     4 
     5        Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered 
     6        <https://bugs.webkit.org/show_bug.cgi?id=18934> 
     7 
     8        Add testcases to cover global reentry from an implicit call. 
     9 
     10        * fast/js/implicit-call-with-global-reentry-expected.txt: Added. 
     11        * fast/js/implicit-call-with-global-reentry.html: Added. 
     12        * fast/js/resources/implicit-call-with-global-reentry.js: Added. 
     13 
    1142008-05-12  Geoffrey Garen  <ggaren@apple.com> 
    215