Ignore:
Timestamp:
Jul 30, 2009, 7:20:11 PM (16 years ago)
Author:
[email protected]
Message:

2009-07-23 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

    r44711 r46618  
    3434#include "Structure.h"
    3535
     36
    3637namespace JSC {
    3738
     39    static const int access_get_by_id_self = 0;
     40    static const int access_get_by_id_proto = 1;
     41    static const int access_get_by_id_chain = 2;
     42    static const int access_get_by_id_self_list = 3;
     43    static const int access_get_by_id_proto_list = 4;
     44    static const int access_put_by_id_transition = 5;
     45    static const int access_put_by_id_replace = 6;
     46    static const int access_get_by_id = 7;
     47    static const int access_put_by_id = 8;
     48    static const int access_get_by_id_generic = 9;
     49    static const int access_put_by_id_generic = 10;
     50    static const int access_get_array_length = 11;
     51    static const int access_get_string_length = 12;
     52
    3853    struct StructureStubInfo {
    39         StructureStubInfo(OpcodeID opcodeID)
    40             : opcodeID(opcodeID)
     54        StructureStubInfo(int accessType)
     55            : accessType(accessType)
     56            , seen(false)
    4157        {
    4258        }
     
    4460        void initGetByIdSelf(Structure* baseObjectStructure)
    4561        {
    46             opcodeID = op_get_by_id_self;
     62            accessType = access_get_by_id_self;
    4763
    4864            u.getByIdSelf.baseObjectStructure = baseObjectStructure;
     
    5268        void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure)
    5369        {
    54             opcodeID = op_get_by_id_proto;
     70            accessType = access_get_by_id_proto;
    5571
    5672            u.getByIdProto.baseObjectStructure = baseObjectStructure;
     
    6379        void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain)
    6480        {
    65             opcodeID = op_get_by_id_chain;
     81            accessType = access_get_by_id_chain;
    6682
    6783            u.getByIdChain.baseObjectStructure = baseObjectStructure;
     
    7490        void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize)
    7591        {
    76             opcodeID = op_get_by_id_self_list;
     92            accessType = access_get_by_id_self_list;
    7793
    7894            u.getByIdProtoList.structureList = structureList;
     
    8298        void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize)
    8399        {
    84             opcodeID = op_get_by_id_proto_list;
     100            accessType = access_get_by_id_proto_list;
    85101
    86102            u.getByIdProtoList.structureList = structureList;
     
    92108        void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain)
    93109        {
    94             opcodeID = op_put_by_id_transition;
     110            accessType = access_put_by_id_transition;
    95111
    96112            u.putByIdTransition.previousStructure = previousStructure;
     
    106122        void initPutByIdReplace(Structure* baseObjectStructure)
    107123        {
    108             opcodeID = op_put_by_id_replace;
     124            accessType = access_put_by_id_replace;
    109125   
    110126            u.putByIdReplace.baseObjectStructure = baseObjectStructure;
     
    114130        void deref();
    115131
    116         OpcodeID opcodeID;
     132        bool seenOnce()
     133        {
     134            return seen;
     135        }
     136
     137        void setSeen()
     138        {
     139            seen = true;
     140        }
     141
     142        int accessType : 31;
     143        int seen : 1;
     144
    117145        union {
    118146            struct {
Note: See TracChangeset for help on using the changeset viewer.