A few MallocBench record/replay fixes
[WebKit-https.git] / PerformanceTests / MallocBench / MallocBench / Interpreter.cpp
index 4d76c1392b36c948bf4623dbd3e53cf31af26746..92636caff651fec26a125fdca7fb5dcd728880a9 100644 (file)
@@ -93,19 +93,23 @@ void Interpreter::run()
         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);
+                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();