Changeset 59777 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
May 19, 2010, 11:28:54 AM (15 years ago)
Author:
[email protected]
Message:

Standardized naming: "bytecode offset" wins; "bytecode index" loses.

Reviewed by Gavin Barraclough.

Also renamed getBytecodeOffset to bytecodeOffset, to match the WebKit
naming style.

  • bytecode/CodeBlock.h:

(JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset):
(JSC::getCallReturnOffset):
(JSC::CodeBlock::bytecodeOffset):
(JSC::CodeBlock::callReturnIndexVector):

  • interpreter/Interpreter.cpp:

(JSC::bytecodeOffsetForPC):

  • jit/JIT.cpp:

(JSC::JIT::JIT):
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileLinkPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::privateCompile):

  • jit/JIT.h:

(JSC::CallRecord::CallRecord):
(JSC::JumpTable::JumpTable):
(JSC::SwitchRecord::SwitchRecord):

  • jit/JITCall.cpp:

(JSC::JIT::compileOpCallVarargsSlowCase):
(JSC::JIT::compileOpCall):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitNakedCall):
(JSC::JIT::addSlowCase):
(JSC::JIT::addJump):
(JSC::JIT::emitJumpSlowToHot):
(JSC::JIT::isLabeled):
(JSC::JIT::map):
(JSC::JIT::unmap):
(JSC::JIT::isMapped):
(JSC::JIT::getMappedPayload):
(JSC::JIT::getMappedTag):
(JSC::JIT::emitGetVirtualRegister):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_new_error):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_mov):
(JSC::JIT::emit_op_get_global_var):
(JSC::JIT::emit_op_put_global_var):
(JSC::JIT::emit_op_get_scoped_var):
(JSC::JIT::emit_op_put_scoped_var):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_resolve_global):
(JSC::JIT::emit_op_to_jsnumber):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_new_error):
(JSC::JIT::emit_op_convert_this):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_method_check):
(JSC::JIT::emitSlow_op_method_check):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_method_check):
(JSC::JIT::emitSlow_op_method_check):
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_get_by_pname):

  • jit/JITStubCall.h:

(JSC::JITStubCall::call):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r59339 r59777  
    7979    , m_propertyAccessCompilationInfo(codeBlock ? codeBlock->numberOfStructureStubInfos() : 0)
    8080    , m_callStructureStubCompilationInfo(codeBlock ? codeBlock->numberOfCallLinkInfos() : 0)
    81     , m_bytecodeIndex((unsigned)-1)
     81    , m_bytecodeOffset((unsigned)-1)
    8282#if USE(JSVALUE32_64)
    8383    , m_jumpTargetIndex(0)
    84     , m_mappedBytecodeIndex((unsigned)-1)
     84    , m_mappedBytecodeOffset((unsigned)-1)
    8585    , m_mappedVirtualRegisterIndex((unsigned)-1)
    8686    , m_mappedTag((RegisterID)-1)
     
    115115
    116116#define NEXT_OPCODE(name) \
    117     m_bytecodeIndex += OPCODE_LENGTH(name); \
     117    m_bytecodeOffset += OPCODE_LENGTH(name); \
    118118    break;
    119119
     
    177177    m_callLinkInfoIndex = 0;
    178178
    179     for (m_bytecodeIndex = 0; m_bytecodeIndex < instructionCount; ) {
    180         Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
    181         ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(currentInstruction->u.opcode), "privateCompileMainPass gone bad @ %d", m_bytecodeIndex);
     179    for (m_bytecodeOffset = 0; m_bytecodeOffset < instructionCount; ) {
     180        Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset;
     181        ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(currentInstruction->u.opcode), "privateCompileMainPass gone bad @ %d", m_bytecodeOffset);
    182182
    183183#if ENABLE(OPCODE_SAMPLING)
    184         if (m_bytecodeIndex > 0) // Avoid the overhead of sampling op_enter twice.
     184        if (m_bytecodeOffset > 0) // Avoid the overhead of sampling op_enter twice.
    185185            sampleInstruction(currentInstruction);
    186186#endif
    187187
    188188#if !USE(JSVALUE32_64)
    189         if (m_labels[m_bytecodeIndex].isUsed())
     189        if (m_labels[m_bytecodeOffset].isUsed())
    190190            killLastResultRegister();
    191191#endif
    192192
    193         m_labels[m_bytecodeIndex] = label();
     193        m_labels[m_bytecodeOffset] = label();
    194194
    195195        switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
     
    348348#ifndef NDEBUG
    349349    // Reset this, in order to guard its use with ASSERTs.
    350     m_bytecodeIndex = (unsigned)-1;
     350    m_bytecodeOffset = (unsigned)-1;
    351351#endif
    352352}
     
    357357    unsigned jmpTableCount = m_jmpTable.size();
    358358    for (unsigned i = 0; i < jmpTableCount; ++i)
    359         m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeIndex], this);
     359        m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeOffset], this);
    360360    m_jmpTable.clear();
    361361}
     
    374374#endif
    375375
    376         m_bytecodeIndex = iter->to;
     376        m_bytecodeOffset = iter->to;
    377377#ifndef NDEBUG
    378         unsigned firstTo = m_bytecodeIndex;
    379 #endif
    380         Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
     378        unsigned firstTo = m_bytecodeOffset;
     379#endif
     380        Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset;
    381381
    382382        switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
     
    451451#ifndef NDEBUG
    452452    // Reset this, in order to guard its use with ASSERTs.
    453     m_bytecodeIndex = (unsigned)-1;
     453    m_bytecodeOffset = (unsigned)-1;
    454454#endif
    455455}
     
    484484    if (m_codeBlock->codeType() == FunctionCode) {
    485485        registerFileCheck.link(this);
    486         m_bytecodeIndex = 0;
     486        m_bytecodeOffset = 0;
    487487        JITStubCall(this, cti_register_file_check).call();
    488488#ifndef NDEBUG
    489         m_bytecodeIndex = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
     489        m_bytecodeOffset = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
    490490#endif
    491491        jump(functionBody);
     
    499499    for (unsigned i = 0; i < m_switches.size(); ++i) {
    500500        SwitchRecord record = m_switches[i];
    501         unsigned bytecodeIndex = record.bytecodeIndex;
     501        unsigned bytecodeOffset = record.bytecodeOffset;
    502502
    503503        if (record.type != SwitchRecord::String) {
     
    505505            ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size());
    506506
    507             record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + record.defaultOffset]);
     507            record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeOffset + record.defaultOffset]);
    508508
    509509            for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) {
    510510                unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j];
    511                 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
     511                record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.locationOf(m_labels[bytecodeOffset + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
    512512            }
    513513        } else {
    514514            ASSERT(record.type == SwitchRecord::String);
    515515
    516             record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + record.defaultOffset]);
     516            record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeOffset + record.defaultOffset]);
    517517
    518518            StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end();           
    519519            for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) {
    520520                unsigned offset = it->second.branchOffset;
    521                 it->second.ctiOffset = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
     521                it->second.ctiOffset = offset ? patchBuffer.locationOf(m_labels[bytecodeOffset + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
    522522            }
    523523        }
     
    537537        m_codeBlock->callReturnIndexVector().reserveCapacity(m_calls.size());
    538538        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter)
    539             m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeIndex(patchBuffer.returnAddressOffset(iter->from), iter->bytecodeIndex));
     539            m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeOffset(patchBuffer.returnAddressOffset(iter->from), iter->bytecodeOffset));
    540540    }
    541541
Note: See TracChangeset for help on using the changeset viewer.