Changeset 39910 in webkit for trunk/JavaScriptCore/parser


Ignore:
Timestamp:
Jan 14, 2009, 2:14:55 PM (16 years ago)
Author:
[email protected]
Message:

Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly

Reviewed by Cameron Zwarich

EvalCodeBlock's do not reference the functions that are declared inside the eval
code, this means that simply marking the EvalCodeBlock through the global object
is insufficient to mark the declared functions. This patch corrects this by
explicitly marking the CodeBlocks of all the functions declared in the cached
EvalNode.

Location:
trunk/JavaScriptCore/parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.cpp

    r39851 r39910  
    24032403}
    24042404
     2405void ScopeNodeData::mark()
     2406{
     2407    FunctionStack::iterator end = m_functionStack.end();
     2408    for (FunctionStack::iterator ptr = m_functionStack.begin(); ptr != end; ++ptr) {
     2409        FunctionBodyNode* body = (*ptr)->body();
     2410        if (!body->isGenerated())
     2411            continue;
     2412        body->generatedBytecode().mark();
     2413    }
     2414}
     2415
    24052416// ------------------------------ ScopeNode -----------------------------
    24062417
     
    25332544}
    25342545
     2546void EvalNode::mark()
     2547{
     2548    // We don't need to mark our own CodeBlock as the JSGlobalObject takes care of that
     2549    data()->mark();
     2550}
     2551
    25352552// ------------------------------ FunctionBodyNode -----------------------------
    25362553
  • trunk/JavaScriptCore/parser/Nodes.h

    r39752 r39910  
    20752075        int m_numConstants;
    20762076        StatementVector m_children;
     2077
     2078        void mark();
    20772079    };
    20782080
     
    21592161        EvalCodeBlock& bytecodeForExceptionInfoReparse(ScopeChainNode*, CodeBlock*) JSC_FAST_CALL;
    21602162
     2163        void mark();
    21612164    private:
    21622165        EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL;
Note: See TracChangeset for help on using the changeset viewer.