getUnlinkedGlobalFunctionExecutable should only save things to the code cache if...
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:43:42 +0000 (20:43 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:43:42 +0000 (20:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184998

Reviewed by Saam Barati.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231018 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/CodeCache.cpp

index 6431338..f44fc2e 100644 (file)
@@ -1,5 +1,15 @@
 2018-04-25  Keith Miller  <keith_miller@apple.com>
 
+        getUnlinkedGlobalFunctionExecutable should only save things to the code cache if the option is set
+        https://bugs.webkit.org/show_bug.cgi?id=184998
+
+        Reviewed by Saam Barati.
+
+        * runtime/CodeCache.cpp:
+        (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):
+
+2018-04-25  Keith Miller  <keith_miller@apple.com>
+
         Add missing scope release to functionProtoFuncToString
         https://bugs.webkit.org/show_bug.cgi?id=184995
 
index ad25439..106ffcd 100644 (file)
@@ -158,7 +158,8 @@ UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& v
     functionExecutable->setSourceURLDirective(source.provider()->sourceURL());
     functionExecutable->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
 
-    m_sourceCode.addCache(key, SourceCodeValue(vm, functionExecutable, m_sourceCode.age()));
+    if (Options::useCodeCache())
+        m_sourceCode.addCache(key, SourceCodeValue(vm, functionExecutable, m_sourceCode.age()));
     return functionExecutable;
 }