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.cpp

    r46620 r46879  
    3232void StructureStubInfo::deref()
    3333{
    34     switch (opcodeID) {
    35     case op_get_by_id_self:
     34    switch (accessType) {
     35    case access_get_by_id_self:
    3636        u.getByIdSelf.baseObjectStructure->deref();
    3737        return;
    38     case op_get_by_id_proto:
     38    case access_get_by_id_proto:
    3939        u.getByIdProto.baseObjectStructure->deref();
    4040        u.getByIdProto.prototypeStructure->deref();
    4141        return;
    42     case op_get_by_id_chain:
     42    case access_get_by_id_chain:
    4343        u.getByIdChain.baseObjectStructure->deref();
    4444        u.getByIdChain.chain->deref();
    4545        return;
    46     case op_get_by_id_self_list: {
     46    case access_get_by_id_self_list: {
    4747        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
    4848        polymorphicStructures->derefStructures(u.getByIdSelfList.listSize);
     
    5050        return;
    5151    }
    52     case op_get_by_id_proto_list: {
     52    case access_get_by_id_proto_list: {
    5353        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
    5454        polymorphicStructures->derefStructures(u.getByIdProtoList.listSize);
     
    5656        return;
    5757    }
    58     case op_put_by_id_transition:
     58    case access_put_by_id_transition:
    5959        u.putByIdTransition.previousStructure->deref();
    6060        u.putByIdTransition.structure->deref();
    6161        u.putByIdTransition.chain->deref();
    6262        return;
    63     case op_put_by_id_replace:
     63    case access_put_by_id_replace:
    6464        u.putByIdReplace.baseObjectStructure->deref();
    6565        return;
    66     case op_get_by_id:
    67     case op_put_by_id:
    68     case op_get_by_id_generic:
    69     case op_put_by_id_generic:
    70     case op_get_array_length:
    71     case op_get_string_length:
     66    case access_get_by_id:
     67    case access_put_by_id:
     68    case access_get_by_id_generic:
     69    case access_put_by_id_generic:
     70    case access_get_array_length:
     71    case access_get_string_length:
    7272        // These instructions don't ref their Structures.
    7373        return;
Note: See TracChangeset for help on using the changeset viewer.