<!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>[160881] trunk/Source</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/160881">160881</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-19 17:39:09 -0800 (Thu, 19 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add an utility class to simplify generating function calls
https://bugs.webkit.org/show_bug.cgi?id=125972

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Split branchTest32 in two functions: test32AndSetFlags and branchOnFlags.
This is done to allow code where the flags are set, multiple operation that
do not modify the flags occur, then the flags are used.

This is used for function calls to test the return value while discarding the
return register.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::test32AndSetFlags):
(JSC::MacroAssemblerX86Common::branchOnFlags):
(JSC::MacroAssemblerX86Common::branchTest32):

Source/WebCore: 

FunctionCall is a little helper class to make function calls from the JIT
in 3 or 4 lines.

FunctionCall takes a StackAllocator, a RegisterAllocator and a function pointer.
When the call is generated, the helper saves the registers as necessary, aligns
the stack, does the call, restores the stack, and restore the registers.

* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):

(WebCore::FunctionCall::callAndBranchOnCondition): Most test functions used
with FunctionCall return a boolean. When the boolean is the sole purpose of the function
call, this provides an easy way to branch on the boolean without worrying about registers.

The return register is tested first, then all the saved registers are restored from the stack
(which can include the return register), finally the flags are used for a jump.

(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):
* WebCore.xcodeproj/project.pbxproj:
* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):
(WebCore::FunctionCall::callAndBranchOnCondition):
(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssjitFunctionCallh">trunk/Source/WebCore/cssjit/FunctionCall.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (160880 => 160881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2013-12-20 01:18:49 UTC (rev 160880)
+++ trunk/Source/JavaScriptCore/ChangeLog        2013-12-20 01:39:09 UTC (rev 160881)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2013-12-19  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Add an utility class to simplify generating function calls
+        https://bugs.webkit.org/show_bug.cgi?id=125972
+
+        Reviewed by Geoffrey Garen.
+
+        Split branchTest32 in two functions: test32AndSetFlags and branchOnFlags.
+        This is done to allow code where the flags are set, multiple operation that
+        do not modify the flags occur, then the flags are used.
+
+        This is used for function calls to test the return value while discarding the
+        return register.
+
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::test32AndSetFlags):
+        (JSC::MacroAssemblerX86Common::branchOnFlags):
+        (JSC::MacroAssemblerX86Common::branchTest32):
+
</ins><span class="cx"> 2013-12-19  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Put write barriers in the right places in the baseline JIT
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h (160880 => 160881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2013-12-20 01:18:49 UTC (rev 160880)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2013-12-20 01:39:09 UTC (rev 160881)
</span><span class="lines">@@ -1145,7 +1145,7 @@
</span><span class="cx">         return Jump(m_assembler.jCC(x86Condition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Jump branchTest32(ResultCondition cond, RegisterID reg, TrustedImm32 mask = TrustedImm32(-1))
</del><ins>+    void test32(RegisterID reg, TrustedImm32 mask = TrustedImm32(-1))
</ins><span class="cx">     {
</span><span class="cx">         if (mask.m_value == -1)
</span><span class="cx">             m_assembler.testl_rr(reg, reg);
</span><span class="lines">@@ -1153,9 +1153,19 @@
</span><span class="cx">             m_assembler.testb_i8r(mask.m_value, reg);
</span><span class="cx">         else
</span><span class="cx">             m_assembler.testl_i32r(mask.m_value, reg);
</span><ins>+    }
+
+    Jump branch(ResultCondition cond)
+    {
</ins><span class="cx">         return Jump(m_assembler.jCC(x86Condition(cond)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    Jump branchTest32(ResultCondition cond, RegisterID reg, TrustedImm32 mask = TrustedImm32(-1))
+    {
+        test32(reg, mask);
+        return branch(cond);
+    }
+
</ins><span class="cx">     Jump branchTest32(ResultCondition cond, Address address, TrustedImm32 mask = TrustedImm32(-1))
</span><span class="cx">     {
</span><span class="cx">         generateTest32(address, mask);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160880 => 160881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-20 01:18:49 UTC (rev 160880)
+++ trunk/Source/WebCore/ChangeLog        2013-12-20 01:39:09 UTC (rev 160881)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2013-12-19  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Add an utility class to simplify generating function calls
+        https://bugs.webkit.org/show_bug.cgi?id=125972
+
+        Reviewed by Geoffrey Garen.
+
+        FunctionCall is a little helper class to make function calls from the JIT
+        in 3 or 4 lines.
+
+        FunctionCall takes a StackAllocator, a RegisterAllocator and a function pointer.
+        When the call is generated, the helper saves the registers as necessary, aligns
+        the stack, does the call, restores the stack, and restore the registers.
+
+        * cssjit/FunctionCall.h: Added.
+        (WebCore::FunctionCall::FunctionCall):
+        (WebCore::FunctionCall::setFunctionAddress):
+        (WebCore::FunctionCall::setFirstArgument):
+        (WebCore::FunctionCall::call):
+
+        (WebCore::FunctionCall::callAndBranchOnCondition): Most test functions used
+        with FunctionCall return a boolean. When the boolean is the sole purpose of the function
+        call, this provides an easy way to branch on the boolean without worrying about registers.
+
+        The return register is tested first, then all the saved registers are restored from the stack
+        (which can include the return register), finally the flags are used for a jump.
+
+        (WebCore::FunctionCall::prepareAndCall):
+        (WebCore::FunctionCall::cleanupPostCall):
+        (WebCore::FunctionCall::saveAllocatedRegisters):
+        (WebCore::FunctionCall::restoreAllocatedRegisters):
+        * WebCore.xcodeproj/project.pbxproj:
+        * cssjit/FunctionCall.h: Added.
+        (WebCore::FunctionCall::FunctionCall):
+        (WebCore::FunctionCall::setFunctionAddress):
+        (WebCore::FunctionCall::setFirstArgument):
+        (WebCore::FunctionCall::call):
+        (WebCore::FunctionCall::callAndBranchOnCondition):
+        (WebCore::FunctionCall::prepareAndCall):
+        (WebCore::FunctionCall::cleanupPostCall):
+        (WebCore::FunctionCall::saveAllocatedRegisters):
+        (WebCore::FunctionCall::restoreAllocatedRegisters):
+
</ins><span class="cx"> 2013-12-19  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Begin stubbing out the KeyedDecoder class
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160880 => 160881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-20 01:18:49 UTC (rev 160880)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-20 01:39:09 UTC (rev 160881)
</span><span class="lines">@@ -911,6 +911,7 @@
</span><span class="cx">                 269239961505E1AA009E57FC /* JSIDBVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */; };
</span><span class="cx">                 26B9998F1803AE7200D01121 /* RegisterAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B9998E1803AE7200D01121 /* RegisterAllocator.h */; };
</span><span class="cx">                 26B999911803B3C900D01121 /* StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B999901803B3C900D01121 /* StackAllocator.h */; };
</span><ins>+                26B999931803B9D900D01121 /* FunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B999921803B9D900D01121 /* FunctionCall.h */; };
</ins><span class="cx">                 26C15CF61857E15D00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C15CF41857E15D00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp */; };
</span><span class="cx">                 26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C15CF51857E15D00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h */; };
</span><span class="cx">                 26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */; };
</span><span class="lines">@@ -7566,6 +7567,7 @@
</span><span class="cx">                 269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBVersionChangeEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26B9998E1803AE7200D01121 /* RegisterAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterAllocator.h; path = cssjit/RegisterAllocator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26B999901803B3C900D01121 /* StackAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StackAllocator.h; path = cssjit/StackAllocator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                26B999921803B9D900D01121 /* FunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCall.h; path = cssjit/FunctionCall.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 26C15CF41857E15D00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26C15CF51857E15D00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleCFURLConnectionDelegateWithOperationQueue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemIOS.h; path = ios/FileSystemIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14653,6 +14655,7 @@
</span><span class="cx">                 26B9998D1803ADFA00D01121 /* cssjit */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                26B999921803B9D900D01121 /* FunctionCall.h */,
</ins><span class="cx">                                 26B9998E1803AE7200D01121 /* RegisterAllocator.h */,
</span><span class="cx">                                 26B999901803B3C900D01121 /* StackAllocator.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -23165,6 +23168,7 @@
</span><span class="cx">                                 65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */,
</span><span class="cx">                                 97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */,
</span><span class="cx">                                 51C81B8A0C4422F70019ECE3 /* FTPDirectoryParser.h in Headers */,
</span><ins>+                                26B999931803B9D900D01121 /* FunctionCall.h in Headers */,
</ins><span class="cx">                                 FD31600D12B0267600C1A359 /* GainNode.h in Headers */,
</span><span class="cx">                                 935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */,
</span><span class="cx">                                 51771C8F182DB4B7008E781E /* IDBDatabaseBackend.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitFunctionCallh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/cssjit/FunctionCall.h (0 => 160881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/FunctionCall.h                                (rev 0)
+++ trunk/Source/WebCore/cssjit/FunctionCall.h        2013-12-20 01:39:09 UTC (rev 160881)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FunctionCall_h
+#define FunctionCall_h
+
+#if ENABLE(CSS_SELECTOR_JIT)
+
+#include &quot;RegisterAllocator.h&quot;
+#include &quot;StackAllocator.h&quot;
+#include &lt;JavaScriptCore/GPRInfo.h&gt;
+#include &lt;JavaScriptCore/MacroAssembler.h&gt;
+
+namespace WebCore {
+
+class FunctionCall {
+public:
+    FunctionCall(JSC::MacroAssembler&amp; assembler, const RegisterAllocator&amp; registerAllocator, StackAllocator&amp; stackAllocator, Vector&lt;std::pair&lt;JSC::MacroAssembler::Call, JSC::FunctionPtr&gt;&gt;&amp; callRegistry)
+        : m_assembler(assembler)
+        , m_registerAllocator(registerAllocator)
+        , m_stackAllocator(stackAllocator)
+        , m_callRegistry(callRegistry)
+        , m_firstArgument(0)
+    {
+    }
+
+    void setFunctionAddress(JSC::FunctionPtr functionAddress)
+    {
+        m_functionAddress = functionAddress;
+    }
+
+    void setFirstArgument(const JSC::MacroAssembler::RegisterID&amp; registerID)
+    {
+        m_firstArgument = &amp;registerID;
+    }
+
+    void call()
+    {
+        prepareAndCall();
+        cleanupPostCall();
+    }
+
+    JSC::MacroAssembler::Jump callAndBranchOnCondition(JSC::MacroAssembler::ResultCondition condition)
+    {
+        prepareAndCall();
+        m_assembler.test32(JSC::GPRInfo::returnValueGPR, JSC::MacroAssembler::TrustedImm32(0xff));
+        cleanupPostCall();
+        return m_assembler.branch(condition);
+    }
+
+private:
+    void prepareAndCall()
+    {
+        ASSERT(m_functionAddress.executableAddress());
+
+        saveAllocatedRegisters();
+        m_stackAllocator.alignStackPreFunctionCall();
+
+        if (m_firstArgument &amp;&amp; *m_firstArgument != JSC::GPRInfo::argumentGPR0)
+            m_assembler.move(*m_firstArgument, JSC::GPRInfo::argumentGPR0);
+
+        JSC::MacroAssembler::Call call = m_assembler.call();
+        m_callRegistry.append(std::make_pair(call, m_functionAddress));
+    }
+
+    void cleanupPostCall()
+    {
+        m_stackAllocator.unalignStackPostFunctionCall();
+        restoreAllocatedRegisters();
+    }
+
+    void saveAllocatedRegisters()
+    {
+        ASSERT(m_savedRegisterStackReferences.isEmpty());
+
+        unsigned allocatedRegistersCount = m_registerAllocator.allocatedRegisters().size();
+        m_savedRegisterStackReferences.reserveCapacity(allocatedRegistersCount);
+
+        for (unsigned i = 0; i &lt; allocatedRegistersCount; ++i) {
+            JSC::MacroAssembler::RegisterID registerID = m_registerAllocator.allocatedRegisters()[i];
+            m_savedRegisterStackReferences.append(m_stackAllocator.push(registerID));
+        }
+    }
+
+    void restoreAllocatedRegisters()
+    {
+        for (unsigned i = m_registerAllocator.allocatedRegisters().size(); i &gt; 0; --i)
+            m_stackAllocator.pop(m_savedRegisterStackReferences[i - 1], m_registerAllocator.allocatedRegisters()[i - 1]);
+        m_savedRegisterStackReferences.clear();
+    }
+
+    JSC::MacroAssembler&amp; m_assembler;
+    const RegisterAllocator&amp; m_registerAllocator;
+    StackAllocator&amp; m_stackAllocator;
+    Vector&lt;std::pair&lt;JSC::MacroAssembler::Call, JSC::FunctionPtr&gt;&gt;&amp; m_callRegistry;
+
+    Vector&lt;StackAllocator::StackReference&gt; m_savedRegisterStackReferences;
+
+    JSC::FunctionPtr m_functionAddress;
+    const JSC::MacroAssembler::RegisterID* m_firstArgument;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(CSS_SELECTOR_JIT)
+
+#endif // FunctionCall_h
</ins></span></pre>
</div>
</div>

</body>
</html>