Changeset 167203 in webkit


Ignore:
Timestamp:
Apr 13, 2014 4:21:20 PM (10 years ago)
Author:
ggaren@apple.com
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.

Location:
trunk/PerformanceTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r167124 r167203  
     12014-04-13  Geoffrey Garen  <ggaren@apple.com>
     2
     3        MallocBench record/replay should support realloc
     4        https://bugs.webkit.org/show_bug.cgi?id=131598
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * MallocBench/MallocBench.xcodeproj/project.pbxproj: Fixed some linkage
     9        issues that caused us not to fully link to system malloc in the default
     10        case. Also marked mbmalloc.dylib as required so the error message will
     11        be clearer if we mess up.
     12
     13        * MallocBench/MallocBench/Interpreter.cpp:
     14        (Interpreter::run):
     15        * MallocBench/MallocBench/Interpreter.h: Added the realloc case, and
     16        upgraded one-letter names to full words.
     17
    1182014-04-11  Dirk Schulze  <krit@webkit.org>
    219
  • trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj

    r166667 r167203  
    1414                14452CB0177D24460097E057 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CAF177D24460097E057 /* main.cpp */; };
    1515                14452CEF177D47110097E057 /* churn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14452CED177D47110097E057 /* churn.cpp */; };
     16                1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1447AE8318FB4B2400B3D7FF /* libSystem.dylib */; };
    1617                1451FAED18B14B7100DB6D47 /* medium.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1451FAEB18B14B7100DB6D47 /* medium.cpp */; };
    1718                14976EC8177E3649006B819A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976EC6177E3649006B819A /* list.cpp */; };
     
    2223                14C5009018401841007A531D /* facebook.ops in CopyFiles */ = {isa = PBXBuildFile; fileRef = 14C5008E18401726007A531D /* facebook.ops */; };
    2324                14C5009318403DA0007A531D /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14C5009118403DA0007A531D /* Interpreter.cpp */; };
    24                 14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
     25                14CC393C18EA812B004AFE34 /* libmbmalloc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CC393818EA811F004AFE34 /* libmbmalloc.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
    2526                14CC393F18EA8184004AFE34 /* mbmalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CC391C18EA6759004AFE34 /* mbmalloc.cpp */; };
    2627                14CE4A6017BD355800288DAA /* big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CE4A5E17BD355800288DAA /* big.cpp */; };
     
    6465                14452CED177D47110097E057 /* churn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = churn.cpp; path = MallocBench/churn.cpp; sourceTree = "<group>"; };
    6566                14452CEE177D47110097E057 /* churn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = churn.h; path = MallocBench/churn.h; sourceTree = "<group>"; };
     67                1447AE8318FB4B2400B3D7FF /* libSystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libSystem.dylib; path = /usr/lib/libSystem.dylib; sourceTree = "<absolute>"; };
    6668                1451FAEB18B14B7100DB6D47 /* medium.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = medium.cpp; path = MallocBench/medium.cpp; sourceTree = "<group>"; };
    6769                1451FAEC18B14B7100DB6D47 /* medium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = medium.h; path = MallocBench/medium.h; sourceTree = "<group>"; };
     
    101103                        buildActionMask = 2147483647;
    102104                        files = (
     105                                1447AE8418FB4B2400B3D7FF /* libSystem.dylib in Frameworks */,
    103106                        );
    104107                        runOnlyForDeploymentPostprocessing = 0;
     
    113116                                14452CAE177D24460097E057 /* MallocBench */,
    114117                                14CC391B18EA6722004AFE34 /* mbmalloc */,
     118                                1447AE8618FB4B5100B3D7FF /* Libraries */,
    115119                                14452CAA177D24460097E057 /* Products */,
    116120                        );
     
    140144                        );
    141145                        path = MallocBench;
     146                        sourceTree = "<group>";
     147                };
     148                1447AE8618FB4B5100B3D7FF /* Libraries */ = {
     149                        isa = PBXGroup;
     150                        children = (
     151                                1447AE8318FB4B2400B3D7FF /* libSystem.dylib */,
     152                        );
     153                        name = Libraries;
    142154                        sourceTree = "<group>";
    143155                };
  • trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp

    r166667 r167203  
    9494            Op op = ops[i];
    9595            switch (op.opcode) {
    96             case op_a: {
     96            case op_malloc: {
    9797                m_objects[op.slot] = { mbmalloc(op.size), op.size };
    9898                assert(m_objects[op.slot].object);
     
    100100                break;
    101101            }
    102             case op_d: {
     102            case op_free: {
    103103                assert(m_objects[op.slot].object);
    104104                assert(m_objects[op.slot].size);
    105105                mbfree(m_objects[op.slot].object, m_objects[op.slot].size);
    106106                m_objects[op.slot] = { 0, 0 };
     107                break;
     108            }
     109            case op_realloc: {
     110                assert(m_objects[op.slot].object);
     111                assert(m_objects[op.slot].size);
     112                m_objects[op.slot] = { mbrealloc(m_objects[op.slot].object, m_objects[op.slot].size, op.size), op.size };
    107113                break;
    108114            }
  • trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h

    r166667 r167203  
    3737
    3838private:
    39     enum Opcode { op_a, op_d };
     39    enum Opcode { op_malloc, op_free, op_realloc };
    4040    struct Op { Opcode opcode; size_t slot; size_t size; };
    4141    struct Record { void* object; size_t size; };
Note: See TracChangeset for help on using the changeset viewer.