Ignore:
Timestamp:
Dec 5, 2008, 12:27:58 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey Garen.

Encapsulate access to jump tables in the CodeBlock in preparation
of moving them to a rare data structure.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::shrinkToFit):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::numberOfImmediateSwitchJumpTables): (JSC::CodeBlock::addImmediateSwitchJumpTable): (JSC::CodeBlock::immediateSwitchJumpTable): (JSC::CodeBlock::numberOfCharacterSwitchJumpTables): (JSC::CodeBlock::addCharacterSwitchJumpTable): (JSC::CodeBlock::characterSwitchJumpTable): (JSC::CodeBlock::numberOfStringSwitchJumpTables): (JSC::CodeBlock::addStringSwitchJumpTable): (JSC::CodeBlock::stringSwitchJumpTable):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::generate): (JSC::BytecodeGenerator::endSwitch):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): (JSC::Interpreter::cti_op_switch_imm): (JSC::Interpreter::cti_op_switch_char): (JSC::Interpreter::cti_op_switch_string):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
File:
1 edited

Legend:

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

    r38498 r39038  
    311311        }
    312312
     313        void shrinkToFit();
     314
     315        size_t numberOfImmediateSwitchJumpTables() const { return m_immediateSwitchJumpTables.size(); }
     316        SimpleJumpTable& addImmediateSwitchJumpTable() { m_immediateSwitchJumpTables.append(SimpleJumpTable()); return m_immediateSwitchJumpTables.last(); }
     317        SimpleJumpTable& immediateSwitchJumpTable(int tableIndex) { return m_immediateSwitchJumpTables[tableIndex]; }
     318
     319        size_t numberOfCharacterSwitchJumpTables() const { return m_characterSwitchJumpTables.size(); }
     320        SimpleJumpTable& addCharacterSwitchJumpTable() { m_characterSwitchJumpTables.append(SimpleJumpTable()); return m_characterSwitchJumpTables.last(); }
     321        SimpleJumpTable& characterSwitchJumpTable(int tableIndex) { return m_characterSwitchJumpTables[tableIndex]; }
     322
     323        size_t numberOfStringSwitchJumpTables() const { return m_stringSwitchJumpTables.size(); }
     324        StringJumpTable& addStringSwitchJumpTable() { m_stringSwitchJumpTables.append(StringJumpTable()); return m_stringSwitchJumpTables.last(); }
     325        StringJumpTable& stringSwitchJumpTable(int tableIndex) { return m_stringSwitchJumpTables[tableIndex]; }
     326
    313327        ScopeNode* ownerNode;
    314328        JSGlobalData* globalData;
     
    351365        Vector<LineInfo> lineInfo;
    352366
    353         Vector<SimpleJumpTable> immediateSwitchJumpTables;
    354         Vector<SimpleJumpTable> characterSwitchJumpTables;
    355         Vector<StringJumpTable> stringSwitchJumpTables;
    356 
    357367#if ENABLE(JIT)
    358368        HashMap<void*, unsigned> ctiReturnAddressVPCMap;
     
    369379#endif
    370380
     381        Vector<SimpleJumpTable> m_immediateSwitchJumpTables;
     382        Vector<SimpleJumpTable> m_characterSwitchJumpTables;
     383        Vector<StringJumpTable> m_stringSwitchJumpTables;
    371384    };
    372385
Note: See TracChangeset for help on using the changeset viewer.