<!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>[189278] 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/189278">189278</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2015-09-03 12:41:42 -0700 (Thu, 03 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>RepatchBuffer should be stateless
https://bugs.webkit.org/show_bug.cgi?id=148741

Reviewed by Geoffrey Garen.

This removes our reliance on RepatchBuffer having a pointer to CodeBlock. This is in
preparation for removing RepatchBuffer entirely (see
https://bugs.webkit.org/show_bug.cgi?id=148742). In the longer term, this is necessary
for making inline cache code, particularly in StructureStubInfo, more self-contained.
Currently StructureStubInfo relies on very pointless-looking methods in CodeBlock to
clear itself, and the only thing that those methods do is create a RepatchBuffer. It's
quite silly.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::allocate):
(JSC::LinkBuffer::performFinalization):
* assembler/RepatchBuffer.h:
(JSC::RepatchBuffer::RepatchBuffer):
(JSC::RepatchBuffer::~RepatchBuffer):
(JSC::RepatchBuffer::relink):
(JSC::RepatchBuffer::revertJumpReplacementToPatchableBranch32WithPatch):
(JSC::RepatchBuffer::codeBlock): Deleted.
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::clearStub):
(JSC::CallLinkInfo::unlink):
(JSC::CallLinkInfo::visitWeak):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::registerPreservationMode):
(JSC::CallLinkInfo::isLinked):
(JSC::CallLinkInfo::setUpCall):
(JSC::CallLinkInfo::codeOrigin):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::resetStubInternal):
(JSC::CodeBlock::unlinkIncomingCalls):
* bytecode/PolymorphicGetByIdList.cpp:
(JSC::GetByIdAccess::fromStructureStubInfo):
(JSC::GetByIdAccess::visitWeak):
(JSC::PolymorphicGetByIdList::didSelfPatching):
(JSC::PolymorphicGetByIdList::visitWeak):
* bytecode/PolymorphicGetByIdList.h:
(JSC::GetByIdAccess::doesCalls):
* bytecode/PolymorphicPutByIdList.cpp:
(JSC::PutByIdAccess::fromStructureStubInfo):
(JSC::PutByIdAccess::visitWeak):
(JSC::PolymorphicPutByIdList::addAccess):
(JSC::PolymorphicPutByIdList::visitWeak):
* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::customSetter):
(JSC::PolymorphicPutByIdList::kind):
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::deref):
(JSC::StructureStubInfo::visitWeakReferences):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::seenOnce):
* jit/AccessorCallJITStubRoutine.cpp:
(JSC::AccessorCallJITStubRoutine::~AccessorCallJITStubRoutine):
(JSC::AccessorCallJITStubRoutine::visitWeak):
* jit/AccessorCallJITStubRoutine.h:
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::makeWritable): Deleted.
(JSC::ExecutableAllocator::makeExecutable): Deleted.
(JSC::ExecutableAllocator::allocator): Deleted.
* jit/JITStubRoutine.cpp:
(JSC::JITStubRoutine::~JITStubRoutine):
(JSC::JITStubRoutine::visitWeak):
* jit/JITStubRoutine.h:
* jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallNode::~PolymorphicCallNode):
(JSC::PolymorphicCallNode::unlink):
(JSC::PolymorphicCallStubRoutine::clearCallNodesFor):
(JSC::PolymorphicCallStubRoutine::visitWeak):
* jit/PolymorphicCallStubRoutine.h:
(JSC::PolymorphicCallNode::hasCallLinkInfo):
* jit/Repatch.cpp:
(JSC::readCallTarget):
(JSC::repatchCall):
(JSC::repatchByIdSelfAccess):
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryBuildPutByIdList):
(JSC::revertCall):
(JSC::unlinkFor):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
(JSC::resetGetByID):
(JSC::resetPutByID):
(JSC::resetIn):
* jit/Repatch.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerLinkBuffercpp">trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerRepatchBufferh">trunk/Source/JavaScriptCore/assembler/RepatchBuffer.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCallLinkInfocpp">trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCallLinkInfoh">trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicGetByIdListcpp">trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicGetByIdListh">trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicPutByIdListcpp">trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePolymorphicPutByIdListh">trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.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="#trunkSourceJavaScriptCorejitAccessorCallJITStubRoutinecpp">trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitAccessorCallJITStubRoutineh">trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorh">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubRoutinecpp">trunk/Source/JavaScriptCore/jit/JITStubRoutine.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubRoutineh">trunk/Source/JavaScriptCore/jit/JITStubRoutine.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitPolymorphicCallStubRoutinecpp">trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitPolymorphicCallStubRoutineh">trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitRepatchcpp">trunk/Source/JavaScriptCore/jit/Repatch.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitRepatchh">trunk/Source/JavaScriptCore/jit/Repatch.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -1,3 +1,95 @@
</span><ins>+2015-09-03  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        RepatchBuffer should be stateless
+        https://bugs.webkit.org/show_bug.cgi?id=148741
+
+        Reviewed by Geoffrey Garen.
+
+        This removes our reliance on RepatchBuffer having a pointer to CodeBlock. This is in
+        preparation for removing RepatchBuffer entirely (see
+        https://bugs.webkit.org/show_bug.cgi?id=148742). In the longer term, this is necessary
+        for making inline cache code, particularly in StructureStubInfo, more self-contained.
+        Currently StructureStubInfo relies on very pointless-looking methods in CodeBlock to
+        clear itself, and the only thing that those methods do is create a RepatchBuffer. It's
+        quite silly.
+
+        * assembler/LinkBuffer.cpp:
+        (JSC::LinkBuffer::allocate):
+        (JSC::LinkBuffer::performFinalization):
+        * assembler/RepatchBuffer.h:
+        (JSC::RepatchBuffer::RepatchBuffer):
+        (JSC::RepatchBuffer::~RepatchBuffer):
+        (JSC::RepatchBuffer::relink):
+        (JSC::RepatchBuffer::revertJumpReplacementToPatchableBranch32WithPatch):
+        (JSC::RepatchBuffer::codeBlock): Deleted.
+        * bytecode/CallLinkInfo.cpp:
+        (JSC::CallLinkInfo::clearStub):
+        (JSC::CallLinkInfo::unlink):
+        (JSC::CallLinkInfo::visitWeak):
+        * bytecode/CallLinkInfo.h:
+        (JSC::CallLinkInfo::registerPreservationMode):
+        (JSC::CallLinkInfo::isLinked):
+        (JSC::CallLinkInfo::setUpCall):
+        (JSC::CallLinkInfo::codeOrigin):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::finalizeUnconditionally):
+        (JSC::CodeBlock::resetStubInternal):
+        (JSC::CodeBlock::unlinkIncomingCalls):
+        * bytecode/PolymorphicGetByIdList.cpp:
+        (JSC::GetByIdAccess::fromStructureStubInfo):
+        (JSC::GetByIdAccess::visitWeak):
+        (JSC::PolymorphicGetByIdList::didSelfPatching):
+        (JSC::PolymorphicGetByIdList::visitWeak):
+        * bytecode/PolymorphicGetByIdList.h:
+        (JSC::GetByIdAccess::doesCalls):
+        * bytecode/PolymorphicPutByIdList.cpp:
+        (JSC::PutByIdAccess::fromStructureStubInfo):
+        (JSC::PutByIdAccess::visitWeak):
+        (JSC::PolymorphicPutByIdList::addAccess):
+        (JSC::PolymorphicPutByIdList::visitWeak):
+        * bytecode/PolymorphicPutByIdList.h:
+        (JSC::PutByIdAccess::customSetter):
+        (JSC::PolymorphicPutByIdList::kind):
+        * bytecode/StructureStubInfo.cpp:
+        (JSC::StructureStubInfo::deref):
+        (JSC::StructureStubInfo::visitWeakReferences):
+        * bytecode/StructureStubInfo.h:
+        (JSC::StructureStubInfo::seenOnce):
+        * jit/AccessorCallJITStubRoutine.cpp:
+        (JSC::AccessorCallJITStubRoutine::~AccessorCallJITStubRoutine):
+        (JSC::AccessorCallJITStubRoutine::visitWeak):
+        * jit/AccessorCallJITStubRoutine.h:
+        * jit/ExecutableAllocator.h:
+        (JSC::ExecutableAllocator::makeWritable): Deleted.
+        (JSC::ExecutableAllocator::makeExecutable): Deleted.
+        (JSC::ExecutableAllocator::allocator): Deleted.
+        * jit/JITStubRoutine.cpp:
+        (JSC::JITStubRoutine::~JITStubRoutine):
+        (JSC::JITStubRoutine::visitWeak):
+        * jit/JITStubRoutine.h:
+        * jit/PolymorphicCallStubRoutine.cpp:
+        (JSC::PolymorphicCallNode::~PolymorphicCallNode):
+        (JSC::PolymorphicCallNode::unlink):
+        (JSC::PolymorphicCallStubRoutine::clearCallNodesFor):
+        (JSC::PolymorphicCallStubRoutine::visitWeak):
+        * jit/PolymorphicCallStubRoutine.h:
+        (JSC::PolymorphicCallNode::hasCallLinkInfo):
+        * jit/Repatch.cpp:
+        (JSC::readCallTarget):
+        (JSC::repatchCall):
+        (JSC::repatchByIdSelfAccess):
+        (JSC::tryCacheGetByID):
+        (JSC::tryCachePutByID):
+        (JSC::tryBuildPutByIdList):
+        (JSC::revertCall):
+        (JSC::unlinkFor):
+        (JSC::linkVirtualFor):
+        (JSC::linkPolymorphicCall):
+        (JSC::resetGetByID):
+        (JSC::resetPutByID):
+        (JSC::resetIn):
+        * jit/Repatch.h:
+
</ins><span class="cx"> 2015-09-02  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Replace all the various forms of branchStructure() with a single method in AssemblyHelpers
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerLinkBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -209,7 +209,6 @@
</span><span class="cx">     m_executableMemory = m_vm-&gt;executableAllocator.allocate(*m_vm, initialSize, ownerUID, effort);
</span><span class="cx">     if (!m_executableMemory)
</span><span class="cx">         return;
</span><del>-    ExecutableAllocator::makeWritable(m_executableMemory-&gt;start(), m_executableMemory-&gt;sizeInBytes());
</del><span class="cx">     m_code = m_executableMemory-&gt;start();
</span><span class="cx">     m_size = initialSize;
</span><span class="cx">     m_didAllocate = true;
</span><span class="lines">@@ -232,11 +231,6 @@
</span><span class="cx">     m_completed = true;
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-#if ENABLE(BRANCH_COMPACTION)
-    ExecutableAllocator::makeExecutable(code(), m_initialSize);
-#else
-    ExecutableAllocator::makeExecutable(code(), m_size);
-#endif
</del><span class="cx">     MacroAssembler::cacheFlush(code(), m_size);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerRepatchBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/RepatchBuffer.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/RepatchBuffer.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/assembler/RepatchBuffer.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -44,27 +44,14 @@
</span><span class="cx">     typedef MacroAssemblerCodePtr CodePtr;
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    RepatchBuffer(CodeBlock* codeBlock)
-        : m_codeBlock(codeBlock)
</del><ins>+    RepatchBuffer(CodeBlock*)
</ins><span class="cx">     {
</span><del>-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-        RefPtr&lt;JITCode&gt; code = codeBlock-&gt;jitCode();
-        m_start = code-&gt;start();
-        m_size = code-&gt;size();
-
-        ExecutableAllocator::makeWritable(m_start, m_size);
-#endif
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~RepatchBuffer()
</span><span class="cx">     {
</span><del>-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-        ExecutableAllocator::makeExecutable(m_start, m_size);
-#endif
</del><span class="cx">     }
</span><span class="cx">     
</span><del>-    CodeBlock* codeBlock() const { return m_codeBlock; }
-
</del><span class="cx">     void relink(CodeLocationJump jump, CodeLocationLabel destination)
</span><span class="cx">     {
</span><span class="cx">         MacroAssembler::repatchJump(jump, destination);
</span><span class="lines">@@ -185,13 +172,6 @@
</span><span class="cx">     {
</span><span class="cx">         MacroAssembler::revertJumpReplacementToPatchableBranch32WithPatch(instructionStart, address, value);
</span><span class="cx">     }
</span><del>-
-private:
-    CodeBlock* m_codeBlock;
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-    void* m_start;
-    size_t m_size;
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCallLinkInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     m_stub = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CallLinkInfo::unlink(RepatchBuffer&amp; repatchBuffer)
</del><ins>+void CallLinkInfo::unlink(VM&amp; vm, RepatchBuffer&amp; repatchBuffer)
</ins><span class="cx"> {
</span><span class="cx">     if (!isLinked()) {
</span><span class="cx">         // We could be called even if we're not linked anymore because of how polymorphic calls
</span><span class="lines">@@ -55,14 +55,14 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    unlinkFor(repatchBuffer, *this);
</del><ins>+    unlinkFor(vm, repatchBuffer, *this);
</ins><span class="cx"> 
</span><span class="cx">     // It will be on a list if the callee has a code block.
</span><span class="cx">     if (isOnList())
</span><span class="cx">         remove();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CallLinkInfo::visitWeak(RepatchBuffer&amp; repatchBuffer)
</del><ins>+void CallLinkInfo::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer)
</ins><span class="cx"> {
</span><span class="cx">     auto handleSpecificCallee = [&amp;] (JSFunction* callee) {
</span><span class="cx">         if (Heap::isMarked(callee-&gt;executable()))
</span><span class="lines">@@ -73,26 +73,26 @@
</span><span class="cx">     
</span><span class="cx">     if (isLinked()) {
</span><span class="cx">         if (stub()) {
</span><del>-            if (!stub()-&gt;visitWeak(repatchBuffer)) {
</del><ins>+            if (!stub()-&gt;visitWeak(vm, repatchBuffer)) {
</ins><span class="cx">                 if (Options::verboseOSR()) {
</span><span class="cx">                     dataLog(
</span><del>-                        &quot;Clearing closure call from &quot;, *repatchBuffer.codeBlock(), &quot; to &quot;,
</del><ins>+                        &quot;Clearing closure call to &quot;,
</ins><span class="cx">                         listDump(stub()-&gt;variants()), &quot;, stub routine &quot;, RawPointer(stub()),
</span><span class="cx">                         &quot;.\n&quot;);
</span><span class="cx">                 }
</span><del>-                unlink(repatchBuffer);
</del><ins>+                unlink(vm, repatchBuffer);
</ins><span class="cx">                 m_clearedByGC = true;
</span><span class="cx">             }
</span><span class="cx">         } else if (!Heap::isMarked(m_callee.get())) {
</span><span class="cx">             if (Options::verboseOSR()) {
</span><span class="cx">                 dataLog(
</span><del>-                    &quot;Clearing call from &quot;, *repatchBuffer.codeBlock(), &quot; to &quot;,
</del><ins>+                    &quot;Clearing call to &quot;,
</ins><span class="cx">                     RawPointer(m_callee.get()), &quot; (&quot;,
</span><span class="cx">                     m_callee.get()-&gt;executable()-&gt;hashFor(specializationKind()),
</span><span class="cx">                     &quot;).\n&quot;);
</span><span class="cx">             }
</span><span class="cx">             handleSpecificCallee(m_callee.get());
</span><del>-            unlink(repatchBuffer);
</del><ins>+            unlink(vm, repatchBuffer);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (haveLastSeenCallee() &amp;&amp; !Heap::isMarked(lastSeenCallee())) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCallLinkInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isLinked() { return m_stub || m_callee; }
</span><del>-    void unlink(RepatchBuffer&amp;);
</del><ins>+    void unlink(VM&amp;, RepatchBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void setUpCall(CallType callType, CodeOrigin codeOrigin, unsigned calleeGPR)
</span><span class="cx">     {
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">         return m_codeOrigin;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void visitWeak(RepatchBuffer&amp;);
</del><ins>+    void visitWeak(VM&amp;, RepatchBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CodeLocationNearCall m_callReturnLocation;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -2687,12 +2687,12 @@
</span><span class="cx">         RepatchBuffer repatchBuffer(this);
</span><span class="cx">         
</span><span class="cx">         for (auto iter = callLinkInfosBegin(); !!iter; ++iter)
</span><del>-            (*iter)-&gt;visitWeak(repatchBuffer);
</del><ins>+            (*iter)-&gt;visitWeak(*vm(), repatchBuffer);
</ins><span class="cx"> 
</span><span class="cx">         for (Bag&lt;StructureStubInfo&gt;::iterator iter = m_stubInfos.begin(); !!iter; ++iter) {
</span><span class="cx">             StructureStubInfo&amp; stubInfo = **iter;
</span><span class="cx">             
</span><del>-            if (stubInfo.visitWeakReferences(repatchBuffer))
</del><ins>+            if (stubInfo.visitWeakReferences(*vm(), repatchBuffer))
</ins><span class="cx">                 continue;
</span><span class="cx">             
</span><span class="cx">             resetStubDuringGCInternal(repatchBuffer, stubInfo);
</span><span class="lines">@@ -2799,12 +2799,12 @@
</span><span class="cx">     RELEASE_ASSERT(JITCode::isJIT(jitType()));
</span><span class="cx">     
</span><span class="cx">     if (isGetByIdAccess(accessType))
</span><del>-        resetGetByID(repatchBuffer, stubInfo);
</del><ins>+        resetGetByID(repatchBuffer, this, stubInfo);
</ins><span class="cx">     else if (isPutByIdAccess(accessType))
</span><del>-        resetPutByID(repatchBuffer, stubInfo);
</del><ins>+        resetPutByID(repatchBuffer, this, stubInfo);
</ins><span class="cx">     else {
</span><span class="cx">         RELEASE_ASSERT(isInAccess(accessType));
</span><del>-        resetIn(repatchBuffer, stubInfo);
</del><ins>+        resetIn(repatchBuffer, this, stubInfo);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     stubInfo.reset();
</span><span class="lines">@@ -3036,9 +3036,9 @@
</span><span class="cx">         return;
</span><span class="cx">     RepatchBuffer repatchBuffer(this);
</span><span class="cx">     while (m_incomingCalls.begin() != m_incomingCalls.end())
</span><del>-        m_incomingCalls.begin()-&gt;unlink(repatchBuffer);
</del><ins>+        m_incomingCalls.begin()-&gt;unlink(*vm(), repatchBuffer);
</ins><span class="cx">     while (m_incomingPolymorphicCalls.begin() != m_incomingPolymorphicCalls.end())
</span><del>-        m_incomingPolymorphicCalls.begin()-&gt;unlink(repatchBuffer);
</del><ins>+        m_incomingPolymorphicCalls.begin()-&gt;unlink(*vm(), repatchBuffer);
</ins><span class="cx"> #endif // ENABLE(JIT)
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicGetByIdListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -65,13 +65,13 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool GetByIdAccess::visitWeak(RepatchBuffer&amp; repatchBuffer) const
</del><ins>+bool GetByIdAccess::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer) const
</ins><span class="cx"> {
</span><span class="cx">     if (m_structure &amp;&amp; !Heap::isMarked(m_structure.get()))
</span><span class="cx">         return false;
</span><span class="cx">     if (!m_conditionSet.areStillLive())
</span><span class="cx">         return false;
</span><del>-    if (!m_stubRoutine-&gt;visitWeak(repatchBuffer))
</del><ins>+    if (!m_stubRoutine-&gt;visitWeak(vm, repatchBuffer))
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -139,10 +139,10 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PolymorphicGetByIdList::visitWeak(RepatchBuffer&amp; repatchBuffer) const
</del><ins>+bool PolymorphicGetByIdList::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer) const
</ins><span class="cx"> {
</span><span class="cx">     for (unsigned i = size(); i--;) {
</span><del>-        if (!at(i).visitWeak(repatchBuffer))
</del><ins>+        if (!at(i).visitWeak(vm, repatchBuffer))
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicGetByIdListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">     
</span><span class="cx">     bool doesCalls() const { return type() == Getter || type() == CustomGetter; }
</span><span class="cx">     
</span><del>-    bool visitWeak(RepatchBuffer&amp;) const;
</del><ins>+    bool visitWeak(VM&amp;, RepatchBuffer&amp;) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class CodeBlock;
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">     
</span><span class="cx">     bool didSelfPatching() const; // Are any of the accesses SimpleInline?
</span><span class="cx">     
</span><del>-    bool visitWeak(RepatchBuffer&amp;) const;
</del><ins>+    bool visitWeak(VM&amp;, RepatchBuffer&amp;) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class CodeBlock;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicPutByIdListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PutByIdAccess::visitWeak(RepatchBuffer&amp; repatchBuffer) const
</del><ins>+bool PutByIdAccess::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_conditionSet.areStillLive())
</span><span class="cx">         return false;
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    if (!m_stubRoutine-&gt;visitWeak(repatchBuffer))
</del><ins>+    if (!m_stubRoutine-&gt;visitWeak(vm, repatchBuffer))
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -142,10 +142,10 @@
</span><span class="cx">     m_list.last() = putByIdAccess;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PolymorphicPutByIdList::visitWeak(RepatchBuffer&amp; repatchBuffer) const
</del><ins>+bool PolymorphicPutByIdList::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer) const
</ins><span class="cx"> {
</span><span class="cx">     for (unsigned i = 0; i &lt; size(); ++i) {
</span><del>-        if (!at(i).visitWeak(repatchBuffer))
</del><ins>+        if (!at(i).visitWeak(vm, repatchBuffer))
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePolymorphicPutByIdListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/PolymorphicPutByIdList.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">         return m_customSetter;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool visitWeak(RepatchBuffer&amp;) const;
</del><ins>+    bool visitWeak(VM&amp;, RepatchBuffer&amp;) const;
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     friend class CodeBlock;
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">     
</span><span class="cx">     PutKind kind() const { return m_kind; }
</span><span class="cx">     
</span><del>-    bool visitWeak(RepatchBuffer&amp;) const;
</del><ins>+    bool visitWeak(VM&amp;, RepatchBuffer&amp;) const;
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     friend class CodeBlock;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeStructureStubInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StructureStubInfo::visitWeakReferences(RepatchBuffer&amp; repatchBuffer)
</del><ins>+bool StructureStubInfo::visitWeakReferences(VM&amp; vm, RepatchBuffer&amp; repatchBuffer)
</ins><span class="cx"> {
</span><span class="cx">     switch (accessType) {
</span><span class="cx">     case access_get_by_id_self:
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         break;
</span><span class="cx">     case access_get_by_id_list: {
</span><del>-        if (!u.getByIdList.list-&gt;visitWeak(repatchBuffer))
</del><ins>+        if (!u.getByIdList.list-&gt;visitWeak(vm, repatchBuffer))
</ins><span class="cx">             return false;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         break;
</span><span class="cx">     case access_put_by_id_list:
</span><del>-        if (!u.putByIdList.list-&gt;visitWeak(repatchBuffer))
</del><ins>+        if (!u.putByIdList.list-&gt;visitWeak(vm, repatchBuffer))
</ins><span class="cx">             return false;
</span><span class="cx">         break;
</span><span class="cx">     case access_in_list: {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeStructureStubInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">     // outgoing GC pointers are known to point to currently marked objects; this method is
</span><span class="cx">     // allowed to accomplish this by either clearing those pointers somehow or by proving that
</span><span class="cx">     // they have already been marked. It is not allowed to mark new objects.
</span><del>-    bool visitWeakReferences(RepatchBuffer&amp;);
</del><ins>+    bool visitWeakReferences(VM&amp;, RepatchBuffer&amp;);
</ins><span class="cx">         
</span><span class="cx">     bool seenOnce()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitAccessorCallJITStubRoutinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -43,9 +43,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AccessorCallJITStubRoutine::visitWeak(RepatchBuffer&amp; repatchBuffer)
</del><ins>+bool AccessorCallJITStubRoutine::visitWeak(VM&amp; vm, RepatchBuffer&amp; repatchBuffer)
</ins><span class="cx"> {
</span><del>-    m_callLinkInfo-&gt;visitWeak(repatchBuffer);
</del><ins>+    m_callLinkInfo-&gt;visitWeak(vm, repatchBuffer);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitAccessorCallJITStubRoutineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/AccessorCallJITStubRoutine.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     
</span><span class="cx">     virtual ~AccessorCallJITStubRoutine();
</span><span class="cx">     
</span><del>-    virtual bool visitWeak(RepatchBuffer&amp;) override;
</del><ins>+    virtual bool visitWeak(VM&amp;, RepatchBuffer&amp;) override;
</ins><span class="cx">     
</span><span class="cx">     std::unique_ptr&lt;CallLinkInfo&gt; m_callLinkInfo;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -56,13 +56,7 @@
</span><span class="cx"> 
</span><span class="cx"> #define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (pageSize() * 4)
</span><span class="cx"> 
</span><del>-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-#define PROTECTION_FLAGS_RW (PROT_READ | PROT_WRITE)
-#define PROTECTION_FLAGS_RX (PROT_READ | PROT_EXEC)
-#define EXECUTABLE_POOL_WRITABLE false
-#else
</del><span class="cx"> #define EXECUTABLE_POOL_WRITABLE true
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -116,34 +110,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ExecutableMemoryHandle&gt; allocate(VM&amp;, size_t sizeInBytes, void* ownerUID, JITCompilationEffort);
</span><span class="cx"> 
</span><del>-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-    static void makeWritable(void* start, size_t size)
-    {
-        reprotectRegion(start, size, Writable);
-    }
-
-    static void makeExecutable(void* start, size_t size)
-    {
-        reprotectRegion(start, size, Executable);
-    }
-#else
-    static void makeWritable(void*, size_t) {}
-    static void makeExecutable(void*, size_t) {}
-#endif
-
</del><span class="cx">     static size_t committedByteCount();
</span><del>-
-private:
-
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-    static void reprotectRegion(void*, size_t, ProtectionSetting);
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
-    // We create a MetaAllocator for each JS global object.
-    std::unique_ptr&lt;DemandExecutableAllocator&gt; m_allocator;
-    DemandExecutableAllocator* allocator() { return m_allocator.get(); }
-#endif
-#endif
-
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(JIT) &amp;&amp; ENABLE(ASSEMBLER)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubRoutinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubRoutine.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubRoutine.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/JITStubRoutine.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> JITStubRoutine::~JITStubRoutine() { }
</span><span class="cx"> 
</span><del>-bool JITStubRoutine::visitWeak(RepatchBuffer&amp;)
</del><ins>+bool JITStubRoutine::visitWeak(VM&amp;, RepatchBuffer&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubRoutineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubRoutine.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubRoutine.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/JITStubRoutine.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">     // Return true if you are still valid after. Return false if you are now invalid. If you return
</span><span class="cx">     // false, you will usually not do any clearing because the idea is that you will simply be
</span><span class="cx">     // destroyed.
</span><del>-    virtual bool visitWeak(RepatchBuffer&amp;);
</del><ins>+    virtual bool visitWeak(VM&amp;, RepatchBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     virtual void observeZeroRefCount();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitPolymorphicCallStubRoutinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -41,13 +41,13 @@
</span><span class="cx">         remove();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PolymorphicCallNode::unlink(RepatchBuffer&amp; repatchBuffer)
</del><ins>+void PolymorphicCallNode::unlink(VM&amp; vm, RepatchBuffer&amp; repatchBuffer)
</ins><span class="cx"> {
</span><span class="cx">     if (m_callLinkInfo) {
</span><span class="cx">         if (Options::showDisassembly())
</span><span class="cx">             dataLog(&quot;Unlinking polymorphic call at &quot;, m_callLinkInfo-&gt;callReturnLocation(), &quot;, &quot;, m_callLinkInfo-&gt;codeOrigin(), &quot;\n&quot;);
</span><span class="cx"> 
</span><del>-        m_callLinkInfo-&gt;unlink(repatchBuffer);
</del><ins>+        m_callLinkInfo-&gt;unlink(vm, repatchBuffer);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (isOnList())
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PolymorphicCallStubRoutine::visitWeak(RepatchBuffer&amp;)
</del><ins>+bool PolymorphicCallStubRoutine::visitWeak(VM&amp;, RepatchBuffer&amp;)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; variant : m_variants) {
</span><span class="cx">         if (!Heap::isMarked(variant.get()))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitPolymorphicCallStubRoutineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     
</span><span class="cx">     ~PolymorphicCallNode();
</span><span class="cx">     
</span><del>-    void unlink(RepatchBuffer&amp;);
</del><ins>+    void unlink(VM&amp;, RepatchBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool hasCallLinkInfo(CallLinkInfo* info) { return m_callLinkInfo == info; }
</span><span class="cx">     void clearCallLinkInfo();
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearCallNodesFor(CallLinkInfo*);
</span><span class="cx">     
</span><del>-    bool visitWeak(RepatchBuffer&amp;) override;
</del><ins>+    bool visitWeak(VM&amp;, RepatchBuffer&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     virtual void markRequiredObjectsInternal(SlotVisitor&amp;) override;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitRepatchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/Repatch.cpp (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/Repatch.cpp        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/Repatch.cpp        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -60,26 +60,24 @@
</span><span class="cx"> // - tagTypeNumberRegister
</span><span class="cx"> // - tagMaskRegister
</span><span class="cx"> 
</span><del>-static FunctionPtr readCallTarget(RepatchBuffer&amp; repatchBuffer, CodeLocationCall call)
</del><ins>+static FunctionPtr readCallTarget(CodeBlock* codeBlock, CodeLocationCall call)
</ins><span class="cx"> {
</span><span class="cx">     FunctionPtr result = MacroAssembler::readCallTarget(call);
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><del>-    CodeBlock* codeBlock = repatchBuffer.codeBlock();
</del><span class="cx">     if (codeBlock-&gt;jitType() == JITCode::FTLJIT) {
</span><span class="cx">         return FunctionPtr(codeBlock-&gt;vm()-&gt;ftlThunks-&gt;keyForSlowPathCallThunk(
</span><span class="cx">             MacroAssemblerCodePtr::createFromExecutableAddress(
</span><span class="cx">                 result.executableAddress())).callTarget());
</span><span class="cx">     }
</span><span class="cx"> #else
</span><del>-    UNUSED_PARAM(repatchBuffer);
</del><ins>+    UNUSED_PARAM(codeBlock);
</ins><span class="cx"> #endif // ENABLE(FTL_JIT)
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void repatchCall(RepatchBuffer&amp; repatchBuffer, CodeLocationCall call, FunctionPtr newCalleeFunction)
</del><ins>+static void repatchCall(RepatchBuffer&amp; repatchBuffer, CodeBlock* codeBlock, CodeLocationCall call, FunctionPtr newCalleeFunction)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><del>-    CodeBlock* codeBlock = repatchBuffer.codeBlock();
</del><span class="cx">     if (codeBlock-&gt;jitType() == JITCode::FTLJIT) {
</span><span class="cx">         VM&amp; vm = *codeBlock-&gt;vm();
</span><span class="cx">         FTL::Thunks&amp; thunks = *vm.ftlThunks;
</span><span class="lines">@@ -90,14 +88,16 @@
</span><span class="cx">         newCalleeFunction = FunctionPtr(
</span><span class="cx">             thunks.getSlowPathCallThunk(vm, key).code().executableAddress());
</span><span class="cx">     }
</span><ins>+#else // ENABLE(FTL_JIT)
+    UNUSED_PARAM(codeBlock);
</ins><span class="cx"> #endif // ENABLE(FTL_JIT)
</span><span class="cx">     repatchBuffer.relink(call, newCalleeFunction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void repatchCall(CodeBlock* codeblock, CodeLocationCall call, FunctionPtr newCalleeFunction)
</del><ins>+static void repatchCall(CodeBlock* codeBlock, CodeLocationCall call, FunctionPtr newCalleeFunction)
</ins><span class="cx"> {
</span><del>-    RepatchBuffer repatchBuffer(codeblock);
-    repatchCall(repatchBuffer, call, newCalleeFunction);
</del><ins>+    RepatchBuffer repatchBuffer(codeBlock);
+    repatchCall(repatchBuffer, codeBlock, call, newCalleeFunction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void repatchByIdSelfAccess(
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx"> 
</span><span class="cx">     // Only optimize once!
</span><del>-    repatchCall(repatchBuffer, stubInfo.callReturnLocation, slowPathFunction);
</del><ins>+    repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, slowPathFunction);
</ins><span class="cx"> 
</span><span class="cx">     // Patch the structure check &amp; the offset of the load.
</span><span class="cx">     repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabel32AtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall), bitwise_cast&lt;int32_t&gt;(structure-&gt;id()));
</span><span class="lines">@@ -683,7 +683,7 @@
</span><span class="cx"> 
</span><span class="cx">             RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">             replaceWithJump(repatchBuffer, stubInfo, stubInfo.stubRoutine-&gt;code().code());
</span><del>-            repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetById);
</del><ins>+            repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, operationGetById);
</ins><span class="cx"> 
</span><span class="cx">             return RetryCacheLater;
</span><span class="cx">         }
</span><span class="lines">@@ -716,7 +716,7 @@
</span><span class="cx"> 
</span><span class="cx">         RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">         replaceWithJump(repatchBuffer, stubInfo, stubInfo.stubRoutine-&gt;code().code());
</span><del>-        repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetById);
</del><ins>+        repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, operationGetById);
</ins><span class="cx"> 
</span><span class="cx">         return RetryCacheLater;
</span><span class="cx">     }
</span><span class="lines">@@ -1263,7 +1263,7 @@
</span><span class="cx">                 stubInfo.callReturnLocation.jumpAtOffset(
</span><span class="cx">                     stubInfo.patch.deltaCallToJump),
</span><span class="cx">                 CodeLocationLabel(stubInfo.stubRoutine-&gt;code().code()));
</span><del>-            repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind));
</del><ins>+            repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind));
</ins><span class="cx">             
</span><span class="cx">             stubInfo.initPutByIdTransition(*vm, codeBlock-&gt;ownerExecutable(), oldStructure, structure, conditionSet, putKind == Direct);
</span><span class="cx">             
</span><span class="lines">@@ -1322,7 +1322,7 @@
</span><span class="cx"> 
</span><span class="cx">         RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">         repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine-&gt;code().code()));
</span><del>-        repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind));
</del><ins>+        repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind));
</ins><span class="cx">         RELEASE_ASSERT(!list-&gt;isFull());
</span><span class="cx">         return RetryCacheLater;
</span><span class="cx">     }
</span><span class="lines">@@ -1396,7 +1396,7 @@
</span><span class="cx">         RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">         repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine-&gt;code().code()));
</span><span class="cx">         if (list-&gt;isFull())
</span><del>-            repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind));
</del><ins>+            repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind));
</ins><span class="cx"> 
</span><span class="cx">         return RetryCacheLater;
</span><span class="cx">     }
</span><span class="lines">@@ -1445,7 +1445,7 @@
</span><span class="cx">         RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">         repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine-&gt;code().code()));
</span><span class="cx">         if (list-&gt;isFull())
</span><del>-            repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind));
</del><ins>+            repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind));
</ins><span class="cx"> 
</span><span class="cx">         return RetryCacheLater;
</span><span class="cx">     }
</span><span class="lines">@@ -1667,13 +1667,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void unlinkFor(
</span><del>-    RepatchBuffer&amp; repatchBuffer, CallLinkInfo&amp; callLinkInfo)
</del><ins>+    VM&amp; vm, RepatchBuffer&amp; repatchBuffer, CallLinkInfo&amp; callLinkInfo)
</ins><span class="cx"> {
</span><span class="cx">     if (Options::showDisassembly())
</span><del>-        dataLog(&quot;Unlinking call from &quot;, callLinkInfo.callReturnLocation(), &quot; in request from &quot;, pointerDump(repatchBuffer.codeBlock()), &quot;\n&quot;);
</del><ins>+        dataLog(&quot;Unlinking call from &quot;, callLinkInfo.callReturnLocation(), &quot;\n&quot;);
</ins><span class="cx">     
</span><del>-    VM* vm = repatchBuffer.codeBlock()-&gt;vm();
-    revertCall(repatchBuffer, vm, callLinkInfo, vm-&gt;getCTIStub(linkCallThunkGenerator));
</del><ins>+    revertCall(repatchBuffer, &amp;vm, callLinkInfo, vm.getCTIStub(linkCallThunkGenerator));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void linkVirtualFor(
</span><span class="lines">@@ -1937,9 +1936,9 @@
</span><span class="cx">         callLinkInfo.remove();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void resetGetByID(RepatchBuffer&amp; repatchBuffer, StructureStubInfo&amp; stubInfo)
</del><ins>+void resetGetByID(RepatchBuffer&amp; repatchBuffer, CodeBlock* codeBlock, StructureStubInfo&amp; stubInfo)
</ins><span class="cx"> {
</span><del>-    repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetByIdOptimize);
</del><ins>+    repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, operationGetByIdOptimize);
</ins><span class="cx">     CodeLocationDataLabel32 structureLabel = stubInfo.callReturnLocation.dataLabel32AtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall);
</span><span class="cx">     if (MacroAssembler::canJumpReplacePatchableBranch32WithPatch()) {
</span><span class="cx">         repatchBuffer.revertJumpReplacementToPatchableBranch32WithPatch(
</span><span class="lines">@@ -1959,9 +1958,9 @@
</span><span class="cx">     repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void resetPutByID(RepatchBuffer&amp; repatchBuffer, StructureStubInfo&amp; stubInfo)
</del><ins>+void resetPutByID(RepatchBuffer&amp; repatchBuffer, CodeBlock* codeBlock, StructureStubInfo&amp; stubInfo)
</ins><span class="cx"> {
</span><del>-    V_JITOperation_ESsiJJI unoptimizedFunction = bitwise_cast&lt;V_JITOperation_ESsiJJI&gt;(readCallTarget(repatchBuffer, stubInfo.callReturnLocation).executableAddress());
</del><ins>+    V_JITOperation_ESsiJJI unoptimizedFunction = bitwise_cast&lt;V_JITOperation_ESsiJJI&gt;(readCallTarget(codeBlock, stubInfo.callReturnLocation).executableAddress());
</ins><span class="cx">     V_JITOperation_ESsiJJI optimizedFunction;
</span><span class="cx">     if (unoptimizedFunction == operationPutByIdStrict || unoptimizedFunction == operationPutByIdStrictBuildList)
</span><span class="cx">         optimizedFunction = operationPutByIdStrictOptimize;
</span><span class="lines">@@ -1973,7 +1972,7 @@
</span><span class="cx">         ASSERT(unoptimizedFunction == operationPutByIdDirectNonStrict || unoptimizedFunction == operationPutByIdDirectNonStrictBuildList);
</span><span class="cx">         optimizedFunction = operationPutByIdDirectNonStrictOptimize;
</span><span class="cx">     }
</span><del>-    repatchCall(repatchBuffer, stubInfo.callReturnLocation, optimizedFunction);
</del><ins>+    repatchCall(repatchBuffer, codeBlock, stubInfo.callReturnLocation, optimizedFunction);
</ins><span class="cx">     CodeLocationDataLabel32 structureLabel = stubInfo.callReturnLocation.dataLabel32AtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall);
</span><span class="cx">     if (MacroAssembler::canJumpReplacePatchableBranch32WithPatch()) {
</span><span class="cx">         repatchBuffer.revertJumpReplacementToPatchableBranch32WithPatch(
</span><span class="lines">@@ -1993,7 +1992,7 @@
</span><span class="cx">     repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void resetIn(RepatchBuffer&amp; repatchBuffer, StructureStubInfo&amp; stubInfo)
</del><ins>+void resetIn(RepatchBuffer&amp; repatchBuffer, CodeBlock*, StructureStubInfo&amp; stubInfo)
</ins><span class="cx"> {
</span><span class="cx">     repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitRepatchh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/Repatch.h (189277 => 189278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/Repatch.h        2015-09-03 19:39:04 UTC (rev 189277)
+++ trunk/Source/JavaScriptCore/jit/Repatch.h        2015-09-03 19:41:42 UTC (rev 189278)
</span><span class="lines">@@ -42,12 +42,12 @@
</span><span class="cx"> void repatchIn(ExecState*, JSCell*, const Identifier&amp;, bool wasFound, const PropertySlot&amp;, StructureStubInfo&amp;);
</span><span class="cx"> void linkFor(ExecState*, CallLinkInfo&amp;, CodeBlock*, JSFunction* callee, MacroAssemblerCodePtr);
</span><span class="cx"> void linkSlowFor(ExecState*, CallLinkInfo&amp;);
</span><del>-void unlinkFor(RepatchBuffer&amp;, CallLinkInfo&amp;);
</del><ins>+void unlinkFor(VM&amp;, RepatchBuffer&amp;, CallLinkInfo&amp;);
</ins><span class="cx"> void linkVirtualFor(ExecState*, CallLinkInfo&amp;);
</span><span class="cx"> void linkPolymorphicCall(ExecState*, CallLinkInfo&amp;, CallVariant);
</span><del>-void resetGetByID(RepatchBuffer&amp;, StructureStubInfo&amp;);
-void resetPutByID(RepatchBuffer&amp;, StructureStubInfo&amp;);
-void resetIn(RepatchBuffer&amp;, StructureStubInfo&amp;);
</del><ins>+void resetGetByID(RepatchBuffer&amp;, CodeBlock*, StructureStubInfo&amp;);
+void resetPutByID(RepatchBuffer&amp;, CodeBlock*, StructureStubInfo&amp;);
+void resetIn(RepatchBuffer&amp;, CodeBlock*, StructureStubInfo&amp;);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>