<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[218641] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/218641">218641</a></dd>
<dt>Author</dt> <dd>sbarati@apple.com</dd>
<dt>Date</dt> <dd>2017-06-21 11:42:44 -0700 (Wed, 21 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make it clear that regenerating ICs are holding the CodeBlock's lock by passing the locker as a parameter
https://bugs.webkit.org/show_bug.cgi?id=173609

Reviewed by Keith Miller.

This patch makes many of the IC generating functions require a locker as
a parameter. We do this in other places in JSC to indicate that
a particular API is only valid while a particular lock is held.
This is the case when generating ICs. This patch just makes it
explicit in the IC generating interface.

* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::addCases):
(JSC::PolymorphicAccess::addCase):
(JSC::PolymorphicAccess::commit):
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::addAccessCase):
(JSC::StructureStubInfo::initStub): Deleted.
* bytecode/StructureStubInfo.h:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::tryCachePutByID):
(JSC::repatchPutByID):
(JSC::tryRepatchIn):
(JSC::repatchIn):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicAccesscpp">trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicAccessh">trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeStructureStubInfocpp">trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeStructureStubInfoh">trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitRepatchcpp">trunk/Source/JavaScriptCore/jit/Repatch.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/ChangeLog       2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-06-21  Saam Barati  <sbarati@apple.com>
+
+        Make it clear that regenerating ICs are holding the CodeBlock's lock by passing the locker as a parameter
+        https://bugs.webkit.org/show_bug.cgi?id=173609
+
+        Reviewed by Keith Miller.
+
+        This patch makes many of the IC generating functions require a locker as
+        a parameter. We do this in other places in JSC to indicate that
+        a particular API is only valid while a particular lock is held.
+        This is the case when generating ICs. This patch just makes it
+        explicit in the IC generating interface.
+
+        * bytecode/PolymorphicAccess.cpp:
+        (JSC::PolymorphicAccess::addCases):
+        (JSC::PolymorphicAccess::addCase):
+        (JSC::PolymorphicAccess::commit):
+        (JSC::PolymorphicAccess::regenerate):
+        * bytecode/PolymorphicAccess.h:
+        * bytecode/StructureStubInfo.cpp:
+        (JSC::StructureStubInfo::addAccessCase):
+        (JSC::StructureStubInfo::initStub): Deleted.
+        * bytecode/StructureStubInfo.h:
+        * jit/Repatch.cpp:
+        (JSC::tryCacheGetByID):
+        (JSC::repatchGetByID):
+        (JSC::tryCachePutByID):
+        (JSC::repatchPutByID):
+        (JSC::tryRepatchIn):
+        (JSC::repatchIn):
+
</ins><span class="cx"> 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Disable font variations on macOS Sierra and iOS 10
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicAccesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp       2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp  2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -210,8 +210,8 @@
</span><span class="cx"> PolymorphicAccess::~PolymorphicAccess() { }
</span><span class="cx"> 
</span><span class="cx"> AccessGenerationResult PolymorphicAccess::addCases(
</span><del>-    VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo, const Identifier& ident,
-    Vector<std::unique_ptr<AccessCase>, 2> originalCasesToAdd)
</del><ins>+    const GCSafeConcurrentJSLocker& locker, VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo,
+    const Identifier& ident, Vector<std::unique_ptr<AccessCase>, 2> originalCasesToAdd)
</ins><span class="cx"> {
</span><span class="cx">     SuperSamplerScope superSamplerScope(false);
</span><span class="cx">     
</span><span class="lines">@@ -258,7 +258,7 @@
</span><span class="cx">     // Now add things to the new list. Note that at this point, we will still have old cases that
</span><span class="cx">     // may be replaced by the new ones. That's fine. We will sort that out when we regenerate.
</span><span class="cx">     for (auto& caseToAdd : casesToAdd) {
</span><del>-        commit(vm, m_watchpoints, codeBlock, stubInfo, ident, *caseToAdd);
</del><ins>+        commit(locker, vm, m_watchpoints, codeBlock, stubInfo, ident, *caseToAdd);
</ins><span class="cx">         m_list.append(WTFMove(caseToAdd));
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -269,12 +269,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessGenerationResult PolymorphicAccess::addCase(
</span><del>-    VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo, const Identifier& ident,
-    std::unique_ptr<AccessCase> newAccess)
</del><ins>+    const GCSafeConcurrentJSLocker& locker, VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo,
+    const Identifier& ident, std::unique_ptr<AccessCase> newAccess)
</ins><span class="cx"> {
</span><span class="cx">     Vector<std::unique_ptr<AccessCase>, 2> newAccesses;
</span><span class="cx">     newAccesses.append(WTFMove(newAccess));
</span><del>-    return addCases(vm, codeBlock, stubInfo, ident, WTFMove(newAccesses));
</del><ins>+    return addCases(locker, vm, codeBlock, stubInfo, ident, WTFMove(newAccesses));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PolymorphicAccess::visitWeak(VM& vm) const
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PolymorphicAccess::commit(
</span><del>-    VM& vm, std::unique_ptr<WatchpointsOnStructureStubInfo>& watchpoints, CodeBlock* codeBlock,
</del><ins>+    const GCSafeConcurrentJSLocker&, VM& vm, std::unique_ptr<WatchpointsOnStructureStubInfo>& watchpoints, CodeBlock* codeBlock,
</ins><span class="cx">     StructureStubInfo& stubInfo, const Identifier& ident, AccessCase& accessCase)
</span><span class="cx"> {
</span><span class="cx">     // NOTE: We currently assume that this is relatively rare. It mainly arises for accesses to
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessGenerationResult PolymorphicAccess::regenerate(
</span><del>-    VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo, const Identifier& ident)
</del><ins>+    const GCSafeConcurrentJSLocker& locker, VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo, const Identifier& ident)
</ins><span class="cx"> {
</span><span class="cx">     SuperSamplerScope superSamplerScope(false);
</span><span class="cx">     
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">     bool allGuardedByStructureCheck = true;
</span><span class="cx">     bool hasJSGetterSetterCall = false;
</span><span class="cx">     for (auto& newCase : cases) {
</span><del>-        commit(vm, state.watchpoints, codeBlock, stubInfo, ident, *newCase);
</del><ins>+        commit(locker, vm, state.watchpoints, codeBlock, stubInfo, ident, *newCase);
</ins><span class="cx">         allGuardedByStructureCheck &= newCase->guardedByStructureCheck();
</span><span class="cx">         if (newCase->type() == AccessCase::Getter || newCase->type() == AccessCase::Setter)
</span><span class="cx">             hasJSGetterSetterCall = true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicAccessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h 2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h    2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -125,12 +125,12 @@
</span><span class="cx">     // When this fails (returns GaveUp), this will leave the old stub intact but you should not try
</span><span class="cx">     // to call this method again for that PolymorphicAccess instance.
</span><span class="cx">     AccessGenerationResult addCases(
</span><del>-        VM&, CodeBlock*, StructureStubInfo&, const Identifier&, Vector<std::unique_ptr<AccessCase>, 2>);
</del><ins>+        const GCSafeConcurrentJSLocker&, VM&, CodeBlock*, StructureStubInfo&, const Identifier&, Vector<std::unique_ptr<AccessCase>, 2>);
</ins><span class="cx"> 
</span><span class="cx">     AccessGenerationResult addCase(
</span><del>-        VM&, CodeBlock*, StructureStubInfo&, const Identifier&, std::unique_ptr<AccessCase>);
</del><ins>+        const GCSafeConcurrentJSLocker&, VM&, CodeBlock*, StructureStubInfo&, const Identifier&, std::unique_ptr<AccessCase>);
</ins><span class="cx">     
</span><del>-    AccessGenerationResult regenerate(VM&, CodeBlock*, StructureStubInfo&, const Identifier&);
</del><ins>+    AccessGenerationResult regenerate(const GCSafeConcurrentJSLocker&, VM&, CodeBlock*, StructureStubInfo&, const Identifier&);
</ins><span class="cx">     
</span><span class="cx">     bool isEmpty() const { return m_list.isEmpty(); }
</span><span class="cx">     unsigned size() const { return m_list.size(); }
</span><span class="lines">@@ -164,12 +164,9 @@
</span><span class="cx">     typedef Vector<std::unique_ptr<AccessCase>, 2> ListType;
</span><span class="cx">     
</span><span class="cx">     void commit(
</span><del>-        VM&, std::unique_ptr<WatchpointsOnStructureStubInfo>&, CodeBlock*, StructureStubInfo&,
</del><ins>+        const GCSafeConcurrentJSLocker&, VM&, std::unique_ptr<WatchpointsOnStructureStubInfo>&, CodeBlock*, StructureStubInfo&,
</ins><span class="cx">         const Identifier&, AccessCase&);
</span><span class="cx"> 
</span><del>-    MacroAssemblerCodePtr regenerate(
-        VM&, CodeBlock*, StructureStubInfo&, const Identifier&, ListType& cases);
-
</del><span class="cx">     ListType m_list;
</span><span class="cx">     RefPtr<JITStubRoutine> m_stubRoutine;
</span><span class="cx">     std::unique_ptr<WatchpointsOnStructureStubInfo> m_watchpoints;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeStructureStubInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp       2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp  2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -78,12 +78,6 @@
</span><span class="cx">     u.byIdSelf.offset = offset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void StructureStubInfo::initStub(CodeBlock*, std::unique_ptr<PolymorphicAccess> stub)
-{
-    cacheType = CacheType::Stub;
-    u.stub = stub.release();
-}
-
</del><span class="cx"> void StructureStubInfo::deref()
</span><span class="cx"> {
</span><span class="cx">     switch (cacheType) {
</span><span class="lines">@@ -117,7 +111,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessGenerationResult StructureStubInfo::addAccessCase(
</span><del>-    CodeBlock* codeBlock, const Identifier& ident, std::unique_ptr<AccessCase> accessCase)
</del><ins>+    const GCSafeConcurrentJSLocker& locker, CodeBlock* codeBlock, const Identifier& ident, std::unique_ptr<AccessCase> accessCase)
</ins><span class="cx"> {
</span><span class="cx">     VM& vm = *codeBlock->vm();
</span><span class="cx">     
</span><span class="lines">@@ -130,7 +124,7 @@
</span><span class="cx">     AccessGenerationResult result;
</span><span class="cx">     
</span><span class="cx">     if (cacheType == CacheType::Stub) {
</span><del>-        result = u.stub->addCase(vm, codeBlock, *this, ident, WTFMove(accessCase));
</del><ins>+        result = u.stub->addCase(locker, vm, codeBlock, *this, ident, WTFMove(accessCase));
</ins><span class="cx">         
</span><span class="cx">         if (verbose)
</span><span class="cx">             dataLog("Had stub, result: ", result, "\n");
</span><span class="lines">@@ -151,7 +145,7 @@
</span><span class="cx">         
</span><span class="cx">         accessCases.append(WTFMove(accessCase));
</span><span class="cx">         
</span><del>-        result = access->addCases(vm, codeBlock, *this, ident, WTFMove(accessCases));
</del><ins>+        result = access->addCases(locker, vm, codeBlock, *this, ident, WTFMove(accessCases));
</ins><span class="cx">         
</span><span class="cx">         if (verbose)
</span><span class="cx">             dataLog("Created stub, result: ", result, "\n");
</span><span class="lines">@@ -161,7 +155,8 @@
</span><span class="cx">             return result;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        initStub(codeBlock, WTFMove(access));
</del><ins>+        cacheType = CacheType::Stub;
+        u.stub = access.release();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     RELEASE_ASSERT(!result.generatedSomeCode());
</span><span class="lines">@@ -186,7 +181,7 @@
</span><span class="cx">     // PolymorphicAccess.
</span><span class="cx">     bufferedStructures.clear();
</span><span class="cx">     
</span><del>-    result = u.stub->regenerate(vm, codeBlock, *this, ident);
</del><ins>+    result = u.stub->regenerate(locker, vm, codeBlock, *this, ident);
</ins><span class="cx">     
</span><span class="cx">     if (verbose)
</span><span class="cx">         dataLog("Regeneration result: ", result, "\n");
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeStructureStubInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h 2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h    2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -71,9 +71,8 @@
</span><span class="cx">     void initGetByIdSelf(CodeBlock*, Structure* baseObjectStructure, PropertyOffset);
</span><span class="cx">     void initArrayLength();
</span><span class="cx">     void initPutByIdReplace(CodeBlock*, Structure* baseObjectStructure, PropertyOffset);
</span><del>-    void initStub(CodeBlock*, std::unique_ptr<PolymorphicAccess>);
</del><span class="cx"> 
</span><del>-    AccessGenerationResult addAccessCase(CodeBlock*, const Identifier&, std::unique_ptr<AccessCase>);
</del><ins>+    AccessGenerationResult addAccessCase(const GCSafeConcurrentJSLocker&, CodeBlock*, const Identifier&, std::unique_ptr<AccessCase>);
</ins><span class="cx"> 
</span><span class="cx">     void reset(CodeBlock*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitRepatchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/Repatch.cpp (218640 => 218641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/Repatch.cpp      2017-06-21 18:37:02 UTC (rev 218640)
+++ trunk/Source/JavaScriptCore/jit/Repatch.cpp 2017-06-21 18:42:44 UTC (rev 218641)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     return operationTryGetById;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static InlineCacheAction tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot, StructureStubInfo& stubInfo, GetByIDKind kind)
</del><ins>+static InlineCacheAction tryCacheGetByID(const GCSafeConcurrentJSLocker& locker, ExecState* exec, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot, StructureStubInfo& stubInfo, GetByIDKind kind)
</ins><span class="cx"> {
</span><span class="cx">     if (forceICFailure(exec))
</span><span class="cx">         return GiveUpOnCache;
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx"> 
</span><span class="cx">     LOG_IC((ICEvent::GetByIdAddAccessCase, baseValue.classInfoOrNull(vm), propertyName));
</span><span class="cx"> 
</span><del>-    AccessGenerationResult result = stubInfo.addAccessCase(codeBlock, propertyName, WTFMove(newCase));
</del><ins>+    AccessGenerationResult result = stubInfo.addAccessCase(locker, codeBlock, propertyName, WTFMove(newCase));
</ins><span class="cx"> 
</span><span class="cx">     if (result.generatedSomeCode()) {
</span><span class="cx">         LOG_IC((ICEvent::GetByIdReplaceWithJump, baseValue.classInfoOrNull(vm), propertyName));
</span><span class="lines">@@ -340,7 +340,7 @@
</span><span class="cx">     SuperSamplerScope superSamplerScope(false);
</span><span class="cx">     GCSafeConcurrentJSLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
</span><span class="cx">     
</span><del>-    if (tryCacheGetByID(exec, baseValue, propertyName, slot, stubInfo, kind) == GiveUpOnCache)
</del><ins>+    if (tryCacheGetByID(locker, exec, baseValue, propertyName, slot, stubInfo, kind) == GiveUpOnCache)
</ins><span class="cx">         ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), appropriateGenericGetByIdFunction(kind));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx">     return operationPutByIdNonStrictOptimize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static InlineCacheAction tryCachePutByID(ExecState* exec, JSValue baseValue, Structure* structure, const Identifier& ident, const PutPropertySlot& slot, StructureStubInfo& stubInfo, PutKind putKind)
</del><ins>+static InlineCacheAction tryCachePutByID(const GCSafeConcurrentJSLocker& locker, ExecState* exec, JSValue baseValue, Structure* structure, const Identifier& ident, const PutPropertySlot& slot, StructureStubInfo& stubInfo, PutKind putKind)
</ins><span class="cx"> {
</span><span class="cx">     if (forceICFailure(exec))
</span><span class="cx">         return GiveUpOnCache;
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx"> 
</span><span class="cx">     LOG_IC((ICEvent::PutByIdAddAccessCase, structure->classInfo(), ident));
</span><span class="cx">     
</span><del>-    AccessGenerationResult result = stubInfo.addAccessCase(codeBlock, ident, WTFMove(newCase));
</del><ins>+    AccessGenerationResult result = stubInfo.addAccessCase(locker, codeBlock, ident, WTFMove(newCase));
</ins><span class="cx">     
</span><span class="cx">     if (result.generatedSomeCode()) {
</span><span class="cx">         LOG_IC((ICEvent::PutByIdReplaceWithJump, structure->classInfo(), ident));
</span><span class="lines">@@ -494,13 +494,13 @@
</span><span class="cx">     SuperSamplerScope superSamplerScope(false);
</span><span class="cx">     GCSafeConcurrentJSLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
</span><span class="cx">     
</span><del>-    if (tryCachePutByID(exec, baseValue, structure, propertyName, slot, stubInfo, putKind) == GiveUpOnCache)
</del><ins>+    if (tryCachePutByID(locker, exec, baseValue, structure, propertyName, slot, stubInfo, putKind) == GiveUpOnCache)
</ins><span class="cx">         ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), appropriateGenericPutByIdFunction(slot, putKind));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static InlineCacheAction tryRepatchIn(
</span><del>-    ExecState* exec, JSCell* base, const Identifier& ident, bool wasFound,
-    const PropertySlot& slot, StructureStubInfo& stubInfo)
</del><ins>+    const GCSafeConcurrentJSLocker& locker, ExecState* exec, JSCell* base, const Identifier& ident,
+    bool wasFound, const PropertySlot& slot, StructureStubInfo& stubInfo)
</ins><span class="cx"> {
</span><span class="cx">     if (forceICFailure(exec))
</span><span class="cx">         return GiveUpOnCache;
</span><span class="lines">@@ -535,7 +535,7 @@
</span><span class="cx">     std::unique_ptr<AccessCase> newCase = AccessCase::create(
</span><span class="cx">         vm, codeBlock, wasFound ? AccessCase::InHit : AccessCase::InMiss, invalidOffset, structure, conditionSet);
</span><span class="cx"> 
</span><del>-    AccessGenerationResult result = stubInfo.addAccessCase(codeBlock, ident, WTFMove(newCase));
</del><ins>+    AccessGenerationResult result = stubInfo.addAccessCase(locker, codeBlock, ident, WTFMove(newCase));
</ins><span class="cx">     
</span><span class="cx">     if (result.generatedSomeCode()) {
</span><span class="cx">         LOG_IC((ICEvent::InReplaceWithJump, structure->classInfo(), ident));
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx"> {
</span><span class="cx">     SuperSamplerScope superSamplerScope(false);
</span><span class="cx">     GCSafeConcurrentJSLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
</span><del>-    if (tryRepatchIn(exec, base, ident, wasFound, slot, stubInfo) == GiveUpOnCache)
</del><ins>+    if (tryRepatchIn(locker, exec, base, ident, wasFound, slot, stubInfo) == GiveUpOnCache)
</ins><span class="cx">         ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), operationIn);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>