Unreviewed change to revert extraneous changes made part of change set 196955.
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Feb 2016 17:42:12 +0000 (17:42 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Feb 2016 17:42:12 +0000 (17:42 +0000)
* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::doMallocOp):
(Interpreter::Thread::switchTo):
(writeData): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196981 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench/Interpreter.cpp

index bc8651e..f765baa 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-23  Michael Saboff  <msaboff@apple.com>
+
+        Unreviewed change to revert extraneous changes made part of change set 196955.
+
+        * MallocBench/MallocBench/Interpreter.cpp:
+        (Interpreter::doMallocOp):
+        (Interpreter::Thread::switchTo):
+        (writeData): Deleted.
+
 2016-02-19  Michael Saboff  <msaboff@apple.com>
 
         MallocBench: Added recording for nimlang website, new recording details and added new options
index 726e502..5789f32 100644 (file)
@@ -94,7 +94,6 @@ void Interpreter::run()
     m_opsCursor = m_opsInBuffer = 0;
     doOnSameThread(0);
 
-    fprintf(stderr, "Done running\n");
     for (auto thread : m_threads)
         thread->stop();
 
@@ -223,30 +222,13 @@ static size_t compute2toPower(unsigned log2n)
     return result;
 }
 
-static void writeData(void* start, size_t size)
-{
-    char* writePtr = reinterpret_cast<char*>(start);
-
-    for (size_t sizeLeft = size; !!sizeLeft; ) {
-        size_t sizeThisIter = std::min(sizeLeft, 4096ul);
-        
-        writePtr[0] = random() & 0xff;
-        writePtr[1] = random() & 0xff;
-        writePtr[2] = random() & 0xff;
-        writePtr[3] = random() & 0xff;
-
-        writePtr += sizeThisIter;
-        sizeLeft -= sizeThisIter;
-    }
-}
-
 void Interpreter::doMallocOp(Op op, ThreadId threadId)
 {
     switch (op.opcode) {
         case op_malloc: {
             m_objects[op.slot] = { mbmalloc(op.size), op.size };
             assert(m_objects[op.slot].object);
-            writeData(m_objects[op.slot].object, op.size);
+            bzero(m_objects[op.slot].object, op.size);
             break;
         }
         case op_free: {
@@ -266,7 +248,7 @@ void Interpreter::doMallocOp(Op op, ThreadId threadId)
             size_t alignment = compute2toPower(op.alignLog2);
             m_objects[op.slot] = { mbmemalign(alignment, op.size), op.size };
             assert(m_objects[op.slot].object);
-            writeData(m_objects[op.slot].object, op.size);
+            bzero(m_objects[op.slot].object, op.size);
             break;
         }
         default: {
@@ -312,4 +294,4 @@ void Interpreter::Thread::switchTo()
     std::unique_lock<std::mutex> lock(m_myInterpreter->m_threadMutex);
     m_myInterpreter->m_currentThreadId = m_threadId;
     m_shouldRun.notify_one();
-}
\ No newline at end of file
+}