Title: [143279] trunk
Revision
143279
Author
gga...@apple.com
Date
2013-02-18 17:39:12 -0800 (Mon, 18 Feb 2013)

Log Message

Shrank the SourceProvider cache
https://bugs.webkit.org/show_bug.cgi?id=110158

Reviewed by Oliver Hunt.

Source/_javascript_Core: 

CodeCache is now our primary source cache, so a long-lived SourceProvider
cache is a waste. I measured this as a 10MB Membuster win; with more
precise instrumentation, Andreas estimated it as up to 30MB.

I didn't eliminate the SourceProvider cache because it's still useful
in speeding up uncached parsing of scripts with large nested functions
(i.e., all scripts).

* heap/Heap.cpp:
(JSC::Heap::collect): Discard all source provider caches after GC. This
is a convenient place to do so because it's reasonably soon after initial
parsing without being immediate.

* parser/Parser.cpp:
(JSC::::Parser): Updated for interface change: The heap now owns the
source provider cache, since most SourceProviders are not expected to
have one by default, and the heap is responsible for throwing them away.

(JSC::::parseInner): No need to update statistics on cache size, since
we're going to throw it away no matter what.

(JSC::::parseFunctionInfo): Reduced the minimum function size to 16. This
is a 27% win on a new parsing micro-benchmark I've added. Now that the
cache is temporary, we don't have to worry so much about its memory
footprint.

* parser/Parser.h:
(Parser): Updated for interface changes.

* parser/SourceProvider.cpp:
(JSC::SourceProvider::SourceProvider):
(JSC::SourceProvider::~SourceProvider):
* parser/SourceProvider.h:
(JSC):
(SourceProvider): SourceProvider doesn't own its cache anymore because
the cache is temporary.

* parser/SourceProviderCache.cpp:
(JSC::SourceProviderCache::clear):
(JSC::SourceProviderCache::add):
* parser/SourceProviderCache.h:
(JSC::SourceProviderCache::SourceProviderCache):
(SourceProviderCache):
* parser/SourceProviderCacheItem.h:
(SourceProviderCacheItem): No need to update statistics on cache size,
since we're going to throw it away no matter what.

* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::addSourceProviderCache):
(JSC):
(JSC::JSGlobalData::clearSourceProviderCaches):
* runtime/JSGlobalData.h:
(JSC):
(JSGlobalData): Moved the cache here so it's easier to throw away.

Source/WebCore: 

Test: fast/js/regress/nested-function-parsing.html

No need to keep statistics on cache size, since we're going to throw it
away no matter what.

* WebCore.order:
* bindings/js/CachedScriptSourceProvider.h:
(CachedScriptSourceProvider):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::destroyDecodedData):
(WebCore):
(WebCore::CachedScript::reportMemoryUsage):
* loader/cache/CachedScript.h:
(CachedScript):

LayoutTests: 

New benchmark to show that a minimum size of 16 is better than 64.

* fast/js/regress/nested-function-parsing-expected.txt: Added.
* fast/js/regress/nested-function-parsing.html: Added.
* fast/js/regress/script-tests/nested-function-parsing.js: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (143278 => 143279)


--- trunk/LayoutTests/ChangeLog	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/LayoutTests/ChangeLog	2013-02-19 01:39:12 UTC (rev 143279)
@@ -1,3 +1,16 @@
+2013-02-18  Geoffrey Garen  <gga...@apple.com>
+
+        Shrank the SourceProvider cache
+        https://bugs.webkit.org/show_bug.cgi?id=110158
+
+        Reviewed by Oliver Hunt.
+
+        New benchmark to show that a minimum size of 16 is better than 64.
+
+        * fast/js/regress/nested-function-parsing-expected.txt: Added.
+        * fast/js/regress/nested-function-parsing.html: Added.
+        * fast/js/regress/script-tests/nested-function-parsing.js: Added.
+
 2013-02-18  Filip Pizlo  <fpi...@apple.com>
 
         Structure::flattenDictionaryStructure should compute max offset in a manner that soundly handles the case where the property list becomes empty

