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/StructureStubInfo.h

    r46620 r46879  
    3636namespace JSC {
    3737
     38    enum AccessType {
     39        access_get_by_id_self,
     40        access_get_by_id_proto,
     41        access_get_by_id_chain,
     42        access_get_by_id_self_list,
     43        access_get_by_id_proto_list,
     44        access_put_by_id_transition,
     45        access_put_by_id_replace,
     46        access_get_by_id,
     47        access_put_by_id,
     48        access_get_by_id_generic,
     49        access_put_by_id_generic,
     50        access_get_array_length,
     51        access_get_string_length,
     52    };
     53
    3854    struct StructureStubInfo {
    39         StructureStubInfo(OpcodeID opcodeID)
    40             : opcodeID(opcodeID)
     55        StructureStubInfo(AccessType accessType)
     56            : accessType(accessType)
     57            , seen(false)
    4158        {
    4259        }
     
    4461        void initGetByIdSelf(Structure* baseObjectStructure)
    4562        {
    46             opcodeID = op_get_by_id_self;
     63            accessType = access_get_by_id_self;
    4764
    4865            u.getByIdSelf.baseObjectStructure = baseObjectStructure;
     
    5269        void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure)
    5370        {
    54             opcodeID = op_get_by_id_proto;
     71            accessType = access_get_by_id_proto;
    5572
    5673            u.getByIdProto.baseObjectStructure = baseObjectStructure;
     
    6380        void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain)
    6481        {
    65             opcodeID = op_get_by_id_chain;
     82            accessType = access_get_by_id_chain;
    6683
    6784            u.getByIdChain.baseObjectStructure = baseObjectStructure;
     
    7491        void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize)
    7592        {
    76             opcodeID = op_get_by_id_self_list;
     93            accessType = access_get_by_id_self_list;
    7794
    7895            u.getByIdProtoList.structureList = structureList;
     
    8299        void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize)
    83100        {
    84             opcodeID = op_get_by_id_proto_list;
     101            accessType = access_get_by_id_proto_list;
    85102
    86103            u.getByIdProtoList.structureList = structureList;
     
    92109        void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain)
    93110        {
    94             opcodeID = op_put_by_id_transition;
     111            accessType = access_put_by_id_transition;
    95112
    96113            u.putByIdTransition.previousStructure = previousStructure;
     
    106123        void initPutByIdReplace(Structure* baseObjectStructure)
    107124        {
    108             opcodeID = op_put_by_id_replace;
     125            accessType = access_put_by_id_replace;
    109126   
    110127            u.putByIdReplace.baseObjectStructure = baseObjectStructure;
     
    114131        void deref();
    115132
    116         OpcodeID opcodeID;
     133        bool seenOnce()
     134        {
     135            return seen;
     136        }
     137
     138        void setSeen()
     139        {
     140            seen = true;
     141        }
     142
     143        int accessType : 31;
     144        int seen : 1;
     145
    117146        union {
    118147            struct {
Note: See TracChangeset for help on using the changeset viewer.