Changeset 162390 in webkit


Ignore:
Timestamp:
Jan 20, 2014 4:46:17 PM (10 years ago)
Author:
fpizlo@apple.com
Message:

op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
https://bugs.webkit.org/show_bug.cgi?id=127311
<rdar://problem/15853958>

Reviewed by Andreas Kling.

This makes UnlinkedCodeBlocks use 32-bit instruction streams again.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedInstruction::UnlinkedInstruction):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::emitInitLazyRegister):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::watchableVariable):
(JSC::BytecodeGenerator::hasWatchableVariable):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r162389 r162390  
     12014-01-20  Filip Pizlo  <fpizlo@apple.com>
     2
     3        op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
     4        https://bugs.webkit.org/show_bug.cgi?id=127311
     5        <rdar://problem/15853958>
     6
     7        Reviewed by Andreas Kling.
     8       
     9        This makes UnlinkedCodeBlocks use 32-bit instruction streams again.
     10
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::CodeBlock):
     13        * bytecode/UnlinkedCodeBlock.h:
     14        (JSC::UnlinkedInstruction::UnlinkedInstruction):
     15        * bytecompiler/BytecodeGenerator.cpp:
     16        (JSC::BytecodeGenerator::addVar):
     17        (JSC::BytecodeGenerator::emitInitLazyRegister):
     18        (JSC::BytecodeGenerator::createArgumentsIfNecessary):
     19        * bytecompiler/BytecodeGenerator.h:
     20        (JSC::BytecodeGenerator::watchableVariable):
     21        (JSC::BytecodeGenerator::hasWatchableVariable):
     22
    1232014-01-20  Mark Lam  <mark.lam@apple.com>
    224
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r162389 r162390  
    18161816        case op_captured_mov:
    18171817        case op_new_captured_func: {
    1818             StringImpl* uid = pc[i + 3].u.uid;
    1819             if (!uid)
     1818            if (pc[i + 3].u.index == UINT_MAX) {
     1819                instructions[i + 3].u.watchpointSet = 0;
    18201820                break;
     1821            }
     1822            StringImpl* uid = identifier(pc[i + 3].u.index).impl();
    18211823            RELEASE_ASSERT(didCloneSymbolTable);
    18221824            ConcurrentJITLocker locker(m_symbolTable->m_lock);
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r162389 r162390  
    229229    UnlinkedInstruction(OpcodeID opcode) { u.opcode = opcode; }
    230230    UnlinkedInstruction(int operand) { u.operand = operand; }
    231     UnlinkedInstruction(StringImpl* uid) { u.uid = uid; }
    232231    union {
    233232        OpcodeID opcode;
    234233        int32_t operand;
    235         StringImpl* uid;
     234        unsigned index;
    236235    } u;
    237236};
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r162270 r162390  
    133133    if (watchMode == IsWatchable) {
    134134        while (m_watchableVariables.size() < static_cast<size_t>(m_codeBlock->m_numVars))
    135             m_watchableVariables.append(nullptr);
    136         m_watchableVariables.append(ident.impl());
     135            m_watchableVariables.append(Identifier());
     136        m_watchableVariables.append(ident);
    137137    }
    138138   
     
    470470    emitOpcode(op_init_lazy_reg);
    471471    instructions().append(reg->index());
    472     ASSERT(!watchableVariable(reg->index()));
     472    ASSERT(!hasWatchableVariable(reg->index()));
    473473    return reg;
    474474}
     
    16291629    emitOpcode(op_create_arguments);
    16301630    instructions().append(m_codeBlock->argumentsRegister().offset());
    1631     ASSERT(!watchableVariable(m_codeBlock->argumentsRegister().offset()));
     1631    ASSERT(!hasWatchableVariable(m_codeBlock->argumentsRegister().offset()));
    16321632}
    16331633
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r160109 r162390  
    592592        RegisterID* createLazyRegisterIfNecessary(RegisterID*);
    593593       
    594         StringImpl* watchableVariable(int operand)
     594        unsigned watchableVariable(int operand)
    595595        {
    596596            VirtualRegister reg(operand);
    597597            if (!reg.isLocal())
    598                 return 0;
     598                return UINT_MAX;
    599599            if (static_cast<size_t>(reg.toLocal()) >= m_watchableVariables.size())
    600                 return 0;
    601             return m_watchableVariables[reg.toLocal()];
     600                return UINT_MAX;
     601            Identifier& ident = m_watchableVariables[reg.toLocal()];
     602            if (ident.isNull())
     603                return UINT_MAX;
     604            return addConstant(ident);
     605        }
     606       
     607        bool hasWatchableVariable(int operand)
     608        {
     609            return watchableVariable(operand) != UINT_MAX;
    602610        }
    603611       
     
    621629        RegisterID* m_emptyValueRegister;
    622630        RegisterID* m_globalObjectRegister;
    623         Vector<StringImpl*, 16> m_watchableVariables;
     631        Vector<Identifier, 16> m_watchableVariables;
    624632        SegmentedVector<RegisterID, 32> m_constantPoolRegisters;
    625633        SegmentedVector<RegisterID, 32> m_calleeRegisters;
Note: See TracChangeset for help on using the changeset viewer.