Ignore:
Timestamp:
Aug 6, 2009, 8:05:42 PM (16 years ago)
Author:
[email protected]
Message:

2009-08-06 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
( https://bugs.webkit.org/show_bug.cgi?id=27635 )

This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
(No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).

  • bytecode/CodeBlock.cpp: (JSC::printStructureStubInfo):
    • Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
  • bytecode/CodeBlock.h: (JSC::): (JSC::CallLinkInfo::seenOnce): (JSC::CallLinkInfo::setSeen): (JSC::MethodCallLinkInfo::seenOnce): (JSC::MethodCallLinkInfo::setSeen):
    • Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
  • bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::deref):
    • Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
  • bytecode/StructureStubInfo.h: (JSC::StructureStubInfo::StructureStubInfo): (JSC::StructureStubInfo::initGetByIdSelf): (JSC::StructureStubInfo::initGetByIdProto): (JSC::StructureStubInfo::initGetByIdChain): (JSC::StructureStubInfo::initGetByIdSelfList): (JSC::StructureStubInfo::initGetByIdProtoList): (JSC::StructureStubInfo::initPutByIdTransition): (JSC::StructureStubInfo::initPutByIdReplace): (JSC::StructureStubInfo::seenOnce): (JSC::StructureStubInfo::setSeen):
    • Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById):
    • Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
  • jit/JIT.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::unlinkCall):
    • Remove the "don't lazy link" stage of calls.
  • jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines):
    • Remove the "don't lazy link" stage of calls.
  • jit/JITCall.cpp: (JSC::JIT::compileOpCallSlowCase):
    • Remove the "don't lazy link" stage of calls.
  • jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): (JSC::JITThunks::tryCachePutByID): (JSC::JITThunks::tryCacheGetByID): (JSC::JITStubs::DEFINE_STUB_FUNCTION): (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
    • Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
  • jit/JITStubs.h: (JSC::JITThunks::ctiStringLengthTrampoline): (JSC::JITStubs::):
    • Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
  • wtf/PtrAndFlags.h: (WTF::PtrAndFlags::PtrAndFlags): (WTF::PtrAndFlags::operator!): (WTF::PtrAndFlags::operator->):
    • Add ! and -> operators, add constuctor with pointer argument.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r46831 r46879  
    3737#include "JumpTable.h"
    3838#include "Nodes.h"
     39#include "PtrAndFlags.h"
    3940#include "RegExp.h"
    4041#include "UString.h"
     
    5455
    5556namespace JSC {
     57
     58    enum HasSeenShouldRepatch {
     59        hasSeenShouldRepatch
     60    };
    5661
    5762    class ExecState;
     
    106111        CodeLocationDataLabelPtr hotPathBegin;
    107112        CodeLocationNearCall hotPathOther;
    108         CodeBlock* ownerCodeBlock;
     113        PtrAndFlags<CodeBlock, HasSeenShouldRepatch> ownerCodeBlock;
    109114        CodeBlock* callee;
    110115        unsigned position;
     
    112117        void setUnlinked() { callee = 0; }
    113118        bool isLinked() { return callee; }
     119
     120        bool seenOnce()
     121        {
     122            return ownerCodeBlock.isFlagSet(hasSeenShouldRepatch);
     123        }
     124
     125        void setSeen()
     126        {
     127            ownerCodeBlock.setFlag(hasSeenShouldRepatch);
     128        }
    114129    };
    115130
     
    117132        MethodCallLinkInfo()
    118133            : cachedStructure(0)
    119             , cachedPrototypeStructure(0)
    120         {
     134        {
     135        }
     136
     137        bool seenOnce()
     138        {
     139            return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch);
     140        }
     141
     142        void setSeen()
     143        {
     144            cachedPrototypeStructure.setFlag(hasSeenShouldRepatch);
    121145        }
    122146
     
    124148        CodeLocationDataLabelPtr structureLabel;
    125149        Structure* cachedStructure;
    126         Structure* cachedPrototypeStructure;
     150        PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure;
    127151    };
    128152
Note: See TracChangeset for help on using the changeset viewer.