Title: [167203] trunk/PerformanceTests
Revision
167203
Author
gga...@apple.com
Date
2014-04-13 16:21:20 -0700 (Sun, 13 Apr 2014)

Log Message

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.

Modified Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (167202 => 167203)


--- trunk/PerformanceTests/ChangeLog	2014-04-13 20:02:13 UTC (rev 167202)
+++ trunk/PerformanceTests/ChangeLog	2014-04-13 23:21:20 UTC (rev 167203)
@@ -1,3 +1,20 @@
+2014-04-13  Geoffrey Garen  <gga...@apple.com>
+
+        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.
+
 2014-04-11  Dirk Schulze  <k...@webkit.org>
 
         Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.

Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp (167202 => 167203)


--- 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)
@@ -93,19 +93,25 @@
         for (size_t i = 0; i < opCount; ++i) {
             Op op = ops[i];
             switch (op.opcode) {
-            case op_a: {
+            case op_malloc: {
                 m_objects[op.slot] = { mbmalloc(op.size), op.size };
                 assert(m_objects[op.slot].object);
                 bzero(m_objects[op.slot].object, op.size);
                 break;
             }
-            case op_d: {
+            case op_free: {
                 assert(m_objects[op.slot].object);
                 assert(m_objects[op.slot].size);
                 mbfree(m_objects[op.slot].object, m_objects[op.slot].size);
                 m_objects[op.slot] = { 0, 0 };
                 break;
             }
+            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;
+            }
             default: {
                 fprintf(stderr, "bad opcode: %d\n", op.opcode);
                 abort();

Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h (167202 => 167203)


--- 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)
@@ -36,7 +36,7 @@
     void run();
 
 private:
-    enum Opcode { op_a, op_d };
+    enum Opcode { op_malloc, op_free, op_realloc };
     struct Op { Opcode opcode; size_t slot; size_t size; };
     struct Record { void* object; size_t size; };
 

Modified: trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj (167202 => 167203)


--- 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)
@@ -13,6 +13,7 @@
 		1444AE96177E8DF200F8030A /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1444AE94177E8DF200F8030A /* message.cpp */; };
 		14452CB0177D24460097E057 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CAF177D24460097E057 /* main.cpp */; };
 		14452CEF177D47110097E057 /* churn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CED177D47110097E057 /* churn.cpp */; };
+		1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1447AE8318FB4B2400B3D7FF /* libSystem.dylib */; };
 		1451FAED18B14B7100DB6D47 /* medium.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1451FAEB18B14B7100DB6D47 /* medium.cpp */; };
 		14976EC8177E3649006B819A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976EC6177E3649006B819A /* list.cpp */; };
 		14976ECC177E3C87006B819A /* CommandLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976ECB177E3C87006B819A /* CommandLine.cpp */; };
@@ -21,7 +22,7 @@
 		14C5008D184016CF007A531D /* facebook.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14C5008B184016CF007A531D /* facebook.cpp */; };
 		14C5009018401841007A531D /* facebook.ops in CopyFiles */ = {isa = PBXBuildFile; fileRef = 14C5008E18401726007A531D /* facebook.ops */; };
 		14C5009318403DA0007A531D /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14C5009118403DA0007A531D /* Interpreter.cpp */; };
-		14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
+		14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
 		14CC393F18EA8184004AFE34 /* mbmalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CC391C18EA6759004AFE34 /* mbmalloc.cpp */; };
 		14CE4A6017BD355800288DAA /* big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CE4A5E17BD355800288DAA /* big.cpp */; };
 		14E11932177ECC8B003A8D15 /* CPUCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E11930177ECC8B003A8D15 /* CPUCount.cpp */; };
@@ -63,6 +64,7 @@
 		14452CAF177D24460097E057 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
 		14452CED177D47110097E057 /* churn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = churn.cpp; path = MallocBench/churn.cpp; sourceTree = "<group>"; };
 		14452CEE177D47110097E057 /* churn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = churn.h; path = MallocBench/churn.h; sourceTree = "<group>"; };
+		1447AE8318FB4B2400B3D7FF /* libSystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libSystem.dylib; path = /usr/lib/libSystem.dylib; sourceTree = "<absolute>"; };
 		1451FAEB18B14B7100DB6D47 /* medium.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = medium.cpp; path = MallocBench/medium.cpp; sourceTree = "<group>"; };
 		1451FAEC18B14B7100DB6D47 /* medium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = medium.h; path = MallocBench/medium.h; sourceTree = "<group>"; };
 		14976EC6177E3649006B819A /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = MallocBench/list.cpp; sourceTree = "<group>"; };
@@ -100,6 +102,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -112,6 +115,7 @@
 				14E11933177F51AC003A8D15 /* Benchmarks */,
 				14452CAE177D24460097E057 /* MallocBench */,
 				14CC391B18EA6722004AFE34 /* mbmalloc */,
+				1447AE8618FB4B5100B3D7FF /* Libraries */,
 				14452CAA177D24460097E057 /* Products */,
 			);
 			sourceTree = "<group>";
@@ -141,6 +145,14 @@
 			path = MallocBench;
 			sourceTree = "<group>";
 		};
+		1447AE8618FB4B5100B3D7FF /* Libraries */ = {
+			isa = PBXGroup;
+			children = (
+				1447AE8318FB4B2400B3D7FF /* libSystem.dylib */,
+			);
+			name = Libraries;
+			sourceTree = "<group>";
+		};
 		14CC391B18EA6722004AFE34 /* mbmalloc */ = {
 			isa = PBXGroup;
 			children = (
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to