Ignore:
Timestamp:
Dec 10, 2008, 12:05:53 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-10 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

<rdar://problem/6428332> Remove the CTI return address table from CodeBlock

Step 2:

Convert the return address table from a HashMap to a sorted Vector. This
reduces the size of the data structure by ~4.5MB on Membuster head.

SunSpider reports a 0.5% progression.

  • bytecode/CodeBlock.cpp: (JSC::sizeInBytes): Generic method to get the cost of a Vector. (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
  • bytecode/CodeBlock.h: (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings. (JSC::getNativePC): Helper for binary chop. (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a NativePC using a binary chop of the pcVector. (JSC::CodeBlock::pcVector): Accessor.
  • interpreter/Interpreter.cpp: (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get(). (JSC::Interpreter::cti_op_instanceof): Ditto. (JSC::Interpreter::cti_op_resolve): Ditto. (JSC::Interpreter::cti_op_resolve_func): Ditto. (JSC::Interpreter::cti_op_resolve_skip): Ditto. (JSC::Interpreter::cti_op_resolve_with_base): Ditto. (JSC::Interpreter::cti_op_throw): Ditto. (JSC::Interpreter::cti_op_in): Ditto. (JSC::Interpreter::cti_vm_throw): Ditto.
  • jit/JIT.cpp: (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
File:
1 edited

Legend:

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

    r39156 r39182  
    110110    };
    111111
     112    struct PC {
     113        PC(void* nativePC, unsigned bytecodeIndex)
     114            : nativePC(nativePC)
     115            , bytecodeIndex(bytecodeIndex)
     116        {
     117        }
     118       
     119        void* nativePC;
     120        unsigned bytecodeIndex;
     121    };
     122
     123
     124    // valueAtPosition helpers for the binaryChop algorithm below.
     125
    112126    inline void* getStructureStubInfoReturnLocation(StructureStubInfo* structureStubInfo)
    113127    {
     
    118132    {
    119133        return callLinkInfo->callReturnLocation;
     134    }
     135
     136    inline void* getNativePC(PC* pc)
     137    {
     138        return pc->nativePC;
    120139    }
    121140
     
    236255        }
    237256
     257        unsigned getBytecodeIndex(void* nativePC)
     258        {
     259            return binaryChop<PC, void*, getNativePC>(m_pcVector.begin(), m_pcVector.size(), nativePC)->bytecodeIndex;
     260        }
    238261
    239262        Vector<Instruction>& instructions() { return m_instructions; }
     
    290313
    291314#if ENABLE(JIT)
    292         HashMap<void*, unsigned>& jitReturnAddressVPCMap() { return m_jitReturnAddressVPCMap; }
     315        Vector<PC>& pcVector() { return m_pcVector; }
    293316#endif
    294317
     
    391414
    392415#if ENABLE(JIT)
    393         HashMap<void*, unsigned> m_jitReturnAddressVPCMap;
     416        Vector<PC> m_pcVector;
    394417#endif
    395418
Note: See TracChangeset for help on using the changeset viewer.