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

    r46620 r46879  
    231231static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned instructionOffset)
    232232{
    233     switch (stubInfo.opcodeID) {
    234     case op_get_by_id_self:
     233    switch (stubInfo.accessType) {
     234    case access_get_by_id_self:
    235235        printf("  [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).UTF8String().c_str());
    236236        return;
    237     case op_get_by_id_proto:
     237    case access_get_by_id_proto:
    238238        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).UTF8String().c_str());
    239239        return;
    240     case op_get_by_id_chain:
     240    case access_get_by_id_chain:
    241241        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdChain.chain).UTF8String().c_str());
    242242        return;
    243     case op_get_by_id_self_list:
     243    case access_get_by_id_self_list:
    244244        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).UTF8String().c_str(), stubInfo.u.getByIdSelfList.listSize);
    245245        return;
    246     case op_get_by_id_proto_list:
     246    case access_get_by_id_proto_list:
    247247        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).UTF8String().c_str(), stubInfo.u.getByIdProtoList.listSize);
    248248        return;
    249     case op_put_by_id_transition:
     249    case access_put_by_id_transition:
    250250        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).UTF8String().c_str());
    251251        return;
    252     case op_put_by_id_replace:
     252    case access_put_by_id_replace:
    253253        printf("  [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).UTF8String().c_str());
    254254        return;
    255     case op_get_by_id:
     255    case access_get_by_id:
    256256        printf("  [%4d] %s\n", instructionOffset, "get_by_id");
    257257        return;
    258     case op_put_by_id:
     258    case access_put_by_id:
    259259        printf("  [%4d] %s\n", instructionOffset, "put_by_id");
    260260        return;
    261     case op_get_by_id_generic:
     261    case access_get_by_id_generic:
    262262        printf("  [%4d] %s\n", instructionOffset, "op_get_by_id_generic");
    263263        return;
    264     case op_put_by_id_generic:
     264    case access_put_by_id_generic:
    265265        printf("  [%4d] %s\n", instructionOffset, "op_put_by_id_generic");
    266266        return;
    267     case op_get_array_length:
     267    case access_get_array_length:
    268268        printf("  [%4d] %s\n", instructionOffset, "op_get_array_length");
    269269        return;
    270     case op_get_string_length:
     270    case access_get_string_length:
    271271        printf("  [%4d] %s\n", instructionOffset, "op_get_string_length");
    272272        return;
     
    13201320            structure->deref();
    13211321            // Both members must be filled at the same time
    1322             ASSERT(m_methodCallLinkInfos[i].cachedPrototypeStructure);
     1322            ASSERT(!!m_methodCallLinkInfos[i].cachedPrototypeStructure);
    13231323            m_methodCallLinkInfos[i].cachedPrototypeStructure->deref();
    13241324        }
Note: See TracChangeset for help on using the changeset viewer.