Changeset 38219 in webkit for trunk/JavaScriptCore/bytecompiler


Ignore:
Timestamp:
Nov 7, 2008, 1:22:41 AM (17 years ago)
Author:
[email protected]
Message:

2008-11-07 Cameron Zwarich <[email protected]>

Reviewed by Alexey Proskuryakov.

Rename the m_nextGlobal, m_nextParameter, and m_nextConstant member
variables of CodeGenerator to m_nextGlobalIndex, m_nextParameterIndex,
and m_nextConstantIndex respectively. This is to distinguish these from
member variables like m_lastConstant, which are actually RefPtrs to
Registers.

  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::addGlobalVar): (JSC::CodeGenerator::allocateConstants): (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::addParameter): (JSC::CodeGenerator::addConstant):
  • bytecompiler/CodeGenerator.h:
Location:
trunk/JavaScriptCore/bytecompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp

    r38196 r38219  
    166166bool CodeGenerator::addGlobalVar(const Identifier& ident, bool isConstant, RegisterID*& r0)
    167167{
    168     int index = m_nextGlobal;
     168    int index = m_nextGlobalIndex;
    169169    SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
    170170    pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
     
    173173        index = result.first->second.getIndex();
    174174    else {
    175         --m_nextGlobal;
     175        --m_nextGlobalIndex;
    176176        m_globals.append(index + m_globalVarStorageOffset);
    177177    }
     
    187187        return;
    188188   
    189     m_nextConstant = m_calleeRegisters.size();
     189    m_nextConstantIndex = m_calleeRegisters.size();
    190190
    191191    for (size_t i = 0; i < count; ++i)
     
    205205    , m_dynamicScopeDepth(0)
    206206    , m_codeType(GlobalCode)
    207     , m_nextGlobal(-1)
     207    , m_nextGlobalIndex(-1)
    208208    , m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
    209209    , m_lastOpcodeID(op_end)
     
    237237    if (canOptimizeNewGlobals) {
    238238        // Shift new symbols so they get stored prior to existing symbols.
    239         m_nextGlobal -= symbolTable->size();
     239        m_nextGlobalIndex -= symbolTable->size();
    240240
    241241        for (size_t i = 0; i < functionStack.size(); ++i) {
     
    322322    const Identifier* parameters = functionBody->parameters();
    323323    size_t parameterCount = functionBody->parameterCount();
    324     m_nextParameter = -RegisterFile::CallFrameHeaderSize - parameterCount - 1;
     324    m_nextParameterIndex = -RegisterFile::CallFrameHeaderSize - parameterCount - 1;
    325325    m_parameters.resize(1 + parameterCount); // reserve space for "this"
    326326
    327327    // Add "this" as a parameter
    328     m_thisRegister.setIndex(m_nextParameter);
    329     ++m_nextParameter;
     328    m_thisRegister.setIndex(m_nextParameterIndex);
     329    ++m_nextParameterIndex;
    330330    ++m_codeBlock->numParameters;
    331331
     
    371371    UString::Rep* rep = ident.ustring().rep();
    372372    if (!m_functions.contains(rep)) {
    373         symbolTable().set(rep, m_nextParameter);
    374         RegisterID& parameter = registerFor(m_nextParameter);
    375         parameter.setIndex(m_nextParameter);
     373        symbolTable().set(rep, m_nextParameterIndex);
     374        RegisterID& parameter = registerFor(m_nextParameterIndex);
     375        parameter.setIndex(m_nextParameterIndex);
    376376        result = &parameter;
    377377    }
     
    379379    // To maintain the calling convention, we have to allocate unique space for
    380380    // each parameter, even if the parameter doesn't make it into the symbol table.
    381     ++m_nextParameter;
     381    ++m_nextParameterIndex;
    382382    ++m_codeBlock->numParameters;
    383383    return result;
     
    684684RegisterID* CodeGenerator::addConstant(JSValue* v)
    685685{
    686     pair<JSValueMap::iterator, bool> result = m_jsValueMap.add(v, m_nextConstant);
     686    pair<JSValueMap::iterator, bool> result = m_jsValueMap.add(v, m_nextConstantIndex);
    687687    if (result.second) {
    688         RegisterID& constant = m_calleeRegisters[m_nextConstant];
     688        RegisterID& constant = m_calleeRegisters[m_nextConstantIndex];
    689689       
    690         ++m_nextConstant;
     690        ++m_nextConstantIndex;
    691691
    692692        m_codeBlock->constantRegisters.append(v);
  • trunk/JavaScriptCore/bytecompiler/CodeGenerator.h

    r38205 r38219  
    426426        Vector<SwitchInfo> m_switchContextStack;
    427427
    428         int m_nextGlobal;
    429         int m_nextParameter;
    430         int m_nextConstant;
     428        int m_nextGlobalIndex;
     429        int m_nextParameterIndex;
     430        int m_nextConstantIndex;
    431431
    432432        int m_globalVarStorageOffset;
Note: See TracChangeset for help on using the changeset viewer.