<!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>[167203] trunk/PerformanceTests</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/167203">167203</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2014-04-13 16:21:20 -0700 (Sun, 13 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>MallocBench record/replay should support realloc
https://bugs.webkit.org/show_bug.cgi?id=131598

Reviewed by Ryosuke Niwa.

* MallocBench/MallocBench.xcodeproj/project.pbxproj: Fixed some linkage
issues that caused us not to fully link to system malloc in the default
case. Also marked mbmalloc.dylib as required so the error message will
be clearer if we mess up.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::run):
* MallocBench/MallocBench/Interpreter.h: Added the realloc case, and
upgraded one-letter names to full words.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp">trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchInterpreterh">trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchxcodeprojprojectpbxproj">trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (167202 => 167203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2014-04-13 20:02:13 UTC (rev 167202)
+++ trunk/PerformanceTests/ChangeLog        2014-04-13 23:21:20 UTC (rev 167203)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-04-13  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        MallocBench record/replay should support realloc
+        https://bugs.webkit.org/show_bug.cgi?id=131598
+
+        Reviewed by Ryosuke Niwa.
+
+        * MallocBench/MallocBench.xcodeproj/project.pbxproj: Fixed some linkage
+        issues that caused us not to fully link to system malloc in the default
+        case. Also marked mbmalloc.dylib as required so the error message will
+        be clearer if we mess up.
+
+        * MallocBench/MallocBench/Interpreter.cpp:
+        (Interpreter::run):
+        * MallocBench/MallocBench/Interpreter.h: Added the realloc case, and
+        upgraded one-letter names to full words.
+
</ins><span class="cx"> 2014-04-11  Dirk Schulze  &lt;krit@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp (167202 => 167203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2014-04-13 20:02:13 UTC (rev 167202)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2014-04-13 23:21:20 UTC (rev 167203)
</span><span class="lines">@@ -93,19 +93,25 @@
</span><span class="cx">         for (size_t i = 0; i &lt; opCount; ++i) {
</span><span class="cx">             Op op = ops[i];
</span><span class="cx">             switch (op.opcode) {
</span><del>-            case op_a: {
</del><ins>+            case op_malloc: {
</ins><span class="cx">                 m_objects[op.slot] = { mbmalloc(op.size), op.size };
</span><span class="cx">                 assert(m_objects[op.slot].object);
</span><span class="cx">                 bzero(m_objects[op.slot].object, op.size);
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><del>-            case op_d: {
</del><ins>+            case op_free: {
</ins><span class="cx">                 assert(m_objects[op.slot].object);
</span><span class="cx">                 assert(m_objects[op.slot].size);
</span><span class="cx">                 mbfree(m_objects[op.slot].object, m_objects[op.slot].size);
</span><span class="cx">                 m_objects[op.slot] = { 0, 0 };
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><ins>+            case op_realloc: {
+                assert(m_objects[op.slot].object);
+                assert(m_objects[op.slot].size);
+                m_objects[op.slot] = { mbrealloc(m_objects[op.slot].object, m_objects[op.slot].size, op.size), op.size };
+                break;
+            }
</ins><span class="cx">             default: {
</span><span class="cx">                 fprintf(stderr, &quot;bad opcode: %d\n&quot;, op.opcode);
</span><span class="cx">                 abort();
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h (167202 => 167203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h        2014-04-13 20:02:13 UTC (rev 167202)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h        2014-04-13 23:21:20 UTC (rev 167203)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     void run();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    enum Opcode { op_a, op_d };
</del><ins>+    enum Opcode { op_malloc, op_free, op_realloc };
</ins><span class="cx">     struct Op { Opcode opcode; size_t slot; size_t size; };
</span><span class="cx">     struct Record { void* object; size_t size; };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj (167202 => 167203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj        2014-04-13 20:02:13 UTC (rev 167202)
+++ trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj        2014-04-13 23:21:20 UTC (rev 167203)
</span><span class="lines">@@ -13,6 +13,7 @@
</span><span class="cx">                 1444AE96177E8DF200F8030A /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1444AE94177E8DF200F8030A /* message.cpp */; };
</span><span class="cx">                 14452CB0177D24460097E057 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CAF177D24460097E057 /* main.cpp */; };
</span><span class="cx">                 14452CEF177D47110097E057 /* churn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CED177D47110097E057 /* churn.cpp */; };
</span><ins>+                1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1447AE8318FB4B2400B3D7FF /* libSystem.dylib */; };
</ins><span class="cx">                 1451FAED18B14B7100DB6D47 /* medium.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1451FAEB18B14B7100DB6D47 /* medium.cpp */; };
</span><span class="cx">                 14976EC8177E3649006B819A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976EC6177E3649006B819A /* list.cpp */; };
</span><span class="cx">                 14976ECC177E3C87006B819A /* CommandLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976ECB177E3C87006B819A /* CommandLine.cpp */; };
</span><span class="lines">@@ -21,7 +22,7 @@
</span><span class="cx">                 14C5008D184016CF007A531D /* facebook.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14C5008B184016CF007A531D /* facebook.cpp */; };
</span><span class="cx">                 14C5009018401841007A531D /* facebook.ops in CopyFiles */ = {isa = PBXBuildFile; fileRef = 14C5008E18401726007A531D /* facebook.ops */; };
</span><span class="cx">                 14C5009318403DA0007A531D /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14C5009118403DA0007A531D /* Interpreter.cpp */; };
</span><del>-                14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
</del><ins>+                14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
</ins><span class="cx">                 14CC393F18EA8184004AFE34 /* mbmalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CC391C18EA6759004AFE34 /* mbmalloc.cpp */; };
</span><span class="cx">                 14CE4A6017BD355800288DAA /* big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CE4A5E17BD355800288DAA /* big.cpp */; };
</span><span class="cx">                 14E11932177ECC8B003A8D15 /* CPUCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E11930177ECC8B003A8D15 /* CPUCount.cpp */; };
</span><span class="lines">@@ -63,6 +64,7 @@
</span><span class="cx">                 14452CAF177D24460097E057 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14452CED177D47110097E057 /* churn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = churn.cpp; path = MallocBench/churn.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14452CEE177D47110097E057 /* churn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = churn.h; path = MallocBench/churn.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1447AE8318FB4B2400B3D7FF /* libSystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = &quot;compiled.mach-o.dylib&quot;; name = libSystem.dylib; path = /usr/lib/libSystem.dylib; sourceTree = &quot;&lt;absolute&gt;&quot;; };
</ins><span class="cx">                 1451FAEB18B14B7100DB6D47 /* medium.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = medium.cpp; path = MallocBench/medium.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1451FAEC18B14B7100DB6D47 /* medium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = medium.h; path = MallocBench/medium.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14976EC6177E3649006B819A /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = MallocBench/list.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -100,6 +102,7 @@
</span><span class="cx">                         isa = PBXFrameworksBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -112,6 +115,7 @@
</span><span class="cx">                                 14E11933177F51AC003A8D15 /* Benchmarks */,
</span><span class="cx">                                 14452CAE177D24460097E057 /* MallocBench */,
</span><span class="cx">                                 14CC391B18EA6722004AFE34 /* mbmalloc */,
</span><ins>+                                1447AE8618FB4B5100B3D7FF /* Libraries */,
</ins><span class="cx">                                 14452CAA177D24460097E057 /* Products */,
</span><span class="cx">                         );
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -141,6 +145,14 @@
</span><span class="cx">                         path = MallocBench;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                1447AE8618FB4B5100B3D7FF /* Libraries */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1447AE8318FB4B2400B3D7FF /* libSystem.dylib */,
+                        );
+                        name = Libraries;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 14CC391B18EA6722004AFE34 /* mbmalloc */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span></span></pre>
</div>
</div>

</body>
</html>