Added: trunk/LayoutTests/fast/js/regress/nested-function-parsing-expected.txt (0 => 143279)


--- trunk/LayoutTests/fast/js/regress/nested-function-parsing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/js/regress/nested-function-parsing-expected.txt	2013-02-19 01:39:12 UTC (rev 143279)
@@ -0,0 +1,10 @@
+JSRegress/nested-function-parsing
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/js/regress/nested-function-parsing.html (0 => 143279)


--- trunk/LayoutTests/fast/js/regress/nested-function-parsing.html	                        (rev 0)
+++ trunk/LayoutTests/fast/js/regress/nested-function-parsing.html	2013-02-19 01:39:12 UTC (rev 143279)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/js/regress/script-tests/nested-function-parsing.js (0 => 143279)


--- trunk/LayoutTests/fast/js/regress/script-tests/nested-function-parsing.js	                        (rev 0)
+++ trunk/LayoutTests/fast/js/regress/script-tests/nested-function-parsing.js	2013-02-19 01:39:12 UTC (rev 143279)
@@ -0,0 +1,19 @@
+(function() {
+    var result = 0;
+
+    for (var i = 0; i < 100; ++i) {
+        var program = "(function f" + i + "() {\n";
+        for (var j = 0; j < 1000; ++j) {
+            program += "function f" + j + "() { return 0 && 1 && 2 && 3 && 4 && 5 && 6 && 7 && 8 && 9 && 10; }\n";
+        }
+        program += "})();\n";
+        program += "return 0;\n";
+
+        result += new Function(program)();
+    }
+
+    if (result != 0) {
+        print("Bad result: " + result);
+        throw "Error";
+    }
+})();

Modified: trunk/Source/_javascript_Core/ChangeLog (143278 => 143279)


--- trunk/Source/_javascript_Core/ChangeLog	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-02-19 01:39:12 UTC (rev 143279)
@@ -1,3 +1,65 @@
+2013-02-18  Geoffrey Garen  <gga...@apple.com>
+
+        Shrank the SourceProvider cache
+        https://bugs.webkit.org/show_bug.cgi?id=110158
+
+        Reviewed by Oliver Hunt.
+
+        CodeCache is now our primary source cache, so a long-lived SourceProvider
+        cache is a waste. I measured this as a 10MB Membuster win; with more
+        precise instrumentation, Andreas estimated it as up to 30MB.
+
+        I didn't eliminate the SourceProvider cache because it's still useful
+        in speeding up uncached parsing of scripts with large nested functions
+        (i.e., all scripts).
+
+        * heap/Heap.cpp:
+        (JSC::Heap::collect): Discard all source provider caches after GC. This
+        is a convenient place to do so because it's reasonably soon after initial
+        parsing without being immediate.
+
+        * parser/Parser.cpp:
+        (JSC::::Parser): Updated for interface change: The heap now owns the
+        source provider cache, since most SourceProviders are not expected to
+        have one by default, and the heap is responsible for throwing them away.
+
+        (JSC::::parseInner): No need to update statistics on cache size, since
+        we're going to throw it away no matter what.
+
+        (JSC::::parseFunctionInfo): Reduced the minimum function size to 16. This
+        is a 27% win on a new parsing micro-benchmark I've added. Now that the
+        cache is temporary, we don't have to worry so much about its memory
+        footprint.
+
+        * parser/Parser.h:
+        (Parser): Updated for interface changes.
+
+        * parser/SourceProvider.cpp:
+        (JSC::SourceProvider::SourceProvider):
+        (JSC::SourceProvider::~SourceProvider):
+        * parser/SourceProvider.h:
+        (JSC):
+        (SourceProvider): SourceProvider doesn't own its cache anymore because
+        the cache is temporary.
+
+        * parser/SourceProviderCache.cpp:
+        (JSC::SourceProviderCache::clear):
+        (JSC::SourceProviderCache::add):
+        * parser/SourceProviderCache.h:
+        (JSC::SourceProviderCache::SourceProviderCache):
+        (SourceProviderCache):
+        * parser/SourceProviderCacheItem.h:
+        (SourceProviderCacheItem): No need to update statistics on cache size,
+        since we're going to throw it away no matter what.
+
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::addSourceProviderCache):
+        (JSC):
+        (JSC::JSGlobalData::clearSourceProviderCaches):
+        * runtime/JSGlobalData.h:
+        (JSC):
+        (JSGlobalData): Moved the cache here so it's easier to throw away.
+
 2013-02-18  Filip Pizlo  <fpi...@apple.com>
 
         DFG backend Branch handling has duplicate code and dead code

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (143278 => 143279)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -750,6 +750,11 @@
         deleteUnmarkedCompiledCode();
     }
 
+    {
+        GCPHASE(DeleteSourceProviderCaches);
+        m_globalData->clearSourceProviderCaches();
+    }
+
     if (sweepToggle == DoSweep) {
         SamplingRegion samplingRegion("Garbage Collection: Sweeping");
         GCPHASE(Sweeping);

Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/Parser.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -84,7 +84,7 @@
     m_arena = m_globalData->parserArena.get();
     m_lexer->setCode(source, m_arena);
 
-    m_functionCache = source.provider()->cache();
+    m_functionCache = globalData->addSourceProviderCache(source.provider());
     ScopeRef scope = pushScope();
     if (parserMode == JSParseFunctionCode)
         scope->setIsFunction();
@@ -110,7 +110,6 @@
 {
     String parseError = String();
     
-    unsigned oldFunctionCacheSize = m_functionCache ? m_functionCache->byteSize() : 0;
     ASTBuilder context(const_cast<JSGlobalData*>(m_globalData), const_cast<SourceCode*>(m_source));
     if (m_lexer->isReparsing())
         m_statementDepth--;
@@ -126,9 +125,6 @@
         features |= StrictModeFeature;
     if (scope->shadowsArguments())
         features |= ShadowsArgumentsFeature;
-    unsigned functionCacheSize = m_functionCache ? m_functionCache->byteSize() : 0;
-    if (functionCacheSize != oldFunctionCacheSize)
-        m_lexer->sourceProvider()->notifyCacheSizeChanged(functionCacheSize - oldFunctionCacheSize);
 
     didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), features,
                      m_lastLine, context.numConstants(), capturedVariables);
@@ -863,7 +859,7 @@
     
     // Cache the tokenizer state and the function scope the first time the function is parsed.
     // Any future reparsing can then skip the function.
-    static const int minimumFunctionLengthToCache = 64;
+    static const int minimumFunctionLengthToCache = 16;
     OwnPtr<SourceProviderCacheItem> newInfo;
     int functionLength = closeBracePos - openBracePos;
     if (TreeBuilder::CanUseFunctionCache && m_functionCache && functionLength > minimumFunctionLengthToCache) {
@@ -879,10 +875,8 @@
     failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo));
     matchOrFail(CLOSEBRACE);
     
-    if (newInfo) {
-        unsigned approximateByteSize = newInfo->approximateByteSize();
-        m_functionCache->add(openBracePos, newInfo.release(), approximateByteSize);
-    }
+    if (newInfo)
+        m_functionCache->add(openBracePos, newInfo.release());
     
     next();
     return true;

Modified: trunk/Source/_javascript_Core/parser/Parser.h (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/Parser.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/Parser.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -908,7 +908,7 @@
     int m_statementDepth;
     int m_nonTrivialExpressionCount;
     const Identifier* m_lastIdentifier;
-    SourceProviderCache* m_functionCache;
+    RefPtr<SourceProviderCache> m_functionCache;
     SourceElements* m_sourceElements;
     ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
     ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;

Modified: trunk/Source/_javascript_Core/parser/SourceProvider.cpp (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/SourceProvider.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -26,23 +26,17 @@
 #include "config.h"
 #include "SourceProvider.h"
 
-#include "SourceProviderCache.h"
-
 namespace JSC {
 
-SourceProvider::SourceProvider(const String& url, const TextPosition& startPosition, SourceProviderCache* cache)
+SourceProvider::SourceProvider(const String& url, const TextPosition& startPosition)
     : m_url(url)
     , m_startPosition(startPosition)
     , m_validated(false)
-    , m_cache(cache ? cache : new SourceProviderCache)
-    , m_cacheOwned(!cache)
 {
 }
 
 SourceProvider::~SourceProvider()
 {
-    if (m_cacheOwned)
-        delete m_cache;
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/parser/SourceProvider.h (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/SourceProvider.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -37,13 +37,11 @@
 
 namespace JSC {
 
-    class SourceProviderCache;
-
     class SourceProvider : public RefCounted<SourceProvider> {
     public:
         static const intptr_t nullID = 1;
         
-        JS_EXPORT_PRIVATE SourceProvider(const String& url, const TextPosition& startPosition, SourceProviderCache* = 0);
+        JS_EXPORT_PRIVATE SourceProvider(const String& url, const TextPosition& startPosition);
 
         JS_EXPORT_PRIVATE virtual ~SourceProvider();
 
@@ -66,17 +64,11 @@
         bool isValid() const { return m_validated; }
         void setValid() { m_validated = true; }
 
-        SourceProviderCache* cache() const { return m_cache; }
-        void notifyCacheSizeChanged(int delta) { if (!m_cacheOwned) cacheSizeChanged(delta); }
-        
     private:
-        virtual void cacheSizeChanged(int delta) { UNUSED_PARAM(delta); }
 
         String m_url;
         TextPosition m_startPosition;
         bool m_validated;
-        SourceProviderCache* m_cache;
-        bool m_cacheOwned;
     };
 
     class StringSourceProvider : public SourceProvider {

Modified: trunk/Source/_javascript_Core/parser/SourceProviderCache.cpp (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/SourceProviderCache.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/SourceProviderCache.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -36,18 +36,11 @@
 void SourceProviderCache::clear()
 {
     m_map.clear();
-    m_contentByteSize = 0;
 }
 
-unsigned SourceProviderCache::byteSize() const
-{ 
-    return m_contentByteSize + sizeof(*this) + m_map.capacity() * sizeof(SourceProviderCacheItem*);
-}
-
-void SourceProviderCache::add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem> item, unsigned size)
+void SourceProviderCache::add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem> item)
 {
     m_map.add(sourcePosition, item);
-    m_contentByteSize += size;
 }
 
 }

Modified: trunk/Source/_javascript_Core/parser/SourceProviderCache.h (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/SourceProviderCache.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/SourceProviderCache.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -30,23 +30,22 @@
 #include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
 
 namespace JSC {
 
-class SourceProviderCache {
+class SourceProviderCache : public RefCounted<SourceProviderCache> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    SourceProviderCache() : m_contentByteSize(0) {}
+    SourceProviderCache() { }
     JS_EXPORT_PRIVATE ~SourceProviderCache();
 
     JS_EXPORT_PRIVATE void clear();
-    JS_EXPORT_PRIVATE unsigned byteSize() const;
-    void add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem>, unsigned size);
+    void add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem>);
     const SourceProviderCacheItem* get(int sourcePosition) const { return m_map.get(sourcePosition); }
 
 private:
     HashMap<int, OwnPtr<SourceProviderCacheItem> > m_map;
-    unsigned m_contentByteSize;
 };
 
 }

Modified: trunk/Source/_javascript_Core/parser/SourceProviderCacheItem.h (143278 => 143279)


--- trunk/Source/_javascript_Core/parser/SourceProviderCacheItem.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/parser/SourceProviderCacheItem.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -55,15 +55,6 @@
     static PassOwnPtr<SourceProviderCacheItem> create(const SourceProviderCacheItemCreationParameters&);
     ~SourceProviderCacheItem();
 
-    unsigned approximateByteSize() const
-    {
-        // The identifiers are uniqued strings so most likely there are few names that actually use any additional memory.
-        static const unsigned assumedAverageIdentifierSize = sizeof(StringImpl*) + 2;
-        unsigned size = sizeof(*this);
-        size += usedVariablesCount * assumedAverageIdentifierSize;
-        size += writtenVariablesCount * assumedAverageIdentifierSize;
-        return size;
-    }
     JSToken closeBraceToken() const 
     {
         JSToken token;

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (143278 => 143279)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -57,6 +57,7 @@
 #include "ParserArena.h"
 #include "RegExpCache.h"
 #include "RegExpObject.h"
+#include "SourceProviderCache.h"
 #include "StrictEvalActivation.h"
 #include "StrongInlines.h"
 #include "UnlinkedCodeBlock.h"
@@ -456,6 +457,19 @@
 #endif
 }
 
+SourceProviderCache* JSGlobalData::addSourceProviderCache(SourceProvider* sourceProvider)
+{
+    SourceProviderCacheMap::AddResult addResult = sourceProviderCacheMap.add(sourceProvider, 0);
+    if (addResult.isNewEntry)
+        addResult.iterator->value = adoptRef(new SourceProviderCache);
+    return addResult.iterator->value.get();
+}
+
+void JSGlobalData::clearSourceProviderCaches()
+{
+    sourceProviderCacheMap.clear();
+}
+
 struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
     HashSet<FunctionExecutable*> currentlyExecutingFunctions;
     void operator()(JSCell* cell)

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (143278 => 143279)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -82,6 +82,8 @@
     class NativeExecutable;
     class ParserArena;
     class RegExpCache;
+    class SourceProvider;
+    class SourceProviderCache;
     class Stringifier;
     class Structure;
 #if ENABLE(REGEXP_TRACING)
@@ -303,9 +305,14 @@
         bool canUseRegExpJIT() { return false; } // interpreter only
 #endif
 
+        SourceProviderCache* addSourceProviderCache(SourceProvider*);
+        void clearSourceProviderCaches();
+
         PrototypeMap prototypeMap;
 
         OwnPtr<ParserArena> parserArena;
+        typedef HashMap<RefPtr<SourceProvider>, RefPtr<SourceProviderCache> > SourceProviderCacheMap;
+        SourceProviderCacheMap sourceProviderCacheMap;
         OwnPtr<Keywords> keywords;
         Interpreter* interpreter;
 #if ENABLE(JIT)

Modified: trunk/Source/WebCore/ChangeLog (143278 => 143279)


--- trunk/Source/WebCore/ChangeLog	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/WebCore/ChangeLog	2013-02-19 01:39:12 UTC (rev 143279)
@@ -1,3 +1,26 @@
+2013-02-18  Geoffrey Garen  <gga...@apple.com>
+
+        Shrank the SourceProvider cache
+        https://bugs.webkit.org/show_bug.cgi?id=110158
+
+        Reviewed by Oliver Hunt.
+
+        Test: fast/js/regress/nested-function-parsing.html
+
+        No need to keep statistics on cache size, since we're going to throw it
+        away no matter what.
+
+        * WebCore.order:
+        * bindings/js/CachedScriptSourceProvider.h:
+        (CachedScriptSourceProvider):
+        (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
+        * loader/cache/CachedScript.cpp:
+        (WebCore::CachedScript::destroyDecodedData):
+        (WebCore):
+        (WebCore::CachedScript::reportMemoryUsage):
+        * loader/cache/CachedScript.h:
+        (CachedScript):
+
 2013-02-18  pe...@outlook.com  <pe...@outlook.com>
 
         [Curl] The function cookiesForDOM() does not behave correctly.

Modified: trunk/Source/WebCore/WebCore.order (143278 => 143279)


--- trunk/Source/WebCore/WebCore.order	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/WebCore/WebCore.order	2013-02-19 01:39:12 UTC (rev 143279)
@@ -4000,8 +4000,6 @@
 __ZThn40_N7WebCore18HTMLDocumentParser19stopWatchingForLoadEPNS_14CachedResourceE
 __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
 __ZNK7WebCore26CachedScriptSourceProvider4dataEv
-__ZN7WebCore26CachedScriptSourceProvider16cacheSizeChangedEi
-__ZN7WebCore12CachedScript30sourceProviderCacheSizeChangedEi
 __ZN7WebCore17CheckboxInputType6createEPNS_16HTMLInputElementE
 __ZNK7WebCore17CheckboxInputType15formControlTypeEv
 __ZN7WebCore14InputTypeNames8checkboxEv

Modified: trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h (143278 => 143279)


--- trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -46,14 +46,9 @@
 
     const String& source() const { return m_cachedScript->script(); }
 
-    virtual void cacheSizeChanged(int delta)
-    {
-        m_cachedScript->sourceProviderCacheSizeChanged(delta);
-    }
-
 private:
     CachedScriptSourceProvider(CachedScript* cachedScript)
-        : SourceProvider(cachedScript->response().url(), TextPosition::minimumPosition(), cachedScript->sourceProviderCache())
+        : SourceProvider(cachedScript->response().url(), TextPosition::minimumPosition())
         , m_cachedScript(cachedScript)
     {
         m_cachedScript->addClient(this);

Modified: trunk/Source/WebCore/loader/cache/CachedScript.cpp (143278 => 143279)


--- trunk/Source/WebCore/loader/cache/CachedScript.cpp	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/WebCore/loader/cache/CachedScript.cpp	2013-02-19 01:39:12 UTC (rev 143279)
@@ -37,11 +37,6 @@
 #include "WebCoreMemoryInstrumentation.h"
 #include <wtf/Vector.h>
 
-#if USE(JSC)  
-#include <parser/SourceProvider.h>
-#include <parser/SourceProviderCache.h>
-#endif
-
 namespace WebCore {
 
 CachedScript::CachedScript(const ResourceRequest& resourceRequest, const String& charset)
@@ -101,32 +96,11 @@
 void CachedScript::destroyDecodedData()
 {
     m_script = String();
-    unsigned extraSize = 0;
-#if USE(JSC)
-    if (m_sourceProviderCache && m_clients.isEmpty())
-        m_sourceProviderCache->clear();
-
-    extraSize = m_sourceProviderCache ? m_sourceProviderCache->byteSize() : 0;
-#endif
-    setDecodedSize(extraSize);
+    setDecodedSize(0);
     if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
         makePurgeable(true);
 }
 
-#if USE(JSC)
-JSC::SourceProviderCache* CachedScript::sourceProviderCache() const
-{   
-    if (!m_sourceProviderCache) 
-        m_sourceProviderCache = adoptPtr(new JSC::SourceProviderCache); 
-    return m_sourceProviderCache.get(); 
-}
-
-void CachedScript::sourceProviderCacheSizeChanged(int delta)
-{
-    setDecodedSize(decodedSize() + delta);
-}
-#endif
-
 #if ENABLE(NOSNIFF)
 bool CachedScript::mimeTypeAllowedByNosniff() const
 {
@@ -140,9 +114,6 @@
     CachedResource::reportMemoryUsage(memoryObjectInfo);
     info.addMember(m_script, "script");
     info.addMember(m_decoder, "decoder");
-#if USE(JSC)
-    info.addMember(m_sourceProviderCache, "sourceProviderCache");
-#endif
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/loader/cache/CachedScript.h (143278 => 143279)


--- trunk/Source/WebCore/loader/cache/CachedScript.h	2013-02-19 01:29:12 UTC (rev 143278)
+++ trunk/Source/WebCore/loader/cache/CachedScript.h	2013-02-19 01:39:12 UTC (rev 143279)
@@ -28,12 +28,6 @@
 
 #include "CachedResource.h"
 
-#if USE(JSC)
-namespace JSC {
-    class SourceProviderCache;
-}
-#endif
-
 namespace WebCore {
 
     class CachedResourceLoader;
@@ -52,11 +46,6 @@
         String mimeType() const;
 
         virtual void destroyDecodedData();
-#if USE(JSC)        
-        // Allows JSC to cache additional information about the source.
-        JSC::SourceProviderCache* sourceProviderCache() const;
-        void sourceProviderCacheSizeChanged(int delta);
-#endif
 #if ENABLE(NOSNIFF)
         bool mimeTypeAllowedByNosniff() const;
 #endif
@@ -68,9 +57,6 @@
 
         String m_script;
         RefPtr<TextResourceDecoder> m_decoder;
-#if USE(JSC)        
-        mutable OwnPtr<JSC::SourceProviderCache> m_sourceProviderCache;
-#endif
     };
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to