Changeset 85240 in webkit


Ignore:
Timestamp:
Apr 28, 2011 2:37:56 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-04-28 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

Remove evil addressOfStructure() function
https://bugs.webkit.org/show_bug.cgi?id=59739

Remove the addressOfStructure function from JSCell, and update
callsites to use the same logic as testPrototype()

  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdProtoList):
  • jit/JITPropertyAccess32_64.cpp: (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdProtoList):
  • runtime/JSCell.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85236 r85240  
     12011-04-28  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        Remove evil addressOfStructure() function
     6        https://bugs.webkit.org/show_bug.cgi?id=59739
     7
     8        Remove the addressOfStructure function from JSCell, and update
     9        callsites to use the same logic as testPrototype()
     10
     11        * jit/JITPropertyAccess.cpp:
     12        (JSC::JIT::privateCompileGetByIdProto):
     13        (JSC::JIT::privateCompileGetByIdProtoList):
     14        * jit/JITPropertyAccess32_64.cpp:
     15        (JSC::JIT::privateCompileGetByIdProto):
     16        (JSC::JIT::privateCompileGetByIdProtoList):
     17        * runtime/JSCell.h:
     18
    1192011-04-28  Oliver Hunt  <oliver@apple.com>
    220
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r85236 r85240  
    713713
    714714    // Check the prototype object's Structure had not changed.
    715     const void* prototypeStructureAddress = protoObject->addressOfStructure();
    716 #if CPU(X86_64)
    717     move(TrustedImmPtr(prototypeStructure), regT3);
    718     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), regT3);
    719 #else
    720     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), TrustedImmPtr(prototypeStructure));
    721 #endif
     715    move(TrustedImmPtr(protoObject), regT3);
     716    Jump failureCases2 = branchPtr(NotEqual, Address(regT3, JSCell::structureOffset()), TrustedImmPtr(prototypeStructure));
    722717
    723718    bool needsStubLink = false;
     
    835830
    836831    // Check the prototype object's Structure had not changed.
    837     const void* prototypeStructureAddress = protoObject->addressOfStructure();
    838 #if CPU(X86_64)
    839     move(TrustedImmPtr(prototypeStructure), regT3);
    840     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), regT3);
    841 #else
    842     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), TrustedImmPtr(prototypeStructure));
    843 #endif
     832    move(TrustedImmPtr(protoObject), regT3);
     833    Jump failureCases2 = branchPtr(NotEqual, Address(regT3, JSCell::structureOffset()), TrustedImmPtr(prototypeStructure));
    844834
    845835    // Checks out okay!
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r85226 r85240  
    741741   
    742742    // Check the prototype object's Structure had not changed.
    743     const void* prototypeStructureAddress = protoObject->addressOfStructure();
    744 #if CPU(X86_64)
    745     move(TrustedImmPtr(prototypeStructure), regT3);
    746     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), regT3);
    747 #else
    748     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), TrustedImmPtr(prototypeStructure));
    749 #endif
     743    move(TrustedImmPtr(protoObject), regT3);
     744    Jump failureCases2 = branchPtr(NotEqual, Address(regT3, JSCell::structureOffset()), TrustedImmPtr(prototypeStructure));
     745
    750746    bool needsStubLink = false;
    751747    // Checks out okay!
     
    867863   
    868864    // Check the prototype object's Structure had not changed.
    869     const void* prototypeStructureAddress = protoObject->addressOfStructure();
    870 #if CPU(X86_64)
    871     move(TrustedImmPtr(prototypeStructure), regT3);
    872     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), regT3);
    873 #else
    874     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), TrustedImmPtr(prototypeStructure));
    875 #endif
     865    move(TrustedImmPtr(protoObject), regT3);
     866    Jump failureCases2 = branchPtr(NotEqual, Address(regT3, JSCell::structureOffset()), TrustedImmPtr(prototypeStructure));
    876867   
    877868    bool needsStubLink = false;
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r84800 r85240  
    148148        }
    149149
    150         const void* addressOfStructure() const
    151         {
    152             return &m_structure;
    153         }
    154 
    155150    protected:
    156151        static const unsigned AnonymousSlotCount = 0;
Note: See TracChangeset for help on using the changeset viewer.