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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/EvalCodeCache.h

    r39670 r39910  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6969        bool isEmpty() const { return m_cacheMap.isEmpty(); }
    7070
     71        void mark()
     72        {
     73            EvalCacheMap::iterator end = m_cacheMap.end();
     74            for (EvalCacheMap::iterator ptr = m_cacheMap.begin(); ptr != end; ++ptr)
     75                ptr->second->mark();
     76        }
    7177    private:
    7278        static const int maxCacheableSourceLength = 256;
    7379        static const int maxCacheEntries = 64;
    7480
    75         HashMap<RefPtr<UString::Rep>, RefPtr<EvalNode> > m_cacheMap;
     81        typedef HashMap<RefPtr<UString::Rep>, RefPtr<EvalNode> > EvalCacheMap;
     82        EvalCacheMap m_cacheMap;
    7683    };
    7784
Note: See TracChangeset for help on using the changeset viewer